addChild() vs addChildAt() methods?
I have the following code:
var container_mc:Container = new Container();
for (var i:int=0;i<4;i++){
var myTrap_mc:MyTrap = new MyTrap();
var myTrapR_mc:MyTrapR = new MyTrapR();
container_mc.addChildAt(myTrap_mc,i);
container_mc.addChildAt(myTrapR_mc,i);
myTrap_mc.rotate=i*90;
myTrapR_mc.rotate=i*90;
container_mc.x=20;
container_mc.y=20;
trace(myTrap_mc.rotate);
trace(container_mc.x+" x");
}
MyTrap and MyTrapR are sheared rectangles in my Library with Export at Frame 1 selected. When I test the movie I don't see any objects on the stage.
If I simply declare addChild(myTrap_mc) within the loop it will add one child instead of 4 which is why I tried using a container and adding the children to the container. Still no beans.
How can I get these sheared rectangles to appear so that they form an 8-pointed star? This is simply an exercise in drawing shapes dynamically using ActionScript. (Of course I'm not using ActionScript graphics properties so it's not truly dynamic in that sense).
