ActionScript 2.0 :: Top Image To Tween To The Right And Up In X And Y Direction And Also Slightly Rotate
Apr 15, 2007
I am updating source code I came across to AS 2.0 and I am having problems with the tweens. Here is what I am trying to accomplish in AS2.0:[URL] Here is the part of my updated code I am having problems with:
[Code]...
This is my problem: (1) I want the top image to tween to the right and up in X and Y direction and also slightly rotate. THEN I want it to tween back underneath the other stack of pictures in center of swf. However what is happening is that the depth of the topimage is being set under all the pics right away and the tween takes place under all the pics and not ontop. Is there a way for me to wait until the tweens are done and then execute my swapDepths line? Here are problem lines in detail:
[Code]...
View 1 Replies
Similar Posts:
Sep 23, 2010
I really like the new tweens and motion panel that Flash added in CS4 but I'm having some problems with them that I cant find a solution to.
1. When I animate or apply a preset animation it changes the position slightly. I do work where I need things positioned exactly where I put them. For example X:70 Y:210 but when I animate it might for example change it to X:70 Y:210.5 and to make it more confusing even if I animate a group of them at the same time it only does this to some things and not all. Also if I try to change the position back manually it doesnt always let me in the properties panel. I have to go to the Motion Editor and change it there frame by frame.
2. Similar problem to above but with the Alpha property. I want to animate things where it fades on and then stays up for a few frames and then animates back off. When I try to do this using the properties panel it doesnt always let me. So for example I need my alpha values to be in this order for the 4 keyframes. 0, 100, 100, 0. But for the 0 it might force it to 3% instead of the 0 I need. Again I can only fix this by going to the Motion Editor and adjusting it frame by frame.
View 1 Replies
Dec 30, 2010
I was wondering if there is a way to find a slightly darker and slightly lighter colour based on a particular value?
I have a MovieClip with 2 nested MovieClips inside. The background movie I set to a certain colour using ColorTransform and the other movie is sort of shading.
What I'm trying to do is make sure that I transform the shadings colour to be a darker shade of the background movie's colour.
I was also thinking could I then have a mid point where if the background colour is really dark have the shading start to be a certain shade lighter?
View 1 Replies
Jul 26, 2011
given the x & y speeds, how do i calculate the direction of movement?
View 3 Replies
Feb 11, 2012
I am horrible at maths and I would like to ask how to make an object ex. an arrow turn into direction of the mouse?ENTER_FRAME and some mathematical functions, but I cant tell which and how to use them.
View 2 Replies
Oct 21, 2011
I've been trying to rotate an arrow but I can't get it choose the shortest direction. How would I do that?
Here's something I've started:
ActionScript Code:
import com.greensock.TweenLite;
import com.greensock.easing.*;
[code]....
View 3 Replies
Oct 20, 2010
what i have is a circle image (for this purpose lets say it looks like a clock). For example: when you click 3 o'clock, the whole clock needs to rotate around with the 3 o'clock btn at the 6 o'clock position (with the pivot point in the centre). each of the 'time' positions (2 o'clock, 3 o'clock, 4 o'clock ...etc) needs to be a button and thus be able to rotate around to the 6 o'clock position.This would seem simple enough by just using a.rotate value or using tween movieclips...however the tricky part is:the actionscript needs to determine which way the clock turns (anti/clockwise), dependant on where the clicked time-btn's position is. it needs to be some sort of if statement that says:if (3'oclock-btn) is positioned between 0 degrees (being original 12'oclock position) and 180 degrees (original 6 o'clock position), then rotate clockwise to the 6 o'clock position. If the (3o'clock btn) is positioned between 180degrees and 259 degrees (12 o'clock position), rotate anti-clockwise to the 6'oclock position.
View 5 Replies
Nov 13, 2010
currently I have a movieclip that follows my mouse cursor simply using
char.x = mouseX
char.y = mouseY
the movie clip is always upright, how do i add rotation so the char will rotate slowly based on the direction hes moving?
View 2 Replies
Nov 8, 2007
Is it possible to rotate movieclip, while dragging, according to mouse direction and mouse x, y on that clip.
on the picture the 0, 0 of the mc containing red box is where the lines cross, the mouse point is indicated with cursor and around it is the circle where clip's x and y should be constrained and movieclip should rotate according to mouse movement direction for example: when mouse is moving straight down then the clip's x, y rotates up and stops when its 12 o'clock...
View 7 Replies
Jul 30, 2010
I have the following code which works quite nicely but in Clockwise direction. I would like the movie to rotate in a opposite direction which is Anti-Clock direction. How to resolve the problem?The following is the code:
// Adding mouse event to our movieclip!myMovieClip.addEventListener(Event.ENTER_FRAME, rotateMoveClip);
// the rotateMoveClip functionfunction rotateMoveClip(e:Event){ // e.target is the
[code].....
View 1 Replies
Jan 5, 2011
in a .swf object, i rotate pictures in one direction : clockwise (+90°), with the eventRotateHit function. It works!
I need to create a counterclockwise (-90°) function : eventRotateHit2. This function doesn't work : the picture disappear. I think it's because the rotation center is false, but i'm not sure. And i don't know how to change it.
My code :
package Classes.image
{
import fl.controls.Button;
[Code]....
View 2 Replies
Oct 16, 2009
What I really want to know is how to rotate the symbol based on direction of mouse movement
View 1 Replies
May 30, 2007
How do you smooth an image that has been slightly angled?
View 1 Replies
Feb 10, 2012
I set my images at 60% quality JPG files out of photoshop which seems to give a very nice representation. I set up a site to take a full screen, so I expect it to be larger on a bigger screen then what I see on mine. I figured to keep every image actual size at about 25% bigger when the finlal needed size in the layout, so if the site is ever on the bigger screen then images have some stored resolution to be enlarged and accomodate an increase in size. So all of mine images are scaled at about 75%.
Is it a good practise or things don't work this way in Flash? Perhaps it is better to keep the images to 100% (rather than importing intentially enlarges images) but make the maximum quality? Or both ways kind of work out?
View 3 Replies
Oct 16, 2006
Have set up a file which preloads all of my images from an XML before displaying. However I'm having problems, one is the preload bar flashes slightly at the start, then is visible as I scroll through each image in the galleries. I've attached my fla file >> here <<
View 12 Replies
Feb 26, 2012
I am trying to make a banner where two colored squares roll across the screen. The first blue square does just fine, however when trying the same thing with a green square (in a different layer) it does ok the first half of the tween, but reverses direction in the second half (where I placed a keyframe)- even though I rotated the green square the same way as the first half.
View 7 Replies
Oct 12, 2011
I'm trying to code a click-and-point adventure game for a class, in which interactive objects glow when you mouse over them.... In the frame I have the background image (in which there is, say, a drawer), and an image of the drawer glowing placed exactly over top of that. The glow image is invisible until you mouse over it, at which point it is supposed to become visible (and disappear upon mouseout). I have the mouseover function linked to the entire glow image (which is a movieclip), but it only seems to work when you mouseover a specific portion of the image (usually a corner). The code looks something like this:
ActionScript Code:
DeskDrawer.addEventListener(MouseEvent.MOUSE_OVER, drawerLightUp);
function drawerLightUp(e:MouseEvent){
DeskDrawer.alpha = 100;
}
when the glow-image is moused over, it moves upward slightly and a small amount of whitespace appears at the top of the image.
View 1 Replies
Sep 21, 2010
[Code]....
Im just wondering how you can rotate "star2_mc" to the other direction?
View 3 Replies
Jan 31, 2010
I have a movie clip that is rotated when a button is clicked:
Quote:
mc_rightBtn.addEventListener(MouseEvent.CLICK, onRotateRight);
function onRotateRight(evt:MouseEvent):void {
var myTweenRotation:Tween = new Tween(mc_gallery, "rotation", Elastic.easeOut, 0, 90, 5, true);
}
The problem I have is that when the the right button (mc_rightBtn) is clicked again, the rotation starts from the original position. Ideally I would like the rotation to continue from its current position.
View 3 Replies
Oct 24, 2011
i want to rotate 3D an Image called img1 in Flex. I want to rotate it around y axis 180 degree. I can do this by using 3D effect already built in Flex but i want to do a bit more different. I want during rotating, there's another image called img2 appear on back of img1 (in default case, the image appear on the back is img1) and when rotating finish, the image will be img2.
View 2 Replies
Feb 25, 2002
can i rotate a MC like a motion tween, but without the motion tween? i want to press a button and the MC will rotate 360 degrees...
View 14 Replies
Jun 15, 2009
Is it possible at all to have a cube rotate on its Y axis using the Tween class? transitionManager only seems to allow rotation around the z axis.. Is Papervision 3D the only way to achieve this? It seems awfully difficult for a newbie such as myself.
View 1 Replies
Oct 24, 2010
I'm trying to get a MC to rotate to face the mouse using tween:
Code:
import flash.events.MouseEvent;
import fl.transitions.Tween;
stage.addEventListener(MouseEvent.CLICK,clicks);
var tween:Tween;
function clicks(e:MouseEvent):void {
var dx:Number = mouseX-mc.x;
var dy:Number = mouseY-mc.y;
var angle:Number = Math.atan2(dy,dx)*180/Math.PI+90;
tween = new Tween(mc,"rotation",null,mc.rotation,angle,5);
}
While this works fine, there are certain clicks which make the MC pick the longer route to rotate.
View 2 Replies
Mar 21, 2006
I am trying to use the Tween class to first rotate an object and then after the rotation is finished, use a new tween to move the object off the screen. Here is my code:
[Code]...
The trace runs, just as expected, right after the first Tween completes. But the second Tween doesn't work. What am I doing wrong?
View 1 Replies
Apr 19, 2011
I have rotated an image around 0,0 using the code below. I need the new coordinates of the corners of the rotated image.
bitmap.rotation=_angle;
UPDATE: if i rotate an image 10 deg then that moves an image 10 deg clockwise from 0,0
the bottom left corner was 0,20 and so i need to change the point (0,20) 10 deg clockwise using trig?
View 1 Replies
Nov 10, 2008
I am trying to create an image pan that's move this image oposite to the mouse position with a tween effect.
There are lots of posts and tutos but I can't make it runs with as3.
View 6 Replies
May 13, 2008
I'm currently having problems finding anything thats helps me change the direction an image is facing depending on mouse moment. I've found stuff on rotation, but I want my image to flip so its facing the other way.
View 4 Replies
Sep 30, 2009
I want my 360 degree image to continuously scroll in any direction. Has anyone done this? How would I make it happen?
[Code]....
View 4 Replies
Oct 12, 2007
I need to have a movie/image to go in the opposite direction to the mouse.For example, I want the image to go down if the the mouse goes up.Similarly for all other directions.
I want to have a subtle deceleration of the image.I also want to have a border for the image.The mouse should only move when the image is in the boundary.I want to have a mask, so that only the part of the image in the boundary can be seen.
View 2 Replies
Feb 20, 2009
I am designing an online city guide and on this particular page I have an image of a map. I want the direction/location of the mouse to determine the angle of the tilt of my image.This is a perfect example of what I'm trying to explainf you let the preloader load, you will see that on the main page, the pink background image subtly tilts depending on where the mouse is and how close it is to the image.
View 2 Replies