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,
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 wrot
I mean item2 placed in first frame of _item?
DD
On Thu, Jan 13, 2011 at 9:18 PM, Deepanjan Das wrote:
> 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
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 wrote:
> It is still null
>
> 2011/1/13 Deepanjan Das :
> > You may try using getChildByName("instance name"); also.
> >
> > var
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
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 _items.
6 matches
Mail list logo