A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: ease in and out with script

  1. #1
    Member
    Join Date
    Oct 2005
    Posts
    66

    ease in and out with script

    not really that handy with scripting, was wondering if someone knows how to add some easing to this. Right now i gave an mc that rolls out and back, but i would like there to be a bit of ease in ease out on it if possible.

    on the mc that you rollover is this

    on(rollOver) {
    this.forwards=true;
    this.backwards=false;
    }

    on (rollOut) {
    this.backwards=true;
    this.forwards=false;
    }


    inside this mc is this

    onClipEvent(enterFrame) {
    if ((_parent.backwards)&&(_parent._currentframe >= 1)) {
    _parent.gotoAndStop(_parent._currentframe-1);
    }else{
    _parent.backwards=false;
    }
    if ((_parent.forwards)&&(_parent._currentframe<10)) {
    _parent.gotoAndStop(_parent._currentframe+1);
    }else{
    _parent.forwards=false;
    }
    }

  2. #2
    I know nothing.
    Join Date
    Feb 2008
    Posts
    315
    import fl.transitions.*;
    import fl.transitions.easing.*;

    stage.frameRate = 31;

    var box:Sprite = new Sprite();
    box.graphics.beginFill(Math.random() * 0xFFFFFF);
    box.graphics.drawRect(0, 0, 100, 350);
    box.graphics.endFill();
    box.x = 50;
    box.y = 10;
    addChild(box);

    var startValue:Number = box.x;
    var finishValue:Number = 400;
    var duration:Number = 3;
    var myTween:Tween = new Tween(box, "x", None.easeIn, startValue, finishValue, duration, true);
    myTween.looping = true;

  3. #3
    Member
    Join Date
    Oct 2005
    Posts
    66
    is there a way just to add onto the existing code?

  4. #4
    Senior Member
    Join Date
    Aug 2000
    Location
    Montréal
    Posts
    14,141
    is there a way just to add onto the existing code?
    no because intromo's code is AS3. Also not related since it move an object _x position, not the playhead on the timeline.

    For your issue, you should use Caurina Tweener. There's an easing capability on frames.
    more info here: http://hosted.zeh.com.br/tweener/docs/en-us/
    see: Special Properties

    gparis

  5. #5
    Member
    Join Date
    Oct 2005
    Posts
    66
    I meant onto my code that I posted not intromo's.

  6. #6
    Member
    Join Date
    Oct 2005
    Posts
    66
    anybody?

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