ActionScript 3.0 :: Tween Class / Shink A Square To Its Original Position

Apr 30, 2009

When I mouseover the square and it expands and when I mouseout the square it should shrink back to its original position. The expandSquare works but the shrinkSquare doesn't.[code]

View 2 Replies


Similar Posts:


ActionScript 3.0 :: Tween Class - Tween Back To The Original Position?

Oct 27, 2009

I am trying to understand the thinking behind motion tweening using AS3 (rather than doing it on the timeline).I am trying to create a simple platform game, and while this is simply a learning project, I have an movieclip instance on the stage, and using basic x+5 logic I can get the instance to move left and right on the stage accordingly.Trying to make the instance 'jump' is a bit trickier. This is the code I am using:

ActionScript Code:
import fl.transitions.Tween;
import fl.transitions.easing.*;
import fl.transitions.TweenEvent;[code].....

I thought this code would move the instance from it's current y-position and tween it to it's highest jump point. From here I planned to use a MOTION.FINISH event to tell it to tween back to it's original position.Something strage happens though, rather than tween from the current y position and move up, the instance instantly transforms it's position to y+100 and then tween back to the original position. So it kind of turns out that it is the second part of the jumping action that I want to create.

View 2 Replies

ActionScript 3.0 :: Tween Back To Original Position?

Mar 10, 2010

Do you know how to rewind a tween. but I dont want it to just snap back to the beiginning. I want it to yoyo back to the beingining without actually yoyoing many times. you know what I mean?this is the code I have which make the beginning motion I want:
 
public function imageSelectR(e:MouseEvent):void {
myTween = new Tween(imageLoaderHost, "z", Regular.easeInOut, 0, -100, 1, true);
myTween.addEventListener(TweenEvent.MOTION_FINISH, imageSelectL);

[code]...

View 2 Replies

ActionScript 2.0 :: Position Property Don't Work In Tween Class

Jan 12, 2009

i am trying to change the position while the yoyo is working but the tween object goes to the new position and then back to the old position and continuing to yoyo.

ActionScript Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var swing:Tween = new Tween(swingObj, "_rotation", Regular.easeInOut, 60, -60, 2, true);

[code]....

View 2 Replies

ActionScript 2.0 :: Moving Circle To X Position When User Click On Square

Jun 18, 2008

I have a circle and a square on the stage. When you click on the square the circle will go to "circle._x = 300" when the circle is at 300 I want to make it when you click on the square the circle will go "circle._x = 45"

Code:
moveCircle = function () {
circle._x = 300;
if (circle._x >= 300) {
circle._x = 45;
}} square.onRelease = function() {
moveCircle();
trace(circle._x + "is the position of the circle");
}

View 5 Replies

ActionScript 2.0 :: Replace Mc On Their Original Position?

Oct 17, 2008

im doing a drag and drop quiz in as2, and so far it all works, except the Reset function which is suposed to replace all of the numbers on their original position. Here is the function that at the begining of the frame stores in two arrays the original positions of all the numbers:

Code:
function posInitiale() {
for (j=0; j<=target1.length; j++){[code].....

This, doesnt work, it replaces all of the outside of the scene of flash, if you open the swf bigger you will see them at the bottom of the screen, and they are all on top of each other. But again, if in this function I trace both the arrays I still get the same result, which are the correct position they should go on.

View 2 Replies

ActionScript 3.0 :: Stop The Movement Of A MC At Original Position?

Apr 21, 2010

I have a movieclip instance named "ground" i have it set up so that the ground moves constantly to the left as a scrolling BG. what I want is that when the user presses the "space" button, the ground moves down then back up in a a parabolic path. and it does. but I want the movieclip to stop moving vertically(make dy equal to zero) when it returns to its original y position. how can this be achieved?

Code:
package{
import flash.display.*;

[code].....

View 2 Replies

ActionScript 3.0 :: Move The Screen Around From Its Original Position?

Jun 23, 2009

I have implemented a pan and zoom function on my code.Whern I zoom in all components look perfectly rescaled, all shapes and lines.

However my text becomes pixelated and isn't redrawn. Is there a method to make it appear smooth and readable even when I zoom in or move the screen around from its original position?

View 1 Replies

ActionScript 2.0 :: Ease Back To Original Position?

Apr 30, 2003

I'm playing around with mac os x-like dock in flash, but I've got a problem with it. I found this at flashkit.com, see it here. For your convenience i'll post the entire code below (it's quite long though).

Now what i want it to do: if the mouse is not 'on' the menu, i want the buttons to ease back to their original position instead of just spawning there. How can i do this via AS ? The _xscale and _yscale values should also ease back to original state.

Actions applied on the first (and only) frame:

[AS]startDrag ("_root.drag", true);
stop ();[/AS]

Actions applied on the control movieclip:

[AS]onClipEvent (load) {
function checkOffset (coffset) {
if (coffset<-175) {

[code]....

View 2 Replies

IDE :: Jigsaw Gone Awry - Back To The Original Xy Position?

Jan 24, 2010

My code in theory works find but for some reason things aren't doing what they're supposed to. Basically I have all my draggable puzzle pieces as movieclips; they start at specific x's and y's on the axis. You drag them to the corresponding hitbox movieclip and it pops into the other specific x and y spot on the axis (otherwise they go back to the first xy spot).

The problem is sometimes the pieces drag and drop fine, but other times when you click the mouse down, they drag, but when you let go, they don't drop! Randomly! They just follow the cursor around, til you click a few times, and then randomly it will drop and not move (when it's supposed to go back to the original xy position).

[Code]...

View 1 Replies

ActionScript 3.0 :: Tween Movieclip From Current Position After Previous Tween

Mar 17, 2011

I am working on to slide a movieclip across the stage.The movie clip is five times the width of the stage and I am using the Tween  Class to move it across the stage when a button is pressed.The interaction I want is that when the button is pressed the movie clip moves a certain amount.If the button is pressed again it moves further.The script I have come up with though is taking the movieclip back to the original position of the movieclip and then moving it as opposed to moving it from the position it reached after the first button click.I have tried a few things but nothing is working.The script I am using at present is:[code]

View 5 Replies

ActionScript 3.0 :: Movie Clip Should Pop Back To Its Original X And Y Position?

Feb 2, 2009

I made two movie clips that follows the mouse but I want to put constraints on them, they should follow the mouse until the mouse reaches a certain distance and then the movie clip should pop back to its original x and y position.

Code:
private function init():void
{
addChild(backgrnd);

[code]....

View 1 Replies

ActionScript 1/2 :: XML Gallery - Loaded Thumbnails Not Placed At Original Position

Jan 23, 2010

I have made a gallery with xml, and my problem is that when the thumbnails are loaded they move on the Y axis and doesn't want to be in their original placed position. I am attaching a zip with my problematic sample to see what i mean.
Attachments: another_problem.zip (147.0 K)

View 2 Replies

ActionScript 1/2 :: Get The Handle On A Slider To Reset To Its Original Position?

Sep 30, 2010

I'm trying to get the handle on a slider to reset to its original position whenever the frame is changed.

View 2 Replies

ActionScript 3.0 :: Get Original Stage X Position From The Embedded Movie?

Nov 11, 2009

how can i get original stage x and y position from the embedded movie? ie. main movie(full screen) load in secondary movie, and places it in the middle of the stage. press a button in the secondary movie and new movie clip appears but it has to be full screen and be x0 y0 of the main movie.

View 0 Replies

Actionscript 3.0 :: Resetting An Object Back To Original Position?

Dec 11, 2010

I have a movie clip for each piece of clothing that will be used to attach on the dog. These movie clips click and drag to add clothes onto a target and it automatically resets back to its original position each time you grab a different selection of clothing. All of my objects go the original position except for one. The "julyDress" movie clip automatically pops up to the top of the page and does not reset to the original position.

Below is my code:
stop();
var startJulyXPos:Number = JulyDress.x;
var startJulyYPos:Number = JulyDress.y;

[Code]......

View 1 Replies

ActionScript 2.0 :: [F8] Bring A MC To Front, Then Back To Original Position?

Jan 15, 2009

Is there any way to make a clicked movie clip go to front, and then when released, go back to it's original position?

I've been reading about swapDepths and a few functions that allow to bring to front the MC, but nothing to return them to their original positions between the layers.

Can this be done? Or is it any way to make it look as it?

View 4 Replies

ActionScript 2.0 :: Drag And Drop Return To Original Position?

Sep 18, 2004

Trying to build a drag and drop navigation, all the drag and drop works great, the test for the hit works ie if its on the target it centers the drag clip over the target, if its of the target the drag clip returns to its start postion. What I cannot get right is the code to check if the target already has a clip on it, if it has that clip needs to return to its start position, so we only ever have one drag clip on the target.

[Code]...

View 2 Replies

Actionscript 3 :: Tween Position Relative To Current Position?

Jan 23, 2010

I have a tween set on a timer:

var manTimer:Timer = new Timer(1000,14);
manTimer.addEventListener(TimerEvent.TIMER, moveMan);
function moveMan(e:TimerEvent):void {[code]....

I just need to make the tween's position relative to it's current position, as opposed to starting at the stage's 0 position then moving the the stage's -40 position. It needs to start at its current position the move -40 from that position.

View 1 Replies

ActionScript 2.0 :: OnRollOut The Yoyo Is Not Stopping And Can't Get It To Return To The Original Position Either

Feb 10, 2009

I have an enter_mc with arrow_mc (ie. which is ">>") at the end. When I mouse over enter_mc, i want the arrow_mc to bounce back and forth. the problem is when I onRollOut, the yoyo is not stopping and I can't get it to return to the original position either.

[Code]....

View 3 Replies

ActionScript 3.0 :: Snap Back To The Original Position / When Let Go Of Mouse Button?

Sep 26, 2010

I want to make a magic 8 ball in actionscript 3. I'd like to be able to click on the movie clip of the 8 ball, shake it with the mouse, and then have it snap back to its original position when I let go of the mouse button. I have three problems:

1) I can make the 8 ball track the mouse, that's easy, but how do I make it snap back to the original position when I let go of the mouse button?

2) I want to constrain the movement of the 8 ball movie clip so it won't go all over the stage, just enough to move it back and forth a bit.

3) How do I randomize output of answers in the 8 ball window...such as, "not now," "doesn't look good," or "yes" etc?

View 2 Replies

ActionScript 3.0 :: Drag Leaves Static Duplicate In Original Position?

Sep 8, 2011

I posted earlier about getting a zoom effect which was solved by putting the content within 2 containers: the parent container to center the zooming & the pan container (child) to be panned on drag, however when I drag the child a copy of the original remains for some reason?basically I have this to set up the containers:

ActionScript Code:
ParentContainer = new Container();
addChild(ParentContainer);

[code]......

View 2 Replies

ActionScript 2.0 :: Moving Block From Right To Left Then Back To Original Position

Jul 15, 2004

I have a block that I'm trying to make move from right to left, and if the block gets to a certain point, it will move back to it's original position. So, I have this on my block (movieclip) right now.

Code:
onClipEvent(enterFrame) {
speed = 3
dist = 8.5
_x -= speed;
if (_x = dist) {
_x += 3
}}
But all this is doing is throwing the block at the 8.5 distance...

View 9 Replies

ActionScript 2.0 :: Drag And Drop Navigation - Return To Original Position

Sep 18, 2004

Trying to build a drag and drop navigation, all the drag and drop works great, the test for the hit works ie if its on the target it centers the drag clip over the target, if its of the target the drag clip returns to its start postion. What I cannot get right is the code to check if the target already has a clip on it, if it has that clip needs to return to its start position, so we only ever have one drag clip on the target.

Code timeline:
Initialize vars
left = 10;
right = 500;
top = 10;
bottom = 380;
speed = 10;
targetX = targetSpot_mc._x;
targetY = targetSpot_mc._y;
[Code] .....

View 2 Replies

ActionScript 3.0 :: Custom Dragger With TimerEvent. Drag From Original Position?

Apr 8, 2009

I prefer to build custom drag functions using the TimeEvent etc. Below I have some code where as when I click on a MovieClip it fires the imageStartDrag function which then begins the imageDrag function consecutively.Currently when I click and drag it moves the image fine, however it is snapping to the far left of the image.What I would like is to be able to click and drag so that the image drags from it's original point. My brain is a bit confused, what do I edit in 'imageLoader.x = mouseX;' to have it starting from it's original position and moving. (Note, I'm only testing with the X Axis atm, later it will use the Y Axis too.)

Code:
// Image StartDrag Handler.
private function imageStartDrag(e:MouseEvent):void {

[code]......

View 1 Replies

ActionScript 2.0 :: Having A Movie Clip Rotate Back To Its Original Position

Feb 27, 2010

I created a movie clip, an aircraft compass which rotates till the button is pressed but I would like it to return back to its original position in opposite direction of smooth rotation and stop. I already have the following script on the clip.

onClipEvent(enterframe) {
if(spin) {
_rotation -= 2;

[Code]....

View 2 Replies

ActionScript 2.0 :: Scale And Zoom - Back To Its Original Size And Position?

Apr 19, 2004

how i could create a function to do the following. I have a mc and when you click on it i want it to scale too say 150% and move to a different x y position, then when you click on it again i want it to go back to its original size and position.

View 3 Replies

ActionScript 2.0 :: Tween From One Position To Mouse Position?

Mar 28, 2010

tween from one position to mouse position

View 1 Replies

ActionScript 3.0 :: Can't Get Video Clip To Return To Original Position After Its Moved And Re-sized

Oct 15, 2009

I have a video clip which I initially set a size and location to. I then re-size the clip and move it when a button has been pressed. Once the video has finished playing, the video clip should go back to the original location and size. For some reason though, it goes back to a different location though.[code]...

View 0 Replies

ActionScript 2.0 :: When The User Roll Out Of A Sub Menu The Arrow Eases To It's Original Position?

Aug 21, 2004

i'm building a menu that has an arrow that eases to the spot of the sub menu when u mouse over it. i did it very easily.but what i want to do now is when the user roll out of a sub menu the arrow eases to it's original position.so far all my tries faild...the arrows starts "freaking out"...

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved