A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: motion guide tweening to random frame

  1. #1
    Always Confused aeliayousaf's Avatar
    Join Date
    Aug 2000
    Posts
    203

    motion guide tweening to random frame

    is it possible to use motion guide tweening and have AS to stop at a random (or an array) frame within the mc?

  2. #2
    Always Confused aeliayousaf's Avatar
    Join Date
    Aug 2000
    Posts
    203
    ok so i figured it out myself...here is what to do if you have the same problem:

    add this on the main time line:

    var frameArray:Array=new Array(47,140,185)
    var target:Number=Math.floor(Math.random()*frameArray. length)
    frameToStopAt = frameArray[target];
    ship_moving.play();

    then on the MC (in my case a ship tweening along a path) add this on the frame you wish the animation to stop at:

    if (_root.frameToStopAt == 47) {
    stop();
    }

    and so on..on the other frames (47, 140, and 185)

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