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: doc_chin7
» Description:

The flash's horizontal road drive was done in CS4 and was upgraded to CS6. The car responds to right/ left key and flash will auto-generate the movement of roads from left-right or right-left based on random number. Have fun driving in this virtual environment and avoid other cars... :) If you are creative, a road driving game can be created from it.

Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
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: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.