More information about the Underscore mailing list

[_] as3 - adding a mc from library using dynamic name

Richard Davey rich at corephp.co.uk
Wed Dec 9 14:17:11 GMT 2009

Hi juan,

Wednesday, December 9, 2009, 2:11:00 PM, you wrote:

> just trying to convert some as2 to as3.

> can you tell me how I can get this to work?:

>     var animation_to_attach_name:String = "mc_animation_" + 
> current_animation;
>     var animation:MovieClip = new animation_to_attach_name();
>    
>     animations.addChild(animation);

> How can I instantiate my mc with a dynamically created name?

http://www.photonstorm.com/archives/620/creating-movieclips-dynamically-at-run-time-using-the-linkage-class

Cheers,

Rich
-- 
PHP: http://www.corephp.co.uk - Zend Certified Engineer
AS3: http://www.photonstorm.com - Flash Game Development

"Never trust a computer you can't throw out of a window"