A Flash Developer Resource Site

Results 1 to 20 of 24

Thread: using AS to rotate a mc?

Hybrid View

  1. #1
    wow thanks a toooooooooooooooon guys!! finally got it working alright!

    nota

  2. #2
    Senior Member Sir Yendor's Avatar
    Join Date
    Sep 2001
    Location
    Over here
    Posts
    1,140
    This is great stuff guys! Awsome thread. If I understand it correctly, this code:


    this._rotation = 0;
    delete this.onEnterFrame;
    gotoAndPlay(31);

    }
    }

    should take the playhead to frame 31 once the CD stops spinning, is that correct? I'm using this code on a frame along the time line where I want the CD to stop spinning:

    // set this to slowest (final) speed
    _root.mc.minRate = 1;

    // set this to control the initial acceleration
    _root.mc.deccel = 0.5;

    _root.mc.curRate = 10;

    _root.mc.onEnterFrame=function()
    {
    // slow down until we hit a speed of 1

    if (this.curRate > this.minRate)
    {
    this.curRate -= this.deccel;
    }
    this._rotation += this.curRate;

    // are we there yet?
    if (Math.round(this._rotation) == 0)
    {
    // yep, we're there.
    this._rotation = 0;
    delete this.onEnterFrame;
    gotoAndPlay("fadeout");
    }

    }


    The frame labeled "fadeout" is one frame past the frame containing the code described above. Over the next 12 frames, the MC has a tween code that shold make it fade to an alpha of 0, but it doesn't seem to take it there.

    Thanks

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