Can anyone tell me if there is a simple way to go back one step - sort of a back button? The problem is the movie is not sequential so back could be anything - I need it to basically "load previous movie"- or "reload previous .swf" ... something like that. New to ac and using Flash 5 - Thanks!!
I just tried it and big surprise - did something wrong. I just used any old button - it's on the top left of page1.swf - added two other pages to test it: grballs.swf and name.swf.
s'not working. Can you please have a look and tell me how I screwed it up? I think I need some sort of unload of the current movie - like unload.this ???
My movie uses layers 0,1,2,3,5,7,10 and they go back and forth between each other - some layering on top of others. Like 0 is always there - and usually 1,2 or 3 is present too, and then 5,7 & 10 change a lot.
OK - I changed it to loading into the empty mc instance name "mtclip" and now it reloads the one that you are in at present - not the one before - file attached. So I am close but not there yet!
Is there a benefit or a specific reason why I would load the different external movies into empty mclips rather than levels? I see all these tutorials on using levels. In your opinion which is better form? Am I giving up something unknown to me in order to have this back button???
Also - if I can ask another question - should I have a preloader for each new .swf?? Do I put it on scene 1 of each one. Most are pretty small so it won't show up but some are a bit bigger and I am worried about that.
I've been playing with this code for hours now, and I can't get it to work for more than two movies. I'll keep at it, cause there has to be a way, but this isn't going to work. One of the problems is, in F5 you can't use an array.
Do you really need a previous button? Just using the regular buttons will reload any previously loaded movie almost instantly, since it's in cache. I don't recall ever seeing one on a flash site.
Using levels is OK, but I have always preferred using an empty clip. It's just easier to target with code, and it never moves, you don't have to set any position on it.
You can have a preloader in any movie, whether it's the main movie or an external. It depends on your audience whether to use one or not for smaller movies. A 50K movie will take at least 10 seconds to load on 56K, but no time at all on cable or DSL. So if you know the audience is hi-speed, you can probably get by without one for anything less than 100K or so. Still, it doesn't take much to put one in any movie.
Like anyone else I don't "NEED" the back button but I read somewhere that it is the one thing that makes a flash site uncomfortable for viewers - that if they hit their browser's back button the whole thing goes away. So I thought if I am going to do this in flash I should have one, but if it's not the norm then I'll forget about it.
Can you answer this one little q for me - I have gotten myself confused re: mclips since I have been working in levels for so long. If I want an empty mc to load an external .swf automatically(not on a button)where do I put the code since I am not putting it on a button - on the mc? - in a frame on the root?, in a frame inside the mc??? And does the code go like this...
_root.mtclip.loadMovie("grballs.swf");
without any OnClipevent thing...
Kind of confused about that. Thanks!
You would put the code for the mtclip on a frame, or on a button, but it would be exactly the same for loading to a level.
To load to a clip, it has to have an instance name. The movie you load into it will always position it's top left corner on the dot of the empty clip, so it's easy to position;
_root.mtClip.loadMovie("moviename.swf");
To load to a level, you don't need the clip as a target, but, you either need to make the 'to be loaded' movie the same stage size as the main movie, or you need code to position it at a particular spot on the main stage, inside the loaded movie on frame 1;
The biggest reason I don't like using levels is, a movie loaded to a level will always be above any content in a layer. Loading to an empty clip placed on a layer, you can drag that layer up or down to position it in front of or behind anything else on other layers. You just can't do that with something loaded to a level. It will always be above anything in the main movie.
You have a really good point about the levels - So why are some people selling that as the perfect way? Excet that when you load the next one on that level it automatically unloads - so that would mean that I should have several empty clips - so one can layer over the other and if I want it unloaded I have to load a new movie into it - correct? I guess I'm going to spend the rest of today changing all my levels to mt movie clips and learning how not to screw that up.
I wanted to show you the site that I saw the back button:
No, no. You only need one empty clip. Just like levels or anything else for that matter, an empty clip can only hold one object at a time. So load in the first one when the main movie loads, then on buttons, you can load all the others into the same empty clip and the new will replace the old. If you want to blank that area, then use;
_root.mtclip.unloadMovie();
Or simply;
_root.mtclip.loadMovie("");
Although that's not the best way, it works.
Yup, that's an MX made movie. If you look at the source, you can see this line;