The "var" keyword can only be used when declaring a variable in the code's own scope. Meaning that if you use a path don't use the "var" keyword.
So this will work: var foo:MovieClip = createEmptyMovieClip("foo",1) foo.myVar:String = "fooVar" /Johan -----Ursprungligt meddelande----- Från: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] För Jason Ross Skickat: den 11 oktober 2006 11:30 Till: Flashcoders mailing list Ämne: [Flashcoders] AS 2.0 variable declaration Hi, In migrating some AS 1.0 code to AS 2.0, I have run into a small problem. How do I write the following in AS 2.0: this.createEmptyMovieClip("foo",1) this.myVar = "foovar" As this returns errors: var foo:MovieClip = createEmptyMovieClip("foo",1) var foo.myVar:String = "fooVar" Much appreciated, Jason. Legal Disclaimer: This email message (including any attachments) is strictly confidential and is intended only for the person(s) or organisation(s) named above. The unauthorised use, disclosure, distribution and/or copying of the email message, or any information it contains (including any attachments), is strictly prohibited and could in certain circumstances constitute a legal offence. If you are not an intended recipient, please contact the sender immediately by return email and delete the email from your system. Internet email communications are not always secure and may be susceptible to data corruption, interception and unauthorised amendment, and therefore "View" does not accept legal responsibility for the contents of this message for any such corruption, interception or amendment or the consequences thereof nor any delay in its receipt. Although this email message and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free. No responsibility is accepted by "View" for any loss or damage in any way arising from its use. Any views expressed by the sender of this message are not necessarily those of "View". _____________________________________________________________________ This message from View has been checked for all known viruses by the MessageLabs Virus Control Centre. _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com