|
-
Moderator FK Junkie
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 ).
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.
-
Moderator FK Junkie
I'll try it, thanks
-
Moderator FK Junkie
-
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.
-
Moderator FK Junkie
Yah, that seemed to be it. Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|