actionscript 3 - Adding a child to a child -
in as3
, trying add together kid specific kid of movieclip
.
to have done following:
for (var r:number = 0; r < 2; r++) { sand = new sand(); slayers.getchildat(r).addchild(sand); }
when slayers
movieclip
parent, r
specific kid of slayers
, , sand
kid want add.
it comes next error:
1061: phone call perchance undefined method addchild through reference static type flash.display:displayobject.
sorry simplified code, take much space.
is there way this? or close missing something?
try
for(var r:number = 0; r < 2; r++) { var sand:sand = new sand; (slayers.getchildat(r) movieclip).addchild(sand); }
actionscript-3 addchild
No comments:
Post a Comment