Container container exercise.
Create a new movie for each of theese blocks of code, name the movies three.swf, two.swf, & one.swf.
you can make them all 300 pixels by 300 pixels.
Make sure they are all saved in the same directory (or on desktop)
Do them in this order it makes it easier to keep track. (explaination below)
createEmptyMovieClip("square",0);
with(square){
beginFill("0x00ff00",100);
moveTo(10,10);
lineTo(90,10);
lineTo(90,90);
lineTo(10,90);
lineTo(10,10);
endFill();
}
createEmptyMovieClip("square",0);
with(square){
beginFill("0x0000ff",100);
moveTo(10,10);
lineTo(190,10);
lineTo(190,190);
lineTo(10,190);
lineTo(10,10);
endFill();
createEmptyMovieClip("container",1);
//container.loadMovie("three.swf");
}
createEmptyMovieClip("square",0);
with(square){
beginFill("0xff0000",100);
moveTo(10,10);
lineTo(290,10);
lineTo(290,290);
lineTo(10,290);
lineTo(10,10);
endFill();
createEmptyMovieClip("container",1);
container.loadMovie("two.swf");
}
square.onPress = function(){
_root.square.container.container.loadMovie("three.swf");
}
Now that you have one.fla hold
CTRL+SHIFT & press
ENTER (debugger short for thoose who don't know)
You wont see anything untill you pres the green play arrow in the debugger.
Once you press play on the debugger you should see a red square that will immediately load a smaller green square into it.
Now make sure you can see the tree view of movieclips in the debugger without any of them going off screen, make the area a little bigger than is needed as well.
Make note of what movieclips are in the view and thier path.
Click the red square, it makes the green square load a blue square.
It's all about how you target everything. I can't really explain it without sounding like a studdering fool
Study this line against the tree view of the debugger very close is as well as I can explain this.
_root.square.container.container.loadMovie("three.swf");
Strong with this one, the sudo is.