View Full Version : random scenes
virusdoder
April 23rd, 2003, 05:10 AM
i have made 3 scenes, and i will, when you come on my site, that you see every time on other scene, so i have this as in my first frame in the first scene:
keuze = "random(3)";
if (keuze=0) {
gotoAndPlay("noorwegen", 1);
} else if (keuze = 1) {
gotoAndPlay("finland", 1);
} else if (keuze = 2) {
gotoAndPlay("denemarken", 1);
}
it works a little: the third scene i don't see after trying 5/6 times
and an other problem:
when i came at the last frame of noorwegen i have put this:
gotoAndPlay("noorwegen", 1);
but he goes to finland and there a have the same script:
gotoAndPlay(1);
and that's working
can somebody helps me?
pom
April 23rd, 2003, 05:18 AM
Careful with your syntax:
keuze = random(3);
if (keuze == 0) {
gotoAndPlay("noorwegen", 1);
} else if (keuze == 1) {
gotoAndPlay("finland", 1);
} else if (keuze == 2) {
gotoAndPlay("denemarken", 1);
}
SteveD
April 23rd, 2003, 05:22 AM
Hi virusdoder,
If I have understood correctly, your random code is in frame1, scene1, is that right ?
If so when you send the play head back to ("noorwegen",1), it is reading your random code first and keuze!=0.
Try adding a fourth scene with one frame at the very beginning of your movie, place your random code in that frame, then, if you want the user to go back to the first frame of the scene he has just watched, your code as above will work, alternatively, you can change your end scene code to:
gotoAndPlay( "randomCodeScene"1)
Hope that makes sense
SteveD
btw - does keuze mean count ?
virusdoder
April 23rd, 2003, 05:27 AM
yes i tried this: a have change the = in ==,
but now it's playing always the first scene
SteveD
April 23rd, 2003, 05:39 AM
Hi,
have you got an fla you can post ?
SteveD
virusdoder
April 23rd, 2003, 05:46 AM
hopelijk werkt het, anders mag ik het je dan naar uwe mail sturen?
pom
April 23rd, 2003, 05:50 AM
Je parle assez mal hollandais, malheureusement...
virusdoder
April 23rd, 2003, 05:54 AM
haha, ilyaslamasse, sry for my bad english, but i do my best. But hollandais is not french. this is hollandais: een goede middag, u heeft een prettige da voor de boeg.
I hope you understand it
pom
April 23rd, 2003, 05:59 AM
As I said, I need to brush up my netherlandish (???) :P :P
SteveD
April 23rd, 2003, 06:02 AM
Hi,
As ilya pointed, you need to take a look at your syntax - this I copied direct from frame 1 of your movie :
keuze = "random(3)";
it should be keuze = random(3);
if you change that line of code, your movie will open in a different scene evrytime you run it, however, your code:
gotoAndPlay(1);
will send the playhead back to fr1 of the scene that you have just watched - except scene noorwegen.
Do as I said in the previous post and either leave your gotoAndPlay code as is, or if you want the user to see a different scene after each scene, use the code I posted above.
SteveD
virusdoder
April 23rd, 2003, 06:11 AM
i have do this: at the last frame and the first frame of scene when i have change frame 1 to frame 2
it work's perfect, thank you
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.