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 sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trying to load different SWFs into main SWF. 1

Status
Not open for further replies.

Kijori

Technical User
Jan 22, 2002
67
SG
Was wondering if this is possible.

I've embedded a SWF file in a HTML file. When this SWF file is loaded, clicking on one of the buttons will load another SWF file into the first SWF file's movie clip container.

With the second SWF file running and the first (still running in the background), the user can click a button in the second SWF file and this will load another SWF file into the second's movie clip container.

The problem is, I can't get the third SWF to load. My intention is to create a website fully in Flash. To create multiple SWF files instead of one BIG SWF file.

Summary:
HTML contains SWF1(splash page)
SWF1 runs and calls SWF2(menu)
SWF2 runs and calls SWF3(menu item)
SWF2 runs and calls SWF4(menu item) and ends SWF3(menu item)
etc...

By the way, I've got all the files in the same directory.
 
That is certainly possible. Perhaps there is an error in your code we could find if you post it.

Philip Keiter
Senior Flash Software Developer
Sphyrras
 
Ok... here's the script and SWFs respectively.

Home SWF -> 1 Splash MC (only 2 frames), 1 Main Display MC, 1 Enter Btn. Enter btn is in Splash MC. Splash MC and Main Display MC is in Scene 1. Code for Enter Btn:

Code:
on(release) {
	loadMovie("Menu.swf", _root.mainDisplay_mc);
	with(_root.splash_mc) {
		gotoAndStop(2);
	}
}

Menu SWF -> 1 Menu MC, 1 Sub Display MC, 1 About Btn, 1 Events Btn. About and Events btns are in Menu MC. Menu MC and Sub Display MC are in Scene 1. Script for About and Events btns respectively:

Code:
// About Btn
on(release) {
	loadMovie("About.swf", _root.subDisplay_mc);
}

Code:
// Events Btn
on(release) {
	loadMovie("Events.swf", _root.subDisplay_mc);
}

By the way, I've created the About and Events SWF too.

The idea is when user click on the Enter btn, the Menu SWF should appear (which it does). When the user click on either the About or Events btn, the respective SWF should appear (which doesn't happen).

You see, when I run the Menu.swf on its own, clicking on the About and Events btn, the About and Events swf did load. When I run the Home.swf and then call the Menu.swf to click on the About btn, the About.swf did not appear.

If there's a way to attach the files, let me know. It will be clearer. Anyway, thanks for the help.
 
So if I understand you correctly, the subDisplay_mc holder clip is within menu.swf, not in home.swf, right?
Thus, maybe try the following...
Code:
on(release) {
    loadMovie("About.swf", _root.mainDisplay_mc.subDisplay_mc);
}
 
Thanks dude! It works! Didn't know gotta make reference to the Main SWF. I'm still green in Flash.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top