Thank you Muzak. I remember reading it, I will read the whole thing again so it sticks. Is there any reason why we shouldn't do this to every class that we associate an AS2.0 class with? That is, is there any downside if I just associate all my mc with the AS2.0 class in the Component Definition instead of the Linkage property? It seems like Component definition has the added niceties that allows you to set the parameters in the IDE. - boon
Muzak <[EMAIL PROTECTED]> wrote:When setting the AS2.0 class in the Component Definition window, you'll be able to add [Inspectable] MetaData to the class, which will then show up in the Properties Panel (parameters). Parameters defined in the properties panel will be set *before* the constructor of the class is exectuted, avoiding the 1 frame delay that otherwise occurs. Check out the docs for more info on Metadata: Using Components > Creating Components > Creating the AS class file > Adding component metadata regards, Muzak ----- Original Message ----- From: "Boon Chew" To: "Flashcoders mailing list" Sent: Friday, November 18, 2005 12:41 AM Subject: Re: [Flashcoders] How to pass init param from movieclip to itsassociating AS2 class > Thanks David for the tip. > > I would like the artist to set certain values, so ideally, a method that > doesn't require them to mess with the script window is > the best. > > Would it be ok if I add parameters to the Component Definition? Behind the > scene what is the difference between a movieclip vs > a movieclip with component definition set? It seems like both behave like a > regular mc anyways...except that one you can > compile into SWC. > > Another question I have is that component can also be associated with AS 2 > as well, what's the effects of setting AS2 there > alongside with AS2 in linkage property? > > David Rorex wrote: In your class, define the variable you want to pass in, > like: > > class Test extends MovieClip > { > var passedIn; > > //... > } > > Then, on the stage, select your movieclip instance, and bring up the > actionscript window (press F9), and enter the code: > > onClipEvent(load) > { > passedIn = 123; > } > > NOTE: Passed in variables will not be availabe until 1 frame after the > component loads (I think), so either don't use them in the > constructor, or put a 1 frame delay. > > -David R > > On 11/17/05, Boon Chew wrote: >> Hi all, >> >> I have created a movieclip and associated it to an AS2 class in the >> linkage property. I have different instances of this >> movieclip on stage and I would like to pass different init params to the >> AS2 class. Is there a way to do it in the IDE? Must I >> turn the movieclip to a component in order to pass init params? >> >> Thanks! _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders --------------------------------- Yahoo! FareChase - Search multiple travel sites in one click. _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders