Tween Movement
Hi, some long time ago i downloaded some thing where is could choose between tween movements. When i have a motiontween then i can choose erase 100 or -100 to make te movement smooth, the thing i downloaded long time ago had some other ways to let a objectmove smooth or bounce etc. I think i had a option in the "Insert/.." menu
Im looking for that.
KirupaForum > Flash > Flash 8 (and earlier)
Posted on: 01-17-2008, 07:52 AM
View Complete Forum Thread with Replies
Sponsored Links:
Tween Movement Using AS
I want to move a movie clip from startx and starty to endx and endy using AS
but have it calculate the smallest distance and move the MC at a set speed accordingly so both X and Y stop in the right place at the same time.
in other words i want a small script to act like i have just tweened a MC
Tween:
MC _X=0
MC _Y=0
Create Motion tween on frame 0
move on 50 frames
Create Motion tween on frame 50
set the _X from 50 to 100
set the _Y from 50 to 200
play()
The movie clip moves to frame 50 but the _X moves at a slower speed than the Y because it has less distance to travel
can someone show me how this is done in AS
with a startX of 0 and a startY of 0
end X of 100 and an end Y of 200
View Replies !
View Related
Tween Movieclip Movement
I have a button, which when clicked moves a movieclip to a new position. Is there code which cn be addedto make the movement of the clip smoother because right now it just jumps.
Originally Posted by My current code
hide_btn.onPress = function() {
mainbg_mc._x -= 130;
}
View Replies !
View Related
Tween Class For Movement?
Hi...
What is the best way to scale and move objects in Flash these days? The code I have always used doesn't seem to work as nice in version 8. I'll post a sample of what I am talking about. The redraw of the image in 8 seems jagged and a little blurry. Or is that just the way it is now?
http://schmidtmediaco.com/flashtest/
Thanks,
Dan
View Replies !
View Related
Can You Actionscript A Tween For More Fluid Movement?
Here is the delima: I have seen a site that uses moving 3 boxes as a design element. I liked the design so I copied it when makeing my site. Only problem is mine moves somewhat jittery and his is smooth. I have tried increasing the frame rate to no avail. I have come to the conclusion that this could only have been created with actionscript to make it so smooth. Please compare the two sites to see what I am talking about.
His site: http://stevenlippman.com
My site: http://domophoto.com
View Replies !
View Related
Tween Mouse Movement Based On...
Searched the forum and couldn't find the mouse movement using the ._x/._y tween class to move based on another mc's dimension to give me the idea how to work on it. Could use some help here to nudge me the right direction...
jace
View Replies !
View Related
Movement A Bit Jumpy With Motion Tween
I have created a simple motion graphic.
the content is a static background, two lines, and some words. I have set up a mask layer so that as the two lines (one horizontal, and one verticle) move accross the graphic, the words are revealed.
my problem is that instead of a nice smooth movement of the lines and the mask, it jumps. Granted the jumping is very small increments, but it is deffinitly noticeable.
any ideas how to make motion tweens smooth?
thanks
Ras
View Replies !
View Related
Tween Combination Odd Movement (curving Round)
Ive got some balloons I want to zoom through, so I need to do them all, but Im just working on one and the problem is instead of moving diagonally and enlarging it curves around annoyingly and I dont understand why.
I am scaling from 30% as thats how large the mc is to start with on the canvas (the mc is 30% so in the code the function has to start from 30% otherwise it just uses 100% for some reason, this may be why its messing up I dont know)
I really need someone to look at the file I think, just look at how the balloon curves around rather than moving in a line.
Code:
import mx.transitions.Tween;
import mx.transitions.easing.*;
var scaleFrom = 30;
function zoom(){
var mcXScale:Tween =
new Tween( balloon1, "_xscale",
Regular.easeIn, scaleFrom, 200, 4, true );
var mcYScale:Tween =
new Tween( balloon1, "_yscale",
Regular.easeIn, scaleFrom, 200, 4, true );
var mcYMove:Tween = new Tween(balloon1,"_x",Regular.easeOut,250,-170,4,true);//250 is x location of mc, next num is where to go on x axis, 4 is time
var mcXMove:Tween = new Tween(balloon1,"_y",Regular.easeOut,340,1000,4,true);//340 is y location of mc, next num is where to move to on y, 4 time
//
};
hope someone can help (code is on main line, click balloon in distance for the animation to happen)
Attachment:
http://homepage.ntlworld.com/spensley/portProb.zip
View Replies !
View Related
Image Movement Problem On Alpha Tween
Occasionaly when I do a motion tween on a jpeg (that I converted to a symbol) from 0 alpha to 100 alpha, the image seems to move slightly (jumps around a pixel or so) as it fades in? Has anyone has this problem and know a way around it?
Thanks & Regards
Weevil
View Replies !
View Related
Actionscript Movement Corrupt The Motion Tween
I have a MoveiClip in my stage, I use actionscript to move it to some other position. It works great.But in some frames later I inserted a keyframe and I used the same movieclip for a motion tween. but this motion tween is not considered at all. what's the problem.... how should I fix it ?!
the main goal of doing such a thing is below :
I'm doing a game, in the desired movieclip there are some other of movieclips which will be visible / invisible due to some conditions. after finishing the game I want the same MovieClip ( with exactly the same properties of visible / invisible internal movieclips) to start a motion tween, but It doesn't start the motion.
View Replies !
View Related
Tween Class: Can One Tween More Than One Property Using The Same Tween
I want to scale both the _xscale and the _yscale properties of a clip, using a single execution of the Tween Class. See example below:
Code:
import mx.transitions.Tween;
var myTween:Tween = new Tween(myMovieClip_mc, "_xscale", Strong.easeOut, myMovieClip_mc._xscale, 300, 5, false);
Since one property at a time must be passed as a string to the constructor, I tried the following code, but it does not work quite as flawless as I expected:
Code:
myTween.onMotionChanged = function() {
//trace( this.position );
myMovieClip_mc._yscale += (300 - myMovieClip_mc._yscale)/12;
};
Any suggestions?
View Replies !
View Related
Capturing Mouse Movement/locking Out A Direction Of Movement
does anyone have a good solution in AS 2 for simulating horizontal and vertical finger gestures like on an iPhone?
I have a Mouse listener that calculates movement in both directions and whichever one is larger in value (primary movement of mouse) then it locks out the other using a boolean value. And then once the mouseUp event is triggered, it sets the values to true again to listen for another horizontal or vertical gesture movement.
the problem I'm running into is that every once in awhile while I'm "gesturing" or moving the mouse in a particular direction, I'll get some funky results which clues me into that the other direction might not being totally locked out.
Make any sense?
View Replies !
View Related
Flowing Mc Movement Opposite Of Mouse Movement
I have a mc (fStrip) which looks like a piece of filmstrip with thumbnail images in it. I want this mc to move when the users mouse is positioned over it, but I only want it to move only along it's x-axis and in a direction opposite that of the mouse. And I want it to move or flow smoothly.
I've been trying to figure this out (see my lame attempt below) but without much luck. Can anyone help me out? Thanks.
onClipEvent (mouseMove) {
buffer=20 //movement buffer
mousePos=_root.fStrip._xmouse //store mouse position
if (mymouse!=_root.fStrip._xmouse){ //if the mouse has moved
diff=mymouse-_root.fStrip._xmouse; //find amount of movement
_root.fStrip._x-=diff/buffer; //buffer & set strips movement
updateAfterEvent(); //adding this makes the movement cleaner
}
}
View Replies !
View Related
Image Movement Based On Mouse Movement
I have my Flash canvas. In the Canvas I have an image that's centered and larger than the canvas. Obviously the entire image isn't shown. How can I use actionscript to move the image according to where the mouse is? So if I move my mouse to the top right corner I want the image to move accordingly to display the top-right corner (obviously in a smooth fashion . I tried looking for examples but wanted to know if anybody out there new.
Any ideas?
Little help and thanks in advance!
Brian
View Replies !
View Related
Ants Movement (based On Snow Movement)
Hey! I have a question for those who think they can help and might have the time to do so. I wish to get the effect of ants scuttering across the screen or up a tree, I have not decided which direction yet. I started with the tutorial code for the snow effect from kirupa, and changed it around to fit the little vector ant I created. The way I have it now looks pretty good, but the movement is a little too fluid. They obviously move in sinusoidal paths bc the code tells them to. I have about 20 copies of the main obj, and they're all a little different in size and specs (speed, transparency, etc) but what I was wondering was if there is any way I can change the code to make it a little more hectic, or erratic, not so fluid. If there is no way of doing so, it looks pretty good right now. If there is, however, I think it could look awesome. here's the code I'm using for the object.
onClipEvent (load) {
//stage
movieWidth = 850;
movieHeight = 50;
//mods for ants
i = 1+Math.random()*5;
k = 1.2*(-Math.PI)+Math.random()*Math.PI;
//each ant diff
this._xscale = this._yscale=38+Math.random()*30;
this._alpha = 75+Math.random()*100;
this._y = -10+Math.random()*movieHeight;
this._x = -10+Math.random()*movieWidth;
}
onClipEvent (enterFrame) {
rad += (k/70)*Math.PI;
this._y -= Math.cos(rad);
this._x += i;
if (this._x>=movieWidth) {
this._x = -3;
}
if ((this._y>=movieHeight) || (this._y<=0)) {
this._y = -2+Math.random()*movieHeight;
this._x = -3;
}
}
(I apologize for posting the code without one of those code boxes ppl use, I do not know how to do that yet....)
Any help is greatly appreciated! I wanted to congratulate everyone here at kirupa for having a great community, and great help to those that need it. I am so glad to be a part of it.
Luke
View Replies !
View Related
Object Movement Based On Mouse Movement
Not sure how to word this but. I have a object on the stage lets say that is 300 pixels wide. The actual stage is only 100px wide. I want to be able to "pan" the object left and right based on mouse position/movement. I saw a tutorial for it a while back but cant seem to find it. Anyone have a link to a tut or can throw out a little source code? It would be greatly appreciated.
View Replies !
View Related
Ants Movement (based On Snow Movement)
Hey! I have a question for those who think they can help and might have the time to do so. I wish to get the effect of ants scuttering across the screen or up a tree, I have not decided which direction yet. I started with the tutorial code for the snow effect from kirupa, and changed it around to fit the little vector ant I created. The way I have it now looks pretty good, but the movement is a little too fluid. They obviously move in sinusoidal paths bc the code tells them to. I have about 20 copies of the main obj, and they're all a little different in size and specs (speed, transparency, etc) but what I was wondering was if there is any way I can change the code to make it a little more hectic, or erratic, not so fluid. If there is no way of doing so, it looks pretty good right now. If there is, however, I think it could look awesome. here's the code I'm using for the object.
onClipEvent (load) {
//stage
movieWidth = 850;
movieHeight = 50;
//mods for ants
i = 1+Math.random()*5;
k = 1.2*(-Math.PI)+Math.random()*Math.PI;
//each ant diff
this._xscale = this._yscale=38+Math.random()*30;
this._alpha = 75+Math.random()*100;
this._y = -10+Math.random()*movieHeight;
this._x = -10+Math.random()*movieWidth;
}
onClipEvent (enterFrame) {
rad += (k/70)*Math.PI;
this._y -= Math.cos(rad);
this._x += i;
if (this._x>=movieWidth) {
this._x = -3;
}
if ((this._y>=movieHeight) || (this._y<=0)) {
this._y = -2+Math.random()*movieHeight;
this._x = -3;
}
}
(I apologize for posting the code without one of those code boxes ppl use, I do not know how to do that yet....)
Any help is greatly appreciated! I wanted to congratulate everyone here at kirupa for having a great community, and great help to those that need it. I am so glad to be a part of it.
Luke
View Replies !
View Related
Using Stop(); On A Shape Tween Of A Swapped Movie Clip Symbol Within A Motion Tween
Thanks a lot for your time. I'm new to actionscript, and language syntax and I never really got along to begin with so I appreciate any help in the matter.
Basically the title says it all - I made a motion tween in the main scene, made a movie clip symbol (to shape tween a gradient) and added a stop(); inside the gradient-tweened-symbol. I then swapped the movie clip symbol with the motion tween in the main scene, and got exactly the effect I wanted (the item moved, then tweened itself) but the stop(); seems to have no effect.
I know this looks like one of those "that idiot didn't google before posting" questions, but I've been looking for about a half hour with different permutations of stop, doesn't work, actionscript, and flash, and I haven't found anything that seems to target this problem specifically.
If you've got any idea what's going wrong, please feel free to respond or show me how to better seek help on my own. Thanks again.
View Replies !
View Related
Tween Class If Moved Mc Passed Point Start Another Tween
Hey Actionscript Gurus
Now I am using the Tween Class to move some boxes in my movie, now I can move the first mc and then another mc after the first tween has finished with onMotionFinished but I was hoping someone could help with how do I start the second tween when the first mc has passed a certain _x coordinate.
ie starting the second mc moving while the first tween is still moving.
I am trying to do a intro loader for my front page controlling around 7 boxes. So I need to repeat this a few times.
Regs,
Jacko
View Replies !
View Related
Tween Class If Moved Mc Passed Point Start Another Tween
Hey Kirupa Flash Gurus
Now I am using the Tween Class to move some boxes in my movie, now I can move the first mc and then another mc after the first tween has finished with onMotionFinished but I was hoping someone could help with how do I start the second tween when the first mc has passed a certain _x coordinate.
ie starting the second mc moving while the first tween is still moving.
Regs,
Jacko
View Replies !
View Related
Laco Tween Engine Versus Flash Native Tween
i am wondering if there is a way to put a delay (seconds) on the flashs' native tween class like you can on the laco tween engine... such as
Code:
#include "lmc_tween.as"
my_mc.tween("_x",100,1,"easeOutStrong",1.5,callbackFunction)
where "1.5" is would be the one and a half second delay before the tween starts. this is very useful to me because i dont have to use a callback function or an onMotionFinished function to start a new tween.
thanks in advance to anyone who can teach me
-frankf
View Replies !
View Related
Tween Class Scaling Breaks Motion Tween?
I have a movie clip which uses a motion guide to animate the entry (and eventually the exit) of a bunch of other movie clips. These smaller clips contain buttons, and animate on rollOver and rollOut using the following code:
Code:
on(rollOver) {
this.swapDepths(2);
ParentxScale = new mx.transitions.Tween(this, "_xscale", mx.transitions.easing.Back.easeOut, this._xscale, 100/.6, .5, true);
ParentyScale = new mx.transitions.Tween(this, "_yscale", mx.transitions.easing.Back.easeOut, this._yscale, 100/.6, .5, true);
play();
}
on(rollOut) {
ParentxScale = new mx.transitions.Tween(this, "_xscale", mx.transitions.easing.Bounce.easeOut, this._xscale, 100, .5, true);
ParentyScale = new mx.transitions.Tween(this, "_yscale", mx.transitions.easing.Bounce.easeOut, this._yscale, 100, .5, true);
stop();
}
However, once an object has been moused over, it doesn't exit with the others. Any ideas why it seems to "fall off the track" of the motion guide?
View Replies !
View Related
Sluggish Movement With ActionScripted Movement...
I really enjoy using the following bit of code for quick little flash animations:
=======================================
onClipEvent (load) {
_root.targXscale = 50;
_root.targYscale = 200;
}
onClipEvent (enterFrame) {
cXscale = this._xscale;
cYscale = this._yscale;
difXscale = cXscale-_root.targXscale;
difYscale = cYscale-_root.targYscale;
setProperty(this, _xscale, cXscale-(difXscale/5));
setProperty(this, _yscale, cYscale-(difYscale/5));
}
=======================================
It comes straight from the tutorials ("Basic Animation via ActionScript"). Anyways, whenever I view the .swf (via IE) on my computer (2.4 Ghz / 512 MB RAM), it looks great... better than great... it looks AWESOME! But, if I check it out at work (550 Mhz, 256 MB RAM) it looks terrible. It's choppy, mouse movement is sluggish, and the entire animation looks like it's running at 1 or 2 FPS.
I know it can't be completely dependent on the computer speed, b/c I've seen other flash sites that look great on the slower PC. Even some of the non-scripted movements are sluggish on my work PC... what the?! Is there a snippet of code that would / could help?
View Replies !
View Related
Do I Use A Shape Tween? Mask? Motion Tween?
How do I make this arrow grow into shape? I want it to slowly appear...but not fade in...
it's hard to explain...but here is the arrow, hopefully you will understand what I want...
I tried using a mask, but instead of revealing the arrow little by little, it dissapeared little by little...(basically the exact opposite)...
I also tried putting a white box over it & motion tweening the box to reveal the arrow...but that didn't look good...
any ideas?...suggestions?
thanks in advance...
View Replies !
View Related
After Tween, Jump To New Frame (using Tween Class)
I need some help with using the tween class (among other things).
See my attached test file. It's clearer than my description.
You're supposed to be able to click the "next" or "prev" buttons and see the movie clip move forwards or backwards. It works, but only on the first click of the button. After the initial click I need the timeline to jump to frame label "2", and after the second click I need the timeline to jump to frame label "3", and so on, so that I can implement a new set of perameters. Is that clear? I'm so annoyed with this. Please help!
Thanks.
View Replies !
View Related
Tween Class Problem. Tween Freeze?
I am using the tween class to do an alpha tween on some jpgs that get loaded into a movieclip. Everything thing works great until the user rapidly clicks on the 'next' arrow to jump forward to a new picture. If the user clicks too quickly something happens and the tween function stops working.
Here is the tween code:
Code:
//set up tweening
import mx.transitions.easing.*;
import mx.transitions.Tween;
var tweenAlpha:Tween;
function alphaTween(object,duration){
easeType = mx.transitions.easing.Regular.easeIn;
tweenAlpha = new mx.transitions.Tween(object, "_alpha", easeType, 0, 100, duration, true);
}
http://12dogsofchristmas.com/12_dogs_menu2.swf
You'll notice that if you click slowly on the arrows the pictures load correctly with the story. However, if you click fast they stop tweening.
thanks for the help.
View Replies !
View Related
Change From Motion Tween To Shape Tween
I am trying to have a motion tween of some text move on the page and then change into a shape (i.e, a shape tween). I can't seem to make this work. I put a keyframe at each end of the motion tween and that works fine. Then I add another keyframe, delete the text and replace it with my shape. Then I select just those frames and add the shape tween but nothing happens. How do I accomplish this successfully?
Thanks.
View Replies !
View Related
Shape Tween / Motion Tween Problem
I must be missing something very obvious.
I have created a movie that draws a box, fills in the box with color and then is supposed to have the menu swoop in from the right. Mind you this is for learnnig, not cosmetic appeal Why is it when I use tweens I get the dotted line versus a solid line in the time line?
If you take a peek at the FLA it is obvious what I am referring to. I must be using the tween function or symbols in an improper manner.
I have attached the FLA.
Any help appreciated.
Thanks,
Kerry
www.skurz.com
View Replies !
View Related
How To Programmatically Begin A Tween When Another Tween Ends?
Hey everybooody,
In this example, I'm trying to programmatically fade-in the alpha of menu items created from xml data. Using the tween object, I'm trying to start the next tween once the first or previous tween has finished.
Clearly in my attempt below, the “if” statement isn't cutting it because it's not waiting for the tween to be finished.
Using the oListener.onMotionFinished method, I tried using a Boolean to return true when finished, and then to start the next tween. But clearly I haven’t figured out the proper control flow for this.
I also tried a 'do while' statement, attempting to creating a waiting-loop until the bCheck returned true, but that just created a series of open loops, and crashed the program.
The big problem here is that I'm trying to figure out how to do this while looping through an array of menu items, so that I triggure the fade in of each menu item...
Has anyone had experience with this? Thanks!!!
Here's what I was trying to do:
function fadein_menu() { var bCheck:Boolean = false;
var oListener:Object = new Object();
oListener.onMotionFinished = function(twObject:Tween):Void {
bCheck=true;
};
for (var i = 0; i<totalMenuItems; i++) {if (i==0) {var twMenuAlpha:Tween = new Tween(menuitems[i], "_alpha", Strong.easeIn, 0, 100, 3, true);
twMenuAlpha.addListener(oListener);
} else if (i>0) {if (bCheck==true) {bCheck=false;
var twMenuAlpha:Tween = new Tween(menuitems[i], "_alpha", Strong.easeIn, 0, 100, 12, true);
twMenuAlpha.addListener(oListener);
};
};
};
};
View Replies !
View Related
Tween Class Not Always Fulling Complete Tween
I have a switch statement that is a part of the tween effects found on the header of http://gfxcomplex.com/blog.
the problem is this case will change the rotation of a sprite and then tween it to zero. The funny thing is some times ("not all the time") some of the tween stop in the middle and do not complete leaving the sprite with a rotation somewhere in the middle of 180 to 0. My question is, is there something in my code that could be the reason for this or is this a bug??
You may have to watch the header for a long time to see this bug happen as it seems to be more a fluke then a true code bug.
PHP Code:
case 7 : var u:uint = 0; test1.getChildAt(0).rotation = 180; test1.getChildAt(1).rotation = 180; test1.getChildAt(2).rotation = 180; test1.getChildAt(3).rotation = 180; test1.getChildAt(4).rotation = 180; intervalId = setInterval(function myFunction(){ myTween1 = new Tween(test1.getChildAt(u), "rotation", Bounce.easeOut, 180, 0, 3, true); u++; if(u == 5){ clearInterval(intervalId); } }, 150);break;
View Replies !
View Related
Shape Tween / Motion Tween Problem
I must be missing something very obvious.
I have created a movie that draws a box, fills in the box with color and then is supposed to have the menu swoop in from the right. Mind you this is for learnnig, not cosmetic appeal Why is it when I use tweens I get the dotted line versus a solid line in the time line?
If you take a peek at the FLA it is obvious what I am referring to. I must be using the tween function or symbols in an improper manner.
I have attached the FLA.
Any help appreciated.
Thanks,
Kerry
www.skurz.com
View Replies !
View Related
Seperating Motion Tween From Alpha Tween
I am trying to fade in the alpha on a graphic symbol rather quickly at the same time the symbol scrolls very slowly up the stage, but the two seem linked, so that a very slow scroll means a very slow opacity gain. How can I fade the photo in quickly while the photo motion tweens slowly?
View Replies !
View Related
Laco Tween Pause/Stop Tween
Hi There,
I am using laco tween to move dynamic text that is taken from XML. I need the text to pause when the user rollsover the text, is there anyway of using the stopTween() function, then on rollOut getting flash to continue with the tween?
Thanks.
Dabush
View Replies !
View Related
Jerky Tween- How To Get A Smooth Slow Tween- Help
I'm working with a very slow tween of an image (800 by 350px and 50 kb) over a time of 60 seconds and it's jerky.
Code:
Tweener.addTween(pic, {x:pic.x-100, time:60, transition:"linear"});
I tried upping the frame rate to 30, then 60, but it didn't seem to make a difference.
I also tried using TweenLite, Tweener, and the built-in Tween class. None really performed better than the other. Another thing I tried was importing the image as a swf, masking it, and then tweening it. None of those really made a difference, still jerky.
Any ideas?
View Replies !
View Related
How To Motion Tween Thats Not Linear Using Script Or MC Tween?
If you wanted to do an animation of a ball that goes from A to B but not linear, how would you do it by code or Mc tween. How would you make the ball go in a curve line for example instead of a straight line from A to B?
I understand you can use a guide to get all types of non linear motion tweens on a timeline, but how would you do it using MC tween or coding.
View Replies !
View Related
"Electron Movement" Tricky Actionscript Movement Animation
Can anybody help me with the actionscript for this one?
Objects floating from right to left on a page, when they float into static objects instead of passing behind them or in front of them or bouncing off them and going the other way, they simply move round the static objects and carry on.
Like drunks walking through a jungle of lamposts.
View Replies !
View Related
Motion Tween & Shape Tween In Same MC? How?
I have created a shape tween on my first layer. On my second layer I would like to create a motion tween. But the motion tween says it will not occur with layers with shapes or more than one group. Can anybody enlighten me a little bit on this.
Thanks for any help that is given.
Derek
View Replies !
View Related
Make Exit Tween Do Into Another Tween
okay here's the deal. for every button i have on a flash menu. i have a lil animation tween that plays when the specific button it's set for it clicked on.
what i would like to do is add an exit tween for each of these animations that does the reverse of the animation before starting up the new animation.
now... this could probably be done using gotoandplay actionscript with frame labels, but i would have to make special sets of buttons for each section...
is there another easier why for the button to play the exit tween when pressed then go to the tween of whatever button was pushed??
please let me know...
K-Fresh
View Replies !
View Related
Tween Class Vs Custom Tween?
I have searched for info on the Tween class, gave up when I found little to nothing on it, so here I am with some questions.
1 - Can I use this class in MX 2004 or is it in 8 only? If so, what is the invocation script?
2 - How flexible is the easing of the Tween class? Can it do more than just fast/slow in/out (fully customizable time curves)?
3 - Can you specify a finite amount of time in which the current invocation of Tween must be completed, or do you have to calculate and apply values to enforce this?
Thanks,
+Q__
View Replies !
View Related
[F8] Mx.transitions.Tween Set Quality During Tween
Code:
function tweenull(clip:Object, targetX:Number, targetY:Number, seconds:Number):Void {
new mx.transitions.Tween(clip, "_x", mx.transitions.easing.Elastic.easeOut, clip._x, targetX, seconds, true);
new mx.transitions.Tween(clip, "_y", mx.transitions.easing.Elastic.easeOut, clip._y, targetY, seconds, true);
}
this is my tween function. How can i set the quality to low during the tween action ?
View Replies !
View Related
Tween Class - Tween Lines
I have 5 seperate movie clips that each contain 5 lines, which are contained within their own individual movieclips, each with their own instance name.
I have written a function, included below, that uses the tween class to make one set of lines move/morph to the location of the second set, contained within the other movieclip.
It's basically a transition.. it's for the navigation of a site I'm working on. When you click a different navigation link, the lines that the nav & content are based around morph/change.
The problem I'm having is not all the lines tween to the right location/position. I've attached a 2 screenshots to show..
I've tried the function with the addition of the _xscale, _yscale, and _rotation properties, but they don't change anything.
Heres the function:
Code:
function moveLines(begin, end) {
//this moves the MC that holds the 5 lines to the x/y pos of the other MC.
var x_container:Tween = new Tween(_root[begin], "_x", Regular.easeOut, _root[begin]._x, _root[end]._x, 10, false);
var y_container:Tween = new Tween(_root[begin], "_y", Regular.easeOut, _root[begin]._y, _root[end]._y, 10, false);
//this is the loop that gets the start/end variables and creates the tweens
for (i=1; i<=5; i++) {
x_begin = _root[begin]["l" + i]._x;
x_end = _root[end]["l" + i]._x;
y_begin = _root[begin]["l" + i]._y;
y_end = _root[end]["l" + i]._y;
height_begin = _root[begin]["l" + i]._height;
height_end = _root[end]["l" + i]._height;
width_begin = _root[begin]["l" + i]._width;
width_end = _root[end]["l" + i]._width;
var x_tween:Tween = new Tween(_root[begin]["l" + i], "_x", Regular.easeOut, x_begin, x_end, 15, false);
var y_tween:Tween = new Tween(_root[begin]["l" + i], "_y", Regular.easeOut, y_begin, y_end, 15, false);
var height_tween:Tween = new Tween(_root[begin]["l" + i], "_height", Regular.easeOut, height_begin, height_end, 15, false);
var width_tween:Tween = new Tween(_root[begin]["l" + i], "_width", Regular.easeOut, width_begin, width_end, 15, false);
}
}
Now here are the screenshots. The first is before the tween occurs, and the second is after. As you can see, some of the lines don't fall into the right position. Any help is greatly appreciated! I have a deadline for this this week and I'm freaking out!
before tween:
http://sagebrown.com/before.jpg
after tween:
http://sagebrown.com/after.jpg
View Replies !
View Related
How To STOP A Tween With The Tween Class?
here's my code....
Code:
function generalTween(mc, attr, begin, end, time, func, easeType)
{
if (easeType == undefined) easeType = mx.transitions.easing.Bounce.easeOut;
var myTween = new mx.transitions.Tween(mc, attr, easeType, begin, end, time, true);
if (func != undefined) myTween.onMotionStopped = func;
}
function onReleaseFunc()
{
myBall.stopDrag();
generalTween(myBall, "_x", myBall._x, (Stage.width / 2), 2, undefined, mx.transitions.easing.Elastic.easeOut);
generalTween(myBall, "_y", myBall._y, (Stage.height / 2), 2, undefined, mx.transitions.easing.Elastic.easeOut);
}
myBall.onPress = function()
{
myBall.startDrag();
}
myBall.onRelease = function()
{
onReleaseFunc();
}
myBall.onReleaseOutside = function()
{
onReleaseFunc();
}
To test this just make a movieclip on your stage and give it an instance name of "myBall"
you'll notice that the problem is, if you try to click and drag the movieclip again before the tween is completed finished, then it doesn't work.
How can you force a stop on a tween?
thank you so very much in advance!!!!
View Replies !
View Related
Tween Vs Non-Tween Which Is Intensive On Processor
Im working on a Real time strategy game in AS3 currently, and for unit movement I need to decide whether or not I should use Tweens or looping functions which update the .x and .y parameters of the movieclips on screen.
Currently the game uses Tweens from the start position to end position, with a speed variable defining how fast it should move, but currently there are very few units moving at once. I could however use a looping function which checks to to see which units need to be moved each cycle and moves them accordingly.
The question is which with considerable amounts of units on screen at once would be less processor intensive? OR is there some other method I could use?
View Replies !
View Related
End 1st Tween Start 2nd Tween {Newbie}
Hi
I'm thinking of that close all day long I can't find an answer for it.
I want that the mc clip 'rahmen' play's the tween 'move' first and than when the move tween is finishe start to play the 2nd tween 'mover'.
How could I do that?
PHP Code:
stop();
MovieClip.prototype.mover = function(distX, distY, breite, hoehe, speed) {
this.onEnterFrame = function() {
this._x += (distX-this._x)/speed;
this._y += (distY-this._y)/speed;
this._width += (breite-this._width)/speed;
if (this._width === breite); {
this._height += (hoehe-this._height)/speed;
}
};
};
MovieClip.prototype.move1 = function(ys, al, tar) {
this.onEnterFrame = function() {
this._y -= ys;
this._alpha += al;
if (this._y <= tar) {
delete this.onEnterFrame;
};
};
};
_root.attachMovie("mc_rahmen", "rahmen", 100, {_alpha:100, _x:200, _y:400});
rahmen.move1(2, 10, 200);
rahmen.mover(200, 200, 200, 100, 40);
I hope somebody could help me please.
thx a lot
Newbie_AS
View Replies !
View Related
Playing Another Tween As The Other Tween Ends
Hi,
I am currently working on a web site and i cannot run a another tween animaton when i click on another button.
i have a main MC( with 4 buttons on it) on the stage and when i click on a button it animates 2 blocks that have been created at runtime and goes from right to left.
What i want is when i click on another menu button, the boolean changes and i must be able the rewind the animation and do another but it does not work.I must click twice, once it rewind and the 2nd one it shows the animation..
Please help as it is quite urgent.
jerome.chevreau@gmail.com
Please please
Thanks
View Replies !
View Related
|