A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: Quote ticker

  1. #1
    Moderator
    FK Junkie
    TiefighT's Avatar
    Join Date
    Aug 2000
    Posts
    683
    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

  2. #2
    Member
    Join Date
    Jun 2000
    Posts
    67

    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.

  3. #3
    Moderator
    FK Junkie
    TiefighT's Avatar
    Join Date
    Aug 2000
    Posts
    683
    I'll try it, thanks

  4. #4
    Moderator
    FK Junkie
    TiefighT's Avatar
    Join Date
    Aug 2000
    Posts
    683
    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]

  5. #5
    Senior Member
    Join Date
    May 2000
    Posts
    124
    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.

  6. #6
    Moderator
    FK Junkie
    TiefighT's Avatar
    Join Date
    Aug 2000
    Posts
    683
    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
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center