A Flash Developer Resource Site

Results 1 to 11 of 11

Thread: Random MovieClips

  1. #1
    Junior Member
    Join Date
    Dec 2003
    Location
    Austria
    Posts
    29

    Random MovieClips

    How can I make such a code, which shows a random movieclip in my movie?
    www.thescreenstyle.com

  2. #2
    Senior Member Computer Dork's Avatar
    Join Date
    Mar 2001
    Location
    St. Louis
    Posts
    1,026
    do you have a bunch of clips to choose from or what?

  3. #3
    Junior Member
    Join Date
    Dec 2003
    Location
    Austria
    Posts
    29
    I have a movie called main.swf

    and in this move are 4 different images with animations (movieclips)

    now i would like, that if ya enter the main.swf a random movieclip loads ?
    www.thescreenstyle.com

  4. #4
    Junior Member
    Join Date
    Dec 2003
    Location
    Austria
    Posts
    29
    hello?
    www.thescreenstyle.com

  5. #5
    Senior Member Computer Dork's Avatar
    Join Date
    Mar 2001
    Location
    St. Louis
    Posts
    1,026
    code:

    //put this on first frame of main.swf

    myClips = new Array();
    myClips[0] = "movieClip1.swf";
    myClips[1] = "movieClip2.swf";
    myClips[2] = "movieClip3.swf";
    myClips[3] = "movieClip4.swf";

    //lets say you have an emptyMC called "empty" that you want to load them into
    //when the main.swf loads - put these actions on main.swf

    onClipEvent(load){
    _root.empty.loadMovie(myClips[random(3)]);
    }


  6. #6
    Junior Member
    Join Date
    Dec 2003
    Location
    Austria
    Posts
    29
    thx man - got it
    www.thescreenstyle.com

  7. #7
    Junior Member
    Join Date
    Dec 2003
    Location
    Austria
    Posts
    29
    but one thing - i would like to load MC's - they already exist in the main.swf ???!?!?!?!?!?!
    www.thescreenstyle.com

  8. #8
    Senior Member Computer Dork's Avatar
    Join Date
    Mar 2001
    Location
    St. Louis
    Posts
    1,026
    in that case use linkage - open your library and right click on the mc's in question, then give it a linkage name.

  9. #9
    Junior Member
    Join Date
    Dec 2003
    Location
    Austria
    Posts
    29
    hm.....can ya explain it more exactly
    www.thescreenstyle.com

  10. #10
    Member
    Join Date
    Feb 2004
    Location
    Sunderland . UK
    Posts
    38
    Originally posted by theScreen
    hm.....can ya explain it more exactly
    Goto library , then properties of the Movie clips you want to show.

    Make sure the Export For ActionScript box is ticked , then decide on a name.

  11. #11
    Junior Member
    Join Date
    Dec 2003
    Location
    Austria
    Posts
    29
    k thx - will try out later
    www.thescreenstyle.com

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