A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: tween by code???

  1. #1
    Can someone post an example of how to tween by code?

    I have a "button" mc with 3 states. Off, Over, and Big.

    The movie is 5 of theses mc's in a row. I want to cycle through each button from left to right and right to left a few times, EXACTLY like the "wave" when people do that in a stadium.

    After a randomly generated amount of passes, (say 20-25) it will finally stop on one of the button. Meanwhile, the whole thing has been slowing down, down, down, like watching that big wheel on "Prcie is Right" slow to a stop. Each button, of course, is a different prize.

    Can someone suggest a strategy and at the least show tweening by code example(s)?

    Thanks!

  2. #2
    Member
    Join Date
    Jun 2001
    Posts
    41
    Originally posted by dbonneville
    Can someone post an example of how to tween by code?

    I have a "button" mc with 3 states. Off, Over, and Big.

    The movie is 5 of theses mc's in a row. I want to cycle through each button from left to right and right to left a few times, EXACTLY like the "wave" when people do that in a stadium.

    After a randomly generated amount of passes, (say 20-25) it will finally stop on one of the button. Meanwhile, the whole thing has been slowing down, down, down, like watching that big wheel on "Prcie is Right" slow to a stop. Each button, of course, is a different prize.

    Can someone suggest a strategy and at the least show tweening by code example(s)?

    Thanks!
    you aren't really tweening. you want code that will tell the certain mc's to goto a certain state "off", "over" or "big". you can do this with two frames of code, but i do not think you are there just yet so i'll tell you an easy way.

    i don't know exactly what you are trying to do so i am going to create a mc with 2 frames named "active" and "deactive" (each with "stop ();"). Active represents when the button is standing up during the wave and deactive when it is sitting.

    place 5 of these mc on the _root (the main timeline) and name them button1, button2, button3...

    now make a new mc and name it "control". each frame will change the button that is "active". the first frame will read...

    _root.button1.gotoAndStop ("active");

    frame2...

    _root.button1.gotoAndStop ("deactive");
    _root.button2.gotoAndStop ("active");

    frame3...

    _root.button2.gotoAndStop ("deactive");
    _root.button3.gotoAndStop ("active");

    etc...


    play around. you can make a variable that counts the number of passes and stops after a certain number. Good Luck.

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