0

I am trying to create a simple 360 spin in Adobe Animate CC. So the user needs to drag the image left and right to change the frame of an movieclip. (i have a car rendered in a 360 degree animation in 32 pictures)

I have the following code:

this.Silver.on("pressmove", function(evt){
evt.currentTarget.gotoAndStop(Math.round((evt.stageX/28.57142857)+1));// = (evt.stageX/2.777777778);

});

is there a simple way to create a simple 360? I have searched google for some samples, but they are not in Adobe Animate CC. And i am not really a programmer. Just trying to find a way to get me started.

tnx!

Mosh Feu
  • 28,354
  • 16
  • 88
  • 135
user1631575
  • 3
  • 1
  • 6

3 Answers3

0

Once you drag the item on the stage, double click to get to the properties. You should find "Rotation". Enter 359 (not 360, as this will make the wheel jump). You can also enter how many times you want it to rotate.

Hope this helps!

PM

0

If you open the Info panel (Window > Info), you'll notice that when you move your mouse cursor to the left, the x value decreases and when you move your cursor to the right, the x value increases.

You could apply the same concept here. You will need a variable to keep track of your old x mouse position and a variable to keep track of your new x mouse position.

If your new mouse position is greater than the old mouse position, you can assume the mouse is moving to the right and you would go forward a frame. If your new mouse position is less than the old mouse position, you can assume your mouse is moving to the left and you would go backwards a frame. You'll also have to take into account going "forward" on the last frame and going "backwards" on the first frame of your MovieClip.

Here's one way that you can approach this:

//Create a reference to store the previous x mouse position
var old_mouseX = 0;

//Add an event listener 
this.Silver.addEventListener("pressmove", mouseMovementHandler);

//Mouse movement handler
function mouseMovementHandler(event){

//Get a reference to the target
var currentTarget = event.currentTarget;

//Get a reference to the current x mouse position 
var current_mouseX = stage.mouseX;

//Check for mouse movement to the left 
if(current_mouseX < old_mouseX){

    //Check if we're within the total frames of the MovieClip
    if(currentTarget.currentFrame - 1 >= 0 ){   
        currentTarget.gotoAndStop(currentTarget.currentFrame - 1);
    }
    //If not, restart on the last frame of the MovieClip
    else{
        currentTarget.gotoAndStop(currentTarget.totalFrames - 1);
    }
}

//Check for mouse movement to the right
else if(current_mouseX > old_mouseX){

    //Check if we're within the total frames of the MovieClip
    if(currentTarget.currentFrame + 1 <= currentTarget.totalFrames - 1){    
        currentTarget.gotoAndStop(currentTarget.currentFrame + 1);
    }
    //If not, restart at frame 0
    else{
        currentTarget.gotoAndStop(0);
    }
}

 //Update the old mouse position
 old_mouseX = current_mouseX;
}
dommiDom
  • 11
  • 3
0

Animate CC 19.0 comes with a new doctype that lets you export for VR 360 and VR Panorama content out of the box.

Refer here for more details: https://helpx.adobe.com/animate/using/virtual-reality.html