Alternative way of instanciating a class without a library and without the
__Package hack either.
Create a class with this function:
function attachClassMovie(parentmc:MovieClip, className:Function,
instanceName:String, depth:Number, argv:Array):MovieClip
{
// Create emptyMovieClip
var new_mc:Mov
Ian,
Those casting gymnastics definitely help — thanks a lot.
Julian
On Jul 7, 2006, at 9:27 PDT, Ian Thomas wrote:
On 7/7/06, Julian Bleecker <[EMAIL PROTECTED]> wrote:
One other thing occurred to me on this topic, that might actually
save the trouble of using a hash table, which AS direly
Alan,
Thanks - that gives me a different approach to try out that sounds
very promising.
Julian
On Jul 7, 2006, at 8:59 PDT, Alan MacDougall wrote:
Julian Bleecker wrote:
That's great Ian — thanks for the help! Each of those little
idioms makes sense when described — I never would've f
(To be clear - Object isn't quite the equivalent of HashMap, as you
can't natively specify hash codes etc. etc. But for many purposes, it
serves the same uses.)
Ian
On 7/7/06, Ian Thomas <[EMAIL PROTECTED]> wrote:
Firstly, Actionscript does have the equivalent of a HashMap.
Everything derived
On 7/7/06, Julian Bleecker <[EMAIL PROTECTED]> wrote:
One other thing occurred to me on this topic, that might actually
save the trouble of using a hash table, which AS direly needs.
Is there a way to summon forth a class that's been instantiated in
any of the ways described below, by name?
In
One other thing occurred to me on this topic, that might actually
save the trouble of using a hash table, which AS direly needs.
Is there a way to summon forth a class that's been instantiated in
any of the ways described below, by name?
In other words, if I've done this:
for(var i:Number
Julian Bleecker wrote:
That's great Ian — thanks for the help! Each of those little idioms
makes sense when described — I never would've figured these out just
whacking at various permutations, particularly the very baroque
incantation leveraging the invisible symbol names.
You may find i
That's great Ian — thanks for the help! Each of those little idioms
makes sense when described — I never would've figured these out just
whacking at various permutations, particularly the very baroque
incantation leveraging the invisible symbol names.
I guess I should be looking forward to
Hi Julian,
Now I've had my first cup of coffee I'll try to explain it more clearly. :-)
In most cases AS2 works very similarly to Java in terms of
inheritance, instantiation and casting and the like - the only main
gotcha is that the class casting operator is MyClass(x) rather than
(MyClass)x -
Ah, slowly getting it..I've dug in so deeply with Java idioms that
it's almost like being Charleton Heston in Planet of the Apes..
.julian.
Julian Bleecker, Ph.D.
http://research.techkwondo.com
[EMAIL PROTECTED]
On Jul 6, 2006, at 23:28 PDT, Ian Thomas wrote:
Hi Julian,
They do return re
Hi Julian,
They do return references.
You just have to cast them to the correct type.
e.g. var clip:MyClip=MyClip(attachMovie("SymbolName",instanceName,depth));
HTH,
Ian
On 7/7/06, Julian Bleecker <[EMAIL PROTECTED]> wrote:
Yeah, I think it gets worse. I'm used to a pattern where you crea
Yeah, I think it gets worse. I'm used to a pattern where you create a
whole bunch of something — so, back to the problem I originally
asked, if I want have my "mainClip" create a dozen subClip instances
and tuck each one of those instances in an Array for later use,
especially calling that
*sigh* Having a bad morning and copying the wrong line. Third time lucky:
Object.registerClass("FooA", FooA_Class);
var aObject:FooA_Class = FooA_Class(_root.attachMovie("FooA", "FooA", 1));
Ian
On 7/7/06, Ian Thomas <[EMAIL PROTECTED]> wrote:
Whoops, sorry, missed your extra 'm' on 'mFooA' (
Whoops, sorry, missed your extra 'm' on 'mFooA' (not sure why that
crept in there?):
Object.registerClass("FooA", FooA);
var aObject:FooA_Class = _root.attachMovie("FooA", "FooA", 1);
Ian
On 7/7/06, Ian Thomas <[EMAIL PROTECTED]> wrote:
Hi Julian,
You were nearly there with:
Object.registerCl
Hi Julian,
You were nearly there with:
Object.registerClass("mFooA", FooA);
var aObject:FooA_Class = _root.attachMovie("FooA", "FooA", 1);
Just change it to:
Object.registerClass("mFooA", FooA);
var aObject:FooA_Class = FooA_Class(_root.attachMovie("FooA", "FooA", 1));
(as Class(x) is the equiv
Perhaps, but you never know: someone on this list may have a better
solution for your problem.
Mike
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoder
Cripes.
Thanks Mike! So, this magic of turning a named instance into the name
of the instance variable gets carried to its logical, but somewhat
weird, conclusion.
Julian
On Jul 6, 2006, at 19:30 PDT, Mike Britton wrote:
Hey Julian,
I feel your pain. Take a look at this example:
http:/
Hey Julian,
I feel your pain. Take a look at this example:
http://www.randomusa.com/flash/downloads/tojulian.zip
Mike Britton
___
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com
Okay, here's the drill.
I have a MovieClip — call it FooA — that's been linked to an AS2
class — call it FooA_Class — (that extends MovieClip and does lots of
other useful things.)
In that MovieClip, I have another MovieClip — SubFooA — that's been
exported and given a proper instance nam
19 matches
Mail list logo