I can't reference an intance of a MC through a Sprite.


      thought since sprite display object container , can add instance of movieclip should able reference mc through sprite.  did wrong?

 

             var bh1:sprite = new sprite();
            beerchan = new beerchan();
            bh1.addchild(beerchan);
            trace("bh1 "+bh1);
            trace(bh1.beerchan);

 

1119: access of possibly undefined property beerchan through reference static type flash.display:sprite.

hi,

 

i go thru try using bh1.getchildat(0) or give name movieclip , access bh1.getchildbyname("movieclipname");



More discussions in ActionScript 3


adobe

Comments

Popular posts from this blog

Joomla site hacked, cant see front and - Joomla! Forum - community, help and support

Christian Home School Programs - Joomla! Forum - community, help and support

Trouble with PF_OutFlag_I_USE_AUDIO and PF_CHECKOUT_LAYER_AUDIO