Adding properties to an Object
Hi,
I would wish to create a class extending Object class to create it's own properties in a FOR loop to save some space. However, it seems impossible...
The following won't work:
package com.sid1120.learning01
{
import flash.utils.getDefinitionByName;
public class CharacterAnimation extends Object
{
public function CharacterAnimation() {
this["pingy"] = "Hello";
trace(this["pingy"]);
}
}
}
On the other hand, this would work:
public function CharacterAnimation() {
var object:Object = new Object();
object["pingy"] = "Hello";
trace(object["pingy"]);
}
Is there a way around it so an object can create it's own properties using functions?
Thanks,