Hello,
is it actually possible to add a new property
to an AS3-component, like button? I try:
import fl.controls.Button;
var button:Button = new Button();
button['old_item'] = 42;
//button.old_item = 42;
addChild(button);
but get the run-time error:
ReferenceError: Error #1056:
You can edit the components class.
But I always put my objects in arrays.
So you can do this:
var arrButtons:Array = [];
var button:Button = new Button();
arrButtons.push(button);
arrButtons[0].old_item = 42;
addChild(button);
HTH
Cor
___
is it actually possible to add a new property
to an AS3-component, like button?
In AS3, classes will only allow this if they're dynamic classes, and
most classes aren't dynamic. You could, however, write a new class to
extend Button.
Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
3 matches
Mail list logo