Log in

View Full Version : Loading swf files into a specific section of flash site



VonPeters
05-31-2008, 01:39 AM
Hey guys and gals
I'm stumped......

OK so I have exhausted myself looking at all the various code that I could find online. Every bit I came across shows examples of loading into a mc frame.

No problem right. ... Well I have been trying to get this to work in a site that I'm building to no avail.

Here's the low down: the site I'm working on is built with buttons that move the playhead from section to section. Flash CS3 (AS2)

for example click photography and it takes you to the section with photography and so on. That works fine but.... and here's where I'm having problems I have in that photo section buttons that I want to use to load new swf files into the loader_mc so that the site doesn't have to load 4 or more sub sections for each section of the site unless called on to do so.

So I have the product_btn trying to load the gallery1.swf into the imgLoaderBox and it's not working. all my files are uploaded to the server each time and still no joy.


Can we start from fresh here what code should I use?
a Var instance
or on.....

or btn.onRelease =

and where should this script be put?

on the button itself on a new layer? in the mc or....?

(bear in mind I need to be able to do this for more than one button per section of the site and this is in CS3 with as2)






I can't get the galleries to load.

Medyman
05-31-2008, 10:09 PM
Can we start from fresh here what code should I use?
Sure...


a Var instance
or on.....

or btn.onRelease =
Well, you might need a variable to keep track of which gallery is loaded. For example, if you have four galleries each linked to each button (say this works properly). Every time someone clicks the third button, the third gallery would reload each time. This is a waste of resources.

You probably don't want anything to happen when the button is clicked because the corresponding gallery has already been loaded. In this instance, variables become handy.

You'll 100% need the mouse event as that is what initiates the actions based on which image you click.


and where should this script be put?

on the button itself on a new layer? in the mc or....?
ALWAYS create a separate locked layer in the main timeline. This layer should ONLY have ActionScript, no visuals on it at all. This way, you'll never have to wonder about where to put the actions. I know some people like putting actions on the actual movieclips. But I've found this to be the single greatest source of AS errors. Also, for organizational purposes putting all AS in one place is so much easier/cleaner.

Lawrence, have you taken a look at the gotoAndLearn() tutorial on this? If not, have a look here (http://www.gotoandlearn.com/player.php?id=27). That goes through how to do this exact thing. If that doesn't help or you still can't get it to help, post back here and I'll be happy to help you with it.

VonPeters
06-03-2008, 07:44 PM
Thanks I'll have another look at that post.
Keeping that advice in mind