dcsimg
A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: random movie clip

  1. #1
    Member
    Join Date
    Feb 2003
    Posts
    60

    random movie clip

    I'm using Flash MX

    I would like to know if there is a way I can randomly trigger a movie clip to play? I have created a simple movie clip which is then positioned a number of times in the same scene and on the same frame but I want each of these movie clips to be able to play individually from each other and randomly. Is this possible?

  2. #2
    Senior Member
    Join Date
    Aug 2001
    Location
    Egypt
    Posts
    332
    Do you want that each movieclip go to and play a random frame?

    Code:
    myMC.gotoAndPlay(Math.floor(Math.random() * myMC._totalframes));
    regards,
    Hamza.

  3. #3
    Member
    Join Date
    Feb 2003
    Posts
    60
    The movieclip is simply a small square that fades in and out over a couple of seconds. However, I would like to be able to position this a number of times on the screen so that they hide the background image and then have them play randomly so that bits of the background image are visible at different times.

  4. #4
    Junior Member
    Join Date
    Feb 2003
    Location
    S FL
    Posts
    25
    This should help Matt:
    http://www.flashingthenet.com/resources.htm

    Good luck with you project,
    Jeff

  5. #5
    Member
    Join Date
    Feb 2003
    Posts
    60
    I went to your site and it was really helpful! So, the example you give is for randomly animating one of the 'little lights'. Presumably I can place as many of these 'little light' movie clips into my scene as I like?

    Can I be really cheeky and ask another question? Is there a way that I could trigger all of the animations on the scene to fade out and stop on a mouse click?

  6. #6
    Member
    Join Date
    Feb 2003
    Posts
    60
    Don't worry, I've sorted it all out now. If you want to check out a test of the site I am creating go to <www.fernonline.net/flashtest>.

    Thanks for your help!

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