not terribly,but its the code I got to work =] (bouncing/jumping), but if its my only option
I'll need to figure something out.
If you have a better way of doing the jump/bounce I would be glad to hear it
Ideally Id like one to three clips, jump onto and off the the stage at different intervals.
I cant seem to get the enterframe to control the clips fluidly. I had seem something similar done on lynda.com,
as a particle system (lesson), but I wasn't sure how or if I could adapt it.
Thanks for the help. I feel like I'm making progress (writing more and more in AS3), though I still have some missing pieces I need to pull it
all together, so I don't need as much as much assistance.
you'll probably get better results and find it easier to use the tween class. just change the code between the dotted lines to start experimenting with it. you should change mc1, mc2 and mc3 to match your objects that you want to "jump".
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;
var tw:Tween;
var endY1:uint = 50;
var endY2:uint = stage.stageHeight+50;
----------------------------------------------------
jumpF(mc1,endY1);
jumpF(mc2,endY2);
jumpF(mc3,endY2);
---------------------------------------------------
function jumpF(dobj:DisplayObject,endY:uint){
tw = new Tween(dobj, "y", Elastic.easeOut, dobj.y, endY, 3, true);
tw.addEventListener(TweenEvent.MOTION_FINISH,twFinishF);
}
function twFinishF(e:TweenEvent){
if(e.currentTarget.obj.y==endY1){
var endY:uint = endY2;
} else {
endY = endY1;
}
setTimeout(jumpF,Math.ceil(Math.random()*5000),e.currentTarget.obj,endY);
}