Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Load Movie Clip Within Flash

Status
Not open for further replies.

killbuzz

Technical User
Mar 21, 2001
103
US
Hey guys, I got a question about load movie clip with in the flash movie.

Okay, what I have is a flash movie. In the flash movie, I have a button. I want it to open a movie clip, when you click it. The movie clip is contacts for a website. I cant have the button go to a frame, I need it to open the movie clip. Then close the clip when they click the exit button.

How would I do this?

Thanks for the time..
 
well it depends on some circumstances,
do you want to make a new window containing the film (i guess no)
dou you want the film to be preloaded with your main movie or

do you want to load the film when needed (i guess that's what you want).

for the last point there are at least 2 solutions:
1st
put this script on the button:
Code:
on(release){
loadMovieNum("contact.swf",x)
}
x has to be replaced by a number, this is the level you load the movie in. that means that loading a film into level5 for example would be covering parts of a film loaded in level3. note that films loaded into some levels have no background.
it would be advisable to make the film contact.swf as big as the main movie (i mean concerning height and width) since it will be positioned at the top left corner (coordinates 0,0)

script for exit button:
Code:
on(release){
unloadMovieNum(x);
}
x again has to be replaced by the number of the level you want to unload.


2nd way:

create a movieclip with the same size as contact.swf in the main timeline of the film into which you want to load contact.swf and name the instance say "clipholder".
you can make the clipholder transparent by using 0%alpha filling and linecolor but do not use actionscript or alpha properties to make the clipholder invisible. this way you won't see the film that will be loaded into the clip either.

ok, then put this on the button:
Code:
on(release){
loadMovie("contact.swf",_root.clipholder);
}

to unload it put this on the button:
Code:
on(release){
unloadMovie("_root.clipholder");
}

this way the clip will be positioned in the top right corner of the clipholder so that you can determine the location of contact.swf by moving its clipholder.

i hope that was what you needed ;-)

regards

Firegambler
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top