I l @ ve RuBoard |
So far, all the drawing we have done has been on the background of the stage. Everything will appear behind movie clips. All this drawing is also static; it can't be moved or altered , just drawn over. You don't have to draw onto the stage, however. You can draw into any movie clip. Just use the same drawing commands but with references to the movie clip. For instance: myMoveClip.lineStyle(0,0x000000,100); myMoveClip.moveTo(100,100); myMovieClip.lineTo(200,200); You can also use terms such as _root , _parent , and this to define where the line gets drawn. You need to set the lineStyle in that movie clip first. You can also place your code on a movie clip, or in a frame inside that movie clip. The this prefix or just using the commands by themselves then refers to that movie clip. Flash MX also lets you create blank movie clips to store your drawings. You can do this with the createEmptyMovieClip command. It takes two parameters: the name of the new movie clip and its level. Both should be unique. For instance, to create an empty movie clip and then draw a line in it, you can do something like this: this.createEmptyMovieClip("myMovieClip",1); myMoveClip.lineStyle(0,0x000000,100); myMoveClip.moveTo(100,100); myMovieClip.lineTo(200,200); You can now move that movie clip around by changing its _x and _y properties. You can rotate it, scale it, change its alpha, and do anything that you would normally do with a movie clip. The drawing inside it follows along as if it were created while you were authoring the movie in Flash.
|
I l @ ve RuBoard |