-
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;
}
}
-
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;
-
is there a way just to add onto the existing code?
-
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
-
I meant onto my code that I posted not intromo's.
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|