A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: onMotionFinished x 3? possible

  1. #1
    Senior Member b18269's Avatar
    Join Date
    Jan 2006
    Location
    London, UK
    Posts
    167

    onMotionFinished x 3? possible

    Im trying to get a shutter to come down, then pause for 2 seconds once its down. Then raise back up off the stage and onMotionFinished gotoandPlay a key frame on the root.

    I know this is a very messy way to do it (shamefully), but its not working because of the x3 onMotionFinished I think. Does anybody know of a much cleaner way to make this happen?

    on (release) {
    Shutterdown = new mx.transitions.Tween(shutter, "_y", mx.transitions.easing.Regular.easeOut, shutter._y, 225, 2, true);

    Shutterdown.onMotionFinished = function() {
    Shutterpause = new mx.transitions.Tween(shutter, "_y", mx.transitions.easing.Regular.easeIn, shutter._y, 225, 2, true);

    }
    Shutterpause.onMotionFinished = function() {
    nextframe = new mx.transitions.Tween(shutter, "_y", mx.transitions.easing.Regular.easeIn, shutter._y, -220, 1, true);
    }

    nextframe.onMotionFinished = function() {
    gotoAndStop("1stscene");
    };
    }

  2. #2
    Developing For Dunkets mneil's Avatar
    Join Date
    Mar 2007
    Location
    Lincoln City
    Posts
    2,156
    That is messy. But, it isn't working because shutterpause only has scope insidt the shutterdown onMotionFinished, and not outside in the on(release). The way to do it would be:


    PHP Code:
    on (release) {
    Shutterdown = new mx.transitions.Tween(shutter"_y"mx.transitions.easing.Regular.easeOutshutter._y2252true);

    Shutterdown.onMotionFinished = function() {
    Shutterpause = new mx.transitions.Tween(shutter"_y"mx.transitions.easing.Regular.easeInshutter._y2252true);


    Shutterpause.onMotionFinished = function() {
    nextframe = new mx.transitions.Tween(shutter"_y"mx.transitions.easing.Regular.easeInshutter._y, -2201true);


    nextframe.onMotionFinished = function() {
    gotoAndStop("1stscene");
    };
    }
    }

    http://code.mneilsworld.com/
    Text Effects | Bubbles | Dynamic Resize
    4 weeks , 20 papers ... thats 2 dollars .....Caassshhh!

  3. #3
    Senior Member b18269's Avatar
    Join Date
    Jan 2006
    Location
    London, UK
    Posts
    167
    thank you so much for this

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