First time here? First time here? Newsletter Signup Newsletter
651326 Members and growing! | Flash Jobs
Search tutorials
Author: k-giannis | Website: http://users.hol.gr/~kgiannis

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

Always have in mind that the top-left corner of the loaded movie clip will be placed in the registration point of the "host" movie clip.

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
(10 being the highest)
» Author
No details please.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!

Comments

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

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: S.Saipriya
» Title: Flash Fire Effect
» Description: This tutorial explains about how to create Fire Effect in Flash of Actionscript 2.0.I hope this tutorial helps you!
Featured Sound Loops
Image for equalize

Audio Player

» Author: Aidan Crouzet-Pascal
» Title: Falling Star
» Description: This loop is a cool sounding, E minor loop.
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: Brandan Paulin
» Description: Epic sounding loop with Brass, Percussion, Strings and Winds. This is actually part of a Loop Pack called the Coming where you can download the rest of the loops that go with it FREE from my website.