dcsimg
A Flash Developer Resource Site

Results 1 to 13 of 13

Thread: Random MC Frame? How?

  1. #1
    Member
    Join Date
    Jun 2003
    Posts
    31

    Random MC Frame? How?

    Okay I have a MC with 6 frames and I want it to go and keep going to a random frame within the 6.

    Thanks

  2. #2
    Senior Member Jaffasoft's Avatar
    Join Date
    Apr 2001
    Location
    On Travel
    Posts
    1,587
    dats easy.

    yourMC.gotoAndStop(random(7)+1);

  3. #3
    Member
    Join Date
    Jun 2003
    Posts
    31
    LOL

    That's what I had except for the + 1, I always screw up some mundane detail.

    Thanks

  4. #4
    Member
    Join Date
    Jun 2003
    Posts
    31

    Not working yet!

    Actually that is not working either!

    More help please, I am just getting started with actionscript so be gentle, lol.

    Thanks

  5. #5
    Databarnak atRax's Avatar
    Join Date
    Dec 2000
    Location
    Zurich, Switzerland
    Posts
    258
    or
    choice = Number(int(random(Insert the number of label here)))+1;
    gotoAndPlay("a" add choice);

    While "a" is a frame label
    I ask you all to concentrate really hard on the freedom of all being. Its hard not to be very angry it is impossible We have to focus this confusion frustration helplessness feeling into a creative outlet Anger can spawn such amazing creativity through Street art Free art to teach each other know each other a language our evolution Go ahead and break some dumb rules

  6. #6
    Member
    Join Date
    Jun 2003
    Posts
    31

    I appreciate the help...

    Can someone help me with the whole thing, it is asking for the on/onClip event handler.

    Again there are 6 frames and I want it to continuously go to a random frame, so I am guessing that I add the script to the frame where the MC Instance is loaded.

    Thanks for the help so far.

  7. #7
    Senior Member Jaffasoft's Avatar
    Join Date
    Apr 2001
    Location
    On Travel
    Posts
    1,587
    This is what i do.
    I put the code on the mc itself.
    The mc has 6 frames init and each frame a diferant letter each frame it goes to a dif letter.

    onClipEvent (enterFrame) {
    this.gotoAndStop(random(7)+1);
    }

  8. #8
    Member
    Join Date
    Jun 2003
    Posts
    31
    Thanks Jaffasoft,

    It was the change to this. instead of MC_name.

    It works now.

    Thanks

  9. #9
    Senior Member Jaffasoft's Avatar
    Join Date
    Apr 2001
    Location
    On Travel
    Posts
    1,587
    No worries. your names a bit premature i hope you life up to waht it means.

    You always use, 'this' when telling the mc the onClipEvent handler is on to do something within that mc. this is almost like saying to yourself ,"me.walk" ,and for a mc "this.play". Its saying it to itself this play me walk. You know what i mean.

  10. #10
    Member
    Join Date
    Jun 2003
    Posts
    31
    for actionscript definately premature, but for Flash animations not so premature.

    Here is my latest intro.

  11. #11
    Senior Member Jaffasoft's Avatar
    Join Date
    Apr 2001
    Location
    On Travel
    Posts
    1,587
    Very good. See i can give compliments as well. Imagination so often is not good at programing and programing for the imagination a hinderance. I had the same problem myself and struggled to get what i imagined and the programing to equal what i wanted to do. but i so often see the programers have no imagination.

    I guess that could mean an office.

    You site in one room and program.
    And i will sit in one room and imagine.

    I am stil a long way behind in programing that i claim to admit.

  12. #12
    Member
    Join Date
    Jun 2003
    Posts
    31
    I completely agree! And I hope to be good enough at this stuff in the near future to help guys like me that put off learning this for way too long!

    Thanks again.

  13. #13
    Databarnak atRax's Avatar
    Join Date
    Dec 2000
    Location
    Zurich, Switzerland
    Posts
    258
    I was wondereing about the way you made those Lighning Text thing?

    A filter in photoshop ? or handmade ?
    I ask you all to concentrate really hard on the freedom of all being. Its hard not to be very angry it is impossible We have to focus this confusion frustration helplessness feeling into a creative outlet Anger can spawn such amazing creativity through Street art Free art to teach each other know each other a language our evolution Go ahead and break some dumb rules

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