-
importing a .swf in a predefined area
Hi there,
I just finished about 24 .swf and I would like to import them in defined area on my site. I would like them to appear at like x=200 and y=300. does anybody knows how I can do that?
thanks
-
Senior Member
There are two ways of loading external files into Flash. Either you can load swf files into _levels or into movieclip targets.
_levels only exist in the Flash player. They are like layers but for swf files The Flash player is like a overhead projector where the plastic films you put on top of each other are like the swf files in the player. There are 16000 available levels
//To load a external swf into a _level from a button. The number 1 being the level to load into.
on(release){
loadMovieNum("myExternalFile.swf",1);
}
Movieclip targets are what it sounds like. A empty movieclip placed on the stage just for the purpose of loading a swf file into it. The advantage is that you can place it anywhere, manually ( as opposed to swf's in _levels) and also can control what of the objects should be on top or beneath.
Usually you give the movieclip an instance name of container. ( you give a instance name by selecting the empty movieclip on stage and write the name in the Property Panel )
//To load a external swf into a target movieclip from a button ( both being on the main timeline ).
on(release){
container.loadMovie("myExternalFile.swf");
}
Last edited by pellepiano; 07-19-2004 at 01:03 PM.
-
Pelle... Again that "will load at the center of the empty movieclip" bit?
Clay2n...
http://www.kirupa.com/developer/mx/loading.htm
Your scripts in the loaded movie must use relative paths when they're loaded in container clips.
No script changes usually needed if loading on other levels...
http://www.kirupa.com/developer/flash5/loadmovie.htm
You can pre-position an external movie loaded on another level of a main movie, by adding the following on the first frame, of the external movie itself...
this._x = 200;
this._y = 300;
-
Thanks for your help oldnewbie. It works great
-
I have another problem now oldnewbie.
If I switch to another menu on the website the imported .swf stays on top......
-
Did you load it in a container clip or on another level?
-
-
Well first it's not "imported" but loaded... And loading a new external .swf in the same container clip, should clear the previous one out! Are you loading the new movie in the same container?
-
no its in a different container. Actually, my website is divided into 5 major parts. In one of them I have 24 buttons that load the external .swf. But if I switch to another major part of the site, the swf that I previously loaded stays on top!
-
Just make it invisible when going to another part...
_level0.my_containerMC._visible = false;
And you can make it visible again if you return...
_level0.my_containerMC._visible = true;
-
If I turn them invisible, the buttons are still activated. Can't I just unload the MC "select" when I go to the other sections?
I'll put the site online so you can see better what I mean.
http://mico.ath.cx/users/clayton/eldp/eldp2.html
this is what I load in the beginning
_root.createEmptyMovieClip("select",4);
and here is what's on each button:
on (release){
loadMovie("clip/djacobs.swf",_root.select);
_root.select._x = 400;
_root.select._y = 18;
}
again, thanks for your help...
-
I tried everything and i'm not sure I can unload the container.....
-
can't anybody help me with this?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|