-
Hello,
I have just recently started exploring the world of actionscripting, and was wondering about the best way to make a random quote generator for a flash movie. I was thinking about including something like that when I re-do my footer so it would be preferable to keep the quotes in an outside file so the size of the .swf isn't affected by the number of quotes.
All of this is just speculation as I haven't even seriously looked into it (so don't go on a researching frenzy to give me an awnser, I would feel bad then :D).
Thanks
-
Quote Gnerator
Ok, I won't do too much research. I'm sure a lot of these folks might have a more sophisticated way of addressing this, but explore this--at the end of your movie, have a script which does the following:
Set Variable "quote" = Random(10)
Tell Target ("/movie")
Go To and Stop (quote)
End Tell Target
The first line sets a variable equal to a random number between 1 and 10. You could then create a movie full of all the quotes you want, each quote with a different frame label (i.e. 1,2,3,4,5 and so on). Then, you could do something like the Tell Target action I mentioned.
I think this should work. If not, it's in the right direction.
-
-
Arg, got it done but it has two problems :).
1) Sometimes it cycles through all the quotes before eventually sticking on one.
2) My final quote (on frame 10) never seems to get hit. It is a quote by john lennon if you wanna try and hit it.
I have tried naming the quotes 1-10, naming them 0-9, adding and 11th frame, nothing works so far :(. I will try to skrew with it later but I am tired tonight :).
Thanks again!
[Edited by TiefighT on 08-04-2000 at 11:13 PM]
-
The random(x) function returns 0 to (x-1)... so if you wanted to choose from 10 frames, you'd have to use
random(10) + 1
The playthrough you're seeing is probably the occurance of trying to set the frame to 0, which isn't valid.
-
Yah, that seemed to be it. Thanks