Loading external swfs in the right position
Introduction
This is a simple tutorial answering a simple question: How
can I place a loaded movie in the position I want?
It's about the loadMovie action. The loadMovie loads external swfs in movie
clips of our movie.
So, how we create the host movie clip and what we have to keep in mind?
Answer
The registration point in a movie clip is this little cross inside each
movie clip that defines the position of our elements.
Why is this happening? Flash places the registration point of the external movie
(which is always the top-left corner) in the position of the registration point
of the host clip.
We can have an ordinary clip or a blank one as our host (the target for our
loadMovie action), it makes no difference. We just place the host clip in the
position we want, having in mind the above rule.
Below we see our stage with a blank clip on the left and a filled one on the
right. See how a blank clip is presented in the stage? The little circle exists
to show us where the clip is placed and is also the registration point of our
clip. Also notice the registration point of our filled clip. It's the cross
in the top-left corner of the orange rectangle.
I have named the blank's instance blankhost and the filled's host. The two buttons contain the script to load an external swf (mov.swf) in each host clip:
on (release) {
loadMovie ("mov.swf", "blankhost");
}
and
on (release) {
loadMovie ("mov.swf", "host");
}
And now the real thing:
Also keep in mind that the loaded movies, apart from taking the hosts' place,
are taking their names also.
So when we want to call them we use the instance names of our original host
clips. In this movie: host and blankhost.
The black buttons unload the clips using their instance names.
I hope this is a useful tutorial.
Happy Flashing!
| » Level Basic |
|
Added: 2001-12-23 Rating: 6.84 Votes: 74 |
| » Author |
| No details please. |
| » Download |
| Download the files used in this tutorial. |
| Download (16 kb) |
| » Forums |
| More help? Search our boards for quick answers! |
-
You must have javascript enabled in order to post comments.


Comments
There are no comments yet. Be the first to comment!