A Flash Developer Resource Site

Results 1 to 7 of 7

Thread: Random Link in Flash

  1. #1

    Random Link in Flash

    How do you create a random link button in Flash? I guess I would need an actionscript code or something of that nature. I already know how to set up a random link in HTML. Thanks

  2. #2
    FK's Wave Pimp kamyab's Avatar
    Join Date
    Jan 2002
    Location
    Orange County, CA
    Posts
    1,210
    You could do something like this on a button symbol.
    code:

    on (release) {
    link0 = "http://flashkit.com";
    link1 = "http://yahoo.com";
    link2 = "http://google.com";
    link3 = "http://thekamyab.com";
    getURL(eval("link"+random(4)), "_blank");
    }


  3. #3
    Flashkit Veteran joejoe2288's Avatar
    Join Date
    Apr 2004
    Location
    Hickville, Oregon
    Posts
    2,554
    do you really need the eval?
    So tired of all the fighting....

    http://joejoe2288.kawanda.net

  4. #4
    FK's Wave Pimp kamyab's Avatar
    Join Date
    Jan 2002
    Location
    Orange County, CA
    Posts
    1,210
    Yes I do

  5. #5
    yes, but how do you adjust it so that it opens in the same window?

  6. #6
    FK's Wave Pimp kamyab's Avatar
    Join Date
    Jan 2002
    Location
    Orange County, CA
    Posts
    1,210
    The last line.. the getURL function. Change _blank to _self.

  7. #7
    nevermind, i just got it:

    on (release) {
    link0 = "http://flashkit.com";
    link1 = "http://yahoo.com";
    link2 = "http://google.com";
    link3 = "http://thekamyab.com";
    getURL(eval("link"+random(4)), "_self");
    }

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