A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: [F8] Random Picture on homescreen

  1. #1
    Junior Member
    Join Date
    Oct 2008
    Posts
    4

    Question [F8] Random Picture on homescreen

    Hello,
    I need some help on trying to make a random picture appear on my homepage.
    Well not that random, ideally i would like to choose around 5-10 pictures and each time someone comes to my web page, or goes back to the homepage from with in my site, one of the images i chose will randomly be chosen. I've looked around on some other sites to get some help, but couldn't figure it out.
    I am no flash genius, but sort of understand it.
    Essentially like this http://www.neverbeat.com/flash/
    But on this site, http://www.jeffhenrikson.com/new_index.html
    on the first page that pops up

  2. #2
    Ryan Thomson EvolveDesigns's Avatar
    Join Date
    Oct 2001
    Location
    British Columbia
    Posts
    3,338
    hi and welcome to FK

    the easiest way would be to make a new movieclip, give it an instance name of 'pics' on the properties bar, then add one pic per frame of the movieclip. Now go back to the main timeline and add this code:

    PHP Code:
    pics.gotoAndStop(random(10)+1
    where 10 is the number of images you have (change that to the actually number) The +1 is there because flash starts with 0 so this ensures 0 never comes up. Oh yeah, also put stop(); on the first frame of the pics mc.

    hope that makes sense!
    Evolve Designs Interactive Media
    the natural selection

  3. #3
    Junior Member
    Join Date
    Oct 2008
    Posts
    4

    Talking Thanks

    worked like a charm!

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