PDA

View Full Version : gallery is not loading in main.swf help please



sundeep_02tv26
02-03-2007, 12:40 PM
Hi all,

I am doing for a project to creating a gallery with thumbnails and dynamically loading the images and thimbnails via xml. I got it to work the way I want and exported this file as "gallery.swf"


When I click the link to load gallery.swf from the main swf using:

loadMovie("gallery.swf",this);

it doesn't display the thumbnails, images or the dynamic text but it does display the Flash buttons and roll overs.

However, when I open gallery.swfit plays perfectly, thumbnails scroll left and right image .

here index.html is used to display main.swf which is in /flash/main.swf.
the gallery.swf is also in /flash/gallery.swf only
the thumbs and pic and XML also in /flash/

i am using flash mx 2004

I've been stuck on this for 2 days now , Does anyone know what the problem is?

Thank you.

BLiZZaRD
02-04-2007, 03:20 PM
The context for loadMovie(); is one of the easiest to use, but as such it is also one of the easiest to mess up.

You are using loadMovie(); to load gallery.swf into main.swf on a button click.

gallery.swf is loading an XML, some images and thumbnails.

the XML, the thumbnails, the images, gallery.swf and main.swf all need to be in the exact same directory.

Once in there everything should work out fine as long as loadMovie is set up correctly.

First you should have a spot inside main.swf for gallery.swf to load. An empty movieclip is perfect. To make an empty movieClip >> Make sure NOTHING on your stage is selected. choose "Insert" then choose "New Symbol" give the new symbol a name of "empty", then check the "Advanced" button. Then check the box next to "Linkage: [] Export For ActionScript"

Click "Okay" now you are in edit mode of the new movie clip. Click back to your main scene without doing ANYTHING to the new movie clip.

From your library drag the emptyMC to the stage where ever you want gallery.swf to load. Then give it an instance name of "empty"

Once all that is done, click on your button you are using to load gallery.swf and in the actions panel put this:



on(release){
_root.empty.loadMovie("gallery.swf");
}


That's it. Upload everything and test it out :D

davydude
02-29-2008, 10:14 AM
The context for loadMovie(); is one of the easiest to use, but as such it is also one of the easiest to mess up.

You are using loadMovie(); to load gallery.swf into main.swf on a button click.

gallery.swf is loading an XML, some images and thumbnails.

the XML, the thumbnails, the images, gallery.swf and main.swf all need to be in the exact same directory.

Once in there everything should work out fine as long as loadMovie is set up correctly.

First you should have a spot inside main.swf for gallery.swf to load. An empty movieclip is perfect. To make an empty movieClip >> Make sure NOTHING on your stage is selected. choose "Insert" then choose "New Symbol" give the new symbol a name of "empty", then check the "Advanced" button. Then check the box next to "Linkage: [] Export For ActionScript"

Click "Okay" now you are in edit mode of the new movie clip. Click back to your main scene without doing ANYTHING to the new movie clip.

From your library drag the emptyMC to the stage where ever you want gallery.swf to load. Then give it an instance name of "empty"

Once all that is done, click on your button you are using to load gallery.swf and in the actions panel put this:



on(release){
_root.empty.loadMovie("gallery.swf");
}


That's it. Upload everything and test it out :D


Hey.
Found this thread really useful and was wondering if you could help?

I have a similar problem, where I am basically trying to get a button, when on release or on click, to open another swf file in the same window.

I tried your method shown in this thread, and it opened the swf file in the same window but along with the original swf file. I just basically want this to happen in a blank one, but in the same window.
I've tried other solutions and this is the only one that has worked for me so far! :)

Medyman
02-29-2008, 02:07 PM
Well, the loadMovie method is used to import external media (.swf, images, etc..) into the current flash movie. It doesn't complete replace it.

If you want it(mov2) to totally replace the original movie (mov1), you would need to create a third .swf (mov3) which holds both.

The flow works like this:

mov3 loads mov1
you click a button in mov1 to load mov2
after mov2 is done loading, you remove mov1

all of this can be done with the MovieClipLoader class (http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002538.html).

More specifically loadClip() (http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002541.html) and unloadClip() (http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002549.html)

davydude
03-03-2008, 02:19 PM
Well, the loadMovie method is used to import external media (.swf, images, etc..) into the current flash movie. It doesn't complete replace it.

If you want it(mov2) to totally replace the original movie (mov1), you would need to create a third .swf (mov3) which holds both.

The flow works like this:

mov3 loads mov1
you click a button in mov1 to load mov2
after mov2 is done loading, you remove mov1

all of this can be done with the MovieClipLoader class (http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002538.html).

More specifically loadClip() (http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002541.html) and unloadClip() (http://livedocs.adobe.com/flash/8/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&file=00002549.html)

Thanks for that,
however that really baffled me :confused:

Basically, I have an introductory flash video with a button, which I want to then open a Menu on click or on release.
On the menu, I'll then have a number of other flash links etc...

Medyman
03-03-2008, 02:23 PM
Have a look at this, http://www.gotoandlearn.com/player.php?id=27

It's a tutorial on preloading external SWF files when bringing them into a container. I think it might be useful.