Saturday, June 25, 2005

AS 2.0 type checking

If you want to append a property to an object (for example, an XML object) at runtime, you will have to declare that object as an Object instead of XML to turn off the type-checking the AS 2.0 compiler performs.

e.g.

var xmlDoc:XML = new XML();
xmlDoc.property = value; // won't work

var xmlDoc:Object = new XML();
xmlDoc.property = value; // ok

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home