flash help

Out of context: Reply #7

  • Started
  • Last post
  • 9 Responses
  • ok_not_ok0

    create the movieClip that u wanna bounce around..give it an instance name "box_mc"

    inside this movieClip drop this script in the first frame.
    //==

    theX = _x;

    theY = _y;

    smooth = 1;

    timer = 0;

    mTime = 60;

    function theDo() {

    theX = theX + (-20 + Math.random() * 40);

    theY = theY + (-20 + Math.random() * 40);

    theRot = theRot + (-40 + Math.random() * 80);

    smooth = 0.050000 + Math.random() * 0.200000;

    timer = 0;

    this.onEnterFrame =loop;

    } // End of the function

    function loop() {

    _x = _x + (theX - _x) * smooth

    _y = _y + (theY - _y) * smooth

    _rotation = _rotation + (theRot - _rotation) * smooth

    timer++;

    if (timer >= mTime) {

    delete("onEnterFrame");

    } // End if

    } // end function

    go back to the _root, then type this in the first frame:

    box_mc.onRollOver = function(){
    this.theDo();
    }
    }

    wont work in AS 2.0 player 7..wroks well in AS1 player 6

    goodluck!

View thread