Flash Help
- Started
- Last post
- 25 Responses
- Kiko
Is it possible to have button1 on frame one, that when pressed playes frame 2 to 5 then goes to scene 2. And another button2 on frame one which when pressed playes frame 2 to 5 and goes to scene 3?
- skt0
Yes. Just set a flag based on what button you have pressed. Then on frame 5 check the status of that flag in an if statement.
if flag = 1 goto scene 2
else if flag = 2 goto scene 3.But in proper as. ken?
- cereals0
frame 1:
var sceneTo = 0;
Button 1:
on(press){
sceneTo = "Scene2";
gotoAndPlay(2);
}
Button 1:
on(press){
sceneTo = "Scene3";
gotoAndPlay(2);
}
Frame 5:
gotoAndPlay(sceneTo, 1);
- Kiko0
ok good to know its possible. But Im quite an amatuer in Flash. So I have no idea how to do this can you please elaborate?
- MX_OnD0
Avoid scenes like the plague.
But the functionality is of course possible....
one way of doing it would be to have a movieClip which has frames 2 to 5 in it and then INSTEAD of going to a different scene loads a movieClip (say clip2 or clip3 for example)
each button would set a variable which is then read by the commonPart_mc and in turn determines which Movie gets loaded...
does that make any sense whatsoever?
- Kiko0
yes it does make sense in theory to me but in practice Im afraid I really have no idea.
Do you have any links to some tutorial so I can see the flash please.
- Kiko0
Cereals,
Thanx so much for that code, Can you please explain where I should place it.
- MX_OnD0
Kiko, take it from me avoid scenes.
scenes and actionScript are like Michael Jackson and prepubescent boys, best kept well apart...
- Kiko0
haha, but he needs freinds, do you have a link to the method you suggest please?
- MX_OnD0
Kiko, I'll try to make a wee example file for you, not sure if time will allow or not today...
are you in a hurry for it?
seriously scenes will bring you nothing but knobache.
- Kiko0
oh man I really dont want to take your time. Yes its afor a site Im doing for Atari, dont know why they got me doing the build of the site. Im really having a tough one here.
- cereals0
I hate scenes too, but thought I would just hand over the goods...
if you place the var sceneTo on the first frame of your movie.
Then place 1st on(press) [the function] on your button that you want to go to scene 2
Then place 2nd on(press) [the function] on your button that you want to go to scene 3
Then final on the frame where all the animation stops, place the last bit of code
gotoAndPlay(sceneTo, 1);
This will tell flash to go to the scene that you setup via the buttons..
- i am guessing you are using the old style button events rather than button1.onPress=function blah...
- cereals0
i hate not having a preview button on here - spelt something wrong!
final = finally
- MX_OnD0
don't worry about it Kiko, I can probably reuse the file anyway.
I'm in macromedia tech support ;)
- Kiko0
Cereals, When I put in the gotoAndPlay(sceneTo, 1);
on the last frame of scene 1. I get an error when previewing th movie. And both button 1 and button 2 take me to the next scene in the list
- Kiko0
ahhhh, wel, if you have the time, it would be of great help man. Thankyou so much!!!
- MX_OnD0
MX or MX2004??
- Kiko0
MX2004
- MX_OnD0
cool gimme an hour or so..
- Kiko0
Thanx alot!
- MX_OnD0
Kiko, you on Mac or PC?