Copy link to clipboard
Copied
I'm working on a project, the goal is to have a .swf animation like this.
The functionality I'm looking for is:
1. I need my animation to make one full rotation and stop,
and then
2. I need to fix my AS3 so you have to CLICK/HOLD/DRAG to progress forward and backward through the timeline, but only when your holding the mouse button down.
Currently the code progresses the frame forward and backward in relation to the mouseX position.
Here is my current code:
import flash.events.MouseEvent;
var startPosition:Number=mouseX;
var delayTime=10;
gotoAndStop(1);
stage.addEventListener(MouseEvent.MOUSE_MOVE, onMouse);
function onMouse(e:MouseEvent):void{
stage.removeEventListener(MouseEvent.MOUSE_MOVE,onMouse);
var currentPosition:Number=mouseX;
if(mouseX-startPosition<=0){
nextFrame();
}else{
prevFrame();
}
setTimeout(setListener, delayTime);
}
function setListener(){
startPosition=mouseX;
stage.addEventListener(MouseEvent.MOUSE_MOVE,onMouse);
}
any help would be appreciated,
Thanks.
Found a thread much like this one that solved all my problems
Here the link to anyone who might be pulling their hair out trying to figure this out in the future
http://forums.adobe.com/thread/570903?tstart=0
Thanks Adobe Forums
Copy link to clipboard
Copied
I have solved the problem with the image not making a full rotation at the begining by putting a stop(); at the top of the code, and placing all code in the final keyframe of my animation.
Copy link to clipboard
Copied
Found a thread much like this one that solved all my problems
Here the link to anyone who might be pulling their hair out trying to figure this out in the future
http://forums.adobe.com/thread/570903?tstart=0
Thanks Adobe Forums
Find more inspiration, events, and resources on the new Adobe Community
Explore Now