This content has been marked as final. Show 4 replies
i'm not sure what you're trying to do but the basic issue with as3 is you can't assign custom properties/values to display objects that can then be later retrieved (like in your listener function).
however, you can assign custom properties/values to the object class in as3 and you can assign an object to displayobjects. so, create an object property of you displayobject and assign it whatever properties/values you need to retrieve in your listener function.
thanks kglad but im still a bit stuck. The below may be a better explantion:
var captionClip: MovieClip;
var captionBG: MovieClip;
captionClip = new MovieClip;
captionBG = new MovieClip;
captionBG = new one();
so ideally something like:
so i can just tell the function which clip to add into captionBG. Or am i completly barking up the wrong tree and going about things shockingly badly? :)
thx in advance
So i have two button clips on my stage who listen for a mouseup(or whatever), once one is picked i would like to be able to tell captionBG to pull out either "one" or "two" movie clip, linked in the library
you're going about it wrong. you can't change the fact that with as3 you CANNOT pass anything to the listener function other than a reference to the event. but the event (MouseEvent in your situation) carries a reference back to your event dispatching objects (butone, buttwo etc). so, if you could create a reference to "one" in your dispatching object butone and a reference to "two" in buttwo, you could use that reference to extract what you need.
now, you could just use the name property of the dispatching object. and that may be all you need:
many thanks Kglad i was getitng there but your code helped finsih it off. almost:| my next struggle is how to tie that to the actual linked file in the library.
eg something like:
captionBG = new trace(me.currentTarget.name);
but obviosuly the above ownt work. im stuk wihtout eval:( ;)