Flash Question
- Started
- Last post
- 14 Responses
- jevad
I have a very simple flash movie with 5 buttons on it. When you click the five buttons it loads a sepearate .swf movie - onto the same level.
What's the right code to check if there is a movie already loaded, and if there is, to unload that movie and load the movie that corresponds to the button you just clicked?
Thanks!
- blaw0
doesn'tmatter, right? if you load a movie into a level it unloads anything currently in that level.
- jevad0
well shit that is what I thought right...but linerarly..if I click button one, it loads the first movie, button two loads the second...etc...but if I go from button 3 to button one - it stays on teh 3rd movie...and then if I click from button one to button 4 - it flashes me the first movie before loading the 4th...
Frustrating - I know I am doing something silly n00b-like...I'll upload it in a bit when I get upstairs
- tkmeister0
can't u just load it into a mc instead?
- blaw0
it oughta be something like this, nic:
this. button01. onRelease = function ( ) {
loadMovieNum( " xxx.swf ", 10) :
}^ if that's blank it's because i still can't figure out how to post code on NT. if it's there, delete any extra spaces.
- jevad0
thanks squire - I'll give that a shot
- joyride0
can't u just load it into a mc instead?
tkmeister
(May 21 06, 19:09)you should do this ^ and just to loadMovie("xxx.swf", "theMovieClipName")
I don't like messing with replacing the main movie on the stage, just push it into an mc. let me know if you still have issues
- jevad0
Thanks guys for the help..I reverted to loading into an MC...which I should have done to start with I guess...now it plays the first image of each movie - then reverts to the first movie images...weird...maybe somethign to do with the xml? All the .swf's do is load a list of jpgs from an xml document...
- joyride0
So each button is loading the first image?
How does each button know what to load? are you pushing that into the button?
- jevad0
http://www.nictinworth.com/clien…
Nah sorry - each button is going to a frame number and a loadmovie action...Here's how it is setup:
- joyride0
put some traces in the first frame of the project1.swf - project5.swf
Did you write the code for those project1.swfs?
- jevad0
I'm not that hot with traces...how do I implement?
And no I didn't write the code for the swfs pulling in the xml images - I think I got the code from Todd DOminey's site....
- joyride0
traces are just a way to see whats going on... you'll use them all the time when debugging.
You can put them in a function like:
trace("This is running");But in the first frame of each projectX.swf put
trace("project1.swf");
obviously put project2-5 for the rest.just want to see when each movie is loaded and if it loads another movie. when it goes back to different images
- jevad0
this must have somethign to do with the xml...I might just nix it and start again
- joyride0
lol... yeah I've done that before.
Just try loading a file named movie1.swf, movie2.swf etc.
I bet it will act normal. Its got to be something in the project1.swf files
