[Flashcoders] from AS2 to AS3

2011-01-13 Thread natalia Vikhtinskaya
I need to convert game from AS2 to AS3. This game has movie clip “_items” on the stage with frames. Each frame has different mc. frame 1- has mc “item1” frame 2- has mc |”item2” … _items.gotoAndStop(2) trace(_items.item2) // for AS2 it gives mc In AS3 it gives none (it works correctly only

Re: [Flashcoders] from AS2 to AS3

2011-01-13 Thread Deepanjan Das
You may try using getChildByName(instance name); also. var mc:MovieClip=_items.getChildByName(item2); -- Warm Regards Deepanjan Das W: http://deepanjandas.wordpress.com || Om Manasamarthadata Shri Aniruddhaya Namah || *Think of the environment before printing this email * On Thu, Jan 13,

Re: [Flashcoders] from AS2 to AS3

2011-01-13 Thread Deepanjan Das
Hi, Is the item2 placed on first frame in item1? Warm Regards Deepanjan Das W: http://deepanjandas.wordpress.com On Thu, Jan 13, 2011 at 9:15 PM, natalia Vikhtinskaya natavi.m...@gmail.com wrote: It is still null 2011/1/13 Deepanjan Das deepanjan@gmail.com: You may try using

Re: [Flashcoders] from AS2 to AS3

2011-01-13 Thread Deepanjan Das
I mean item2 placed in first frame of _item? DD On Thu, Jan 13, 2011 at 9:18 PM, Deepanjan Das deepanjan@gmail.comwrote: Hi, Is the item2 placed on first frame in item1? Warm Regards Deepanjan Das W: http://deepanjandas.wordpress.com On Thu, Jan 13, 2011 at 9:15 PM, natalia

Re: [Flashcoders] from AS2 to AS3

2011-01-13 Thread Deepanjan Das
Thats why you are getting a null value as the time when the script is executing, the frame 2 of _item is not available. For this you need to execute the script once you are sure the fame 2 of _item has loaded. Warm Regards Deepanjan Das On Thu, Jan 13, 2011 at 9:24 PM, natalia Vikhtinskaya

Re: [Flashcoders] from AS2 to AS3

2011-01-13 Thread Deepanjan Das
So you check for null before executing the script: addEventListener( Event.ENTER_FRAME, onEnterFrameHandler, false, 0, true ); var mc:MovieClip; function onEnterFrameHandler( event:Event ):void{ mc=_items.getChildByName(item2); if( mc ){ removeEventListener( Event.ENTER_FRAME,