Random Scenes

random scenes

Page 1 of 1

3 Replies - 5217 Views - Last Post: 06 June 2003 - 07:27 AM

#1 virusdoder  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 1
  • Joined: 23-April 03

Random Scenes

Posted 23 April 2003 - 03:14 AM

hy,

i want, when you came on my site, that you see always on other text. So i have make 3 scene and put them in a random.

but they don't work

he's still showing the first.
what do i wrong?

Attached File(s)

  • Attached File  1.fla (31K)
    Number of downloads: 35

Is This A Good Question/Topic? 0
  • +

Replies To: Random Scenes

#2 Dr. Tim  Icon User is offline

  • D.I.C Addict

Reputation: 0
  • View blog
  • Posts: 993
  • Joined: 20-March 02

Re: Random Scenes

Posted 24 May 2003 - 08:39 PM

To know knowledge, you cant do random scenes... I tried it, but the scene needs to be in quotes... I suggest, making them movie clips, or different points on the timeline.
Was This Post Helpful? 0
  • +
  • -

#3 MK_PRE__  Icon User is offline

  • D.I.C Regular

Reputation: 0
  • View blog
  • Posts: 477
  • Joined: 12-January 02

Re: Random Scenes

Posted 25 May 2003 - 06:10 PM

if im not mistaken, isnt random() deprecated or however you spell it, try this:

someVar=Math.round(Math.random()*2)+1;
if someVar=1 then {
goto scene a;
}
if someVar=2 then {
etc
}

and so on, you could use a struct instead of the 3 ifs but i forget the syntax in flash for it, so ya thats how it would work
Was This Post Helpful? 0
  • +
  • -

#4 pioSko  Icon User is offline

  • still.dreaming
  • member icon

Reputation: 23
  • View blog
  • Posts: 1,888
  • Joined: 06-June 03

Re: Random Scenes

Posted 06 June 2003 - 07:27 AM

I saw your code. It was fine apart from two things.
1) you had random within quotation marks "". Basically, Flash read it as a String, not as a script.
2) I don't know why but many times I have had problems with the "else if" statement. It just wouldn't work. I tend to create a new "if" statement. That way I know it will work for sure.

I checked your FLA without "else if" and it worked fine.

keuze = random(3);
if (keuze == 0) {
	gotoAndPlay("noorwegen", 1);
}
if (keuze == 1) {
	gotoAndPlay("finland", 1);
}
if (keuze == 2) {
	gotoAndPlay("denemarken", 1);
}

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1