this line:
_pValue = DisplayObject("_"+pValue);
has the problem.... you are casting from string to displayObject...
you can try something like:
createnavigatorButton(pValue:String){
...
_pValue.name = pValue;
...
}
function removeNavigatorButton( pValue:String ) {
...
_pValue = DisplayObject(this.getChildByName("_" + pValue));
this.removeChild(_pValue);
...
}
On Apr 24, 2008, at 8:30 AM, ACE Flash wrote:
Hi there,
I would like to define a variable, so I could pass any name to
createNavigatorButton and using removeNavigatorButton to remove it.
I wrote a simple code here http://www.privatepaste.com/e8tI4OgtHg,
but I
got an error msg => TypeError: Error #1034: Type Coercion failed:
cannot
convert "_Flash" to flash.display.DisplayObject.
Any suggestion?
Thanks you
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
_______________________________________________
Flashcoders mailing list
[email protected]
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders