author: laco [+], Submitted: 12.08.03 5a • Last Edit: 10.14.04 12p
Avg. Rating: 5

usage

msg1 { zeh [+], posted: 12.08.03 5a•12.08.03 5a, top [^] }
Looking nice, Laco, specially because it seems to take advantage of a real oop driven structure and it seems darn well planned.

What I also liked a lot is the fact that it's using one single movieclip for tweening control. It's much more structured and easy to deal with... I wanted to implement this on my tween() prototypes but didn't want to break previous code (although I could set the callback scope manually, I also didn't want to introduce 1000 hacks into the code just to keep it compatible). Having a fresh start is pretty nice for functions like this to be re-organized.

Great work.
msg2 { openmind [+], posted: 12.10.03 2a•-, top [^] }
Whaaaaaoooo!

Great work. I now have one less excuse to use MX 2004 as this is by far my favorite class and I'm so grateful you have recoded it to work in AS2! I do have a question though. Do the colorTo and colorTransformTo methods still work as I couldn't see them in the code and they didn't seem to work when I tried?

any way thanks again,

openmind :)
msg3 { laco [+], posted: 12.10.03 2a•-, top [^] }
colorTo and colorTransformTo would be implemented in few days ;-)
msg4 { laco [+], posted: 12.10.03 6a•02.04.04 9a, top [^] }
Version 0.2 is out... added colorTransformTo + all shortcut methods, please check it :-)
msg5 { vectrex [+], posted: 12.11.03 7p•-, top [^] }
um, why exactly do I have to extract stuff into flash itself? what's the problem with leaving it in my source dir? Everythings going all C++ on me :)
msg6 { laco [+], posted: 12.12.03 2a•-, top [^] }
yes it works, but if you will write your own classes,
whitout modifications in file "MovieClip.as"
you got error: There is no method with the name 'tween'

class testClass extends MovieClip {
function testClass() {
tween("_x", 400);
}
}
msg7 { laco [+], posted: 12.15.03 1a•12.15.03 1a, top [^] }
version 0.3 is out added mxp file: http://laco.wz.cz/mc_tween/MovieClipTween.mxp , i have tested performance & accuracy tween classes & prototypes, http://laco.wz.cz/mc_tween/
msg8 { openmind [+], posted: 12.21.03 12a•-, top [^] }
Hey Laco,

Great stuff have downloaded the new version and the colorTo works!! I'm very happy and extremely grateful for your hard work. I tried installing using the .mxp file, but it seems to contain the old versions of class? Was a bit strange, in the end I just copied the posted source code from above and all is working great!

Hope you have an excellent christmas and new year,

thanks again :)

msg9 { laco [+], posted: 12.22.03 1a•-, top [^] }
thanks Openmind ;)

if you use this prototype from mxp package, you must use #include "lmc_tween.as", i have forgot it document here, sorry for that
msg10 { laco [+], posted: 01.13.04 9a•-, top [^] }
i have rewrite this back to as1 http://proto.layer51.com/d.aspx?f=1165 (logic is the same as in this version)
msg11 { Lowspeed [+], posted: 01.14.04 5p•-, top [^] }
Hi,

First of all let me congratulate you on some amazing Actionscript work. Secondly, let me ask you a question :)

I see the function getTweens in the TweenManager class... is there a way to call this to get all running tweens, not just the tweens on a particular mc?

If so, how would I do it?

Thanks!!
msg12 { laco [+], posted: 01.15.04 12a•-, top [^] }
Hi, yes it can be implemented in easy way, you must add this method to tweenManager class

public static function getAllTweens():Number {
return tweenList.length
}
msg13 { Lowspeed [+], posted: 01.15.04 11a•-, top [^] }
Excellent, thanks!
msg14 { kim [+], posted: 01.25.04 7p•-, top [^] }
great work, laco! you have saved me a TON of work!

i had problems with the "elastic" eases until i copied the code directly from the penner source. they work as follows (i don't know exactly what part of the code fixed it):
case "easeinelastic":
// elastic (exponentially decaying sine wave)
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (!a || a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
case "easeoutelastic":
// elastic (exponentially decaying sine wave)
if (t==0) return b; if ((t/=d)==1) return b+c; if (!p) p=d*.3;
if (!a || a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
return (a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b);
case "easeinoutelastic":
// elastic (exponentially decaying sine wave)
if (t==0) return b; if ((t/=d/2)==2) return b+c; if (!p) p=d*(.3*1.5);
if (!a || a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);
if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
msg15 { laco [+], posted: 01.29.04 2a•-, top [^] }
Hi Kim,
I dont know where can be the problem... code that you have posted here its from Zehs FindTweenValue function. This prototypes requires AS2 easing equations.
msg16 { kim [+], posted: 01.29.04 6p•-, top [^] }
oh, oops... guess i posted that in the wrong spot. or i'm confused or something. :}
msg17 { kim [+], posted: 01.29.04 7p•-, top [^] }
doh, i used your extension, but included Zeh's file instead.

fixed that. Your code works great!!!

Thanks a ton!
msg18 { roy dallas [+], posted: 01.30.04 12p•-, top [^] }
how do i get the script to reset itself after each mc load?
i am loading the script as a mc in level1, it works the first time but not when the clip reloads.
the mc to be cotrolled by the mc.tween.bla.bla jus sits there.
thanks
msg19 { roy dallas [+], posted: 01.30.04 12p•-, top [^] }
how do i get the script to reset itself after each mc load?
i am loading the script as a mc in level1, it works the first time but not when the clip reloads.
the mc to be cotrolled by the mc.tween.bla.bla jus sits there.
thanks
msg20 { laco [+], posted: 02.02.04 1a•-, top [^] }
ok roy, there was a bug... instance of tweenManager was after loading another movie rewriten. I fixed that
msg21 { laco [+], posted: 02.04.04 3a•-, top [^] }
Hi all,
I plan to create editor for customizable easing , then i must pass list of control points to easing equation, but iam not sure which syntax would you preffer:
code for tweening x to 200 in 5 sec with custom easing :
-----------------
customEasing = {};
customEasing.points = [{_x:50,_y:325},{_x:116,_y:314},{_x:116.65,_y:258.3},{_x:179,_y:278},{_x:183.3,_y:191.65},{_x:233,_y:209},{_x:250,_y:125}];
customEasing.segs = [{Nx:132,Ny:-22,Px:-65.35,Py:-44.7},{Nx:124.7,Ny:39.4,Px:-58.05,Py:-106.05},{Nx:99.4,Ny:34.7,Px:-32.7,Py:-101.35}];
customEasing.ease = function(t,b,c,d) {.....}
------
1. // as object
my_mc.tween("_x",200,5, customEasing)
------
2. // or as extra arguments
my_mc.tween("_x",200,5, customEasing.ease, undefined,undefined,customEasing.points,customEasing.segs )

???
Any other better idea is highly appreciated



msg22 { roy dallas [+], posted: 02.04.04 8a•-, top [^] }
laco thanks for the response. i managed to get it working by loading the external files into mc instead of levels. (?) Any way thanks for this amazing timesaver, its quite amazing.
fyi here is a link to a site i am developing with your code in it.(still in development and will add you in site credits when it goes up)
http://www.dualpipe.com/test/index.htm
As far as the easing interface- now thats really cool!
For myself i prefer mc.tween ("type",duration,delay,......")
anyway thaks again
R
msg23 { tripletoe [+], posted: 02.12.04 9p•04.15.04 8a, top [^] }
Anyone seen this? I'm getting it during the compilation of my code. The tweening works, but I'm concerned about this error:

**Error** C:\Documents and Settings\Administrator\Local Settings\Application Data\Macromedia\Flash MX 2004\en\Configuration\Classes\mx\controls\ComboBox.as: Line 539: Type mismatch in assignment statement: found mx.effects.Tween where Function is required.
__dropdown.tween = new Tween(__dropdown, __dropdown._y, point.y-__dropdown.height, getStyle("openDuration"));
msg24 { laco [+], posted: 02.13.04 2a•-, top [^] }
looks like type error because in MovieClip.as is defined tween as function and component trying to assign reference to a instance of mx.Effects.Tween class
msg25 { tripletoe [+], posted: 02.13.04 8a•-, top [^] }
should I attempt to modify the combobox.as class? this is the one that come with flash mx 2004 so I'm kind of worried about that. has no one else has come across this but me?
msg26 { laco [+], posted: 02.13.04 8a•-, top [^] }
if you are not extending MovieClip in your project, so there must be enough only removing the line "function tween(.....)" in MovieClip.as
msg27 { tripletoe [+], posted: 02.13.04 2p•-, top [^] }
I'm not sure I understand: can you clarify this?
msg28 { laco [+], posted: 02.16.04 2a•-, top [^] }
tripletoe,
i have just tested this engine with all UI components and i dont see any errors in output... can you please PM link to your fla?
msg29 { tripletoe [+], posted: 02.16.04 8a•-, top [^] }
I completely uninstalled the extension and then I reinstalled it and the problem has disappeared. I was using the extension in a forms application under MX2004 and one of the problems may have been that I was not putting the include statement on the first frame in the timeline. Also, I may have initially installed an older version of the extension such as 1.0 instead of 1.1.1. I've found a couple of different versions of it out there and perhaps that caused me some problems. Anyway, it is now working just fine with no errors. Your work is very much appreciated!! :)
msg30 { laco [+], posted: 02.16.04 8a•-, top [^] }
:) iam happy that helps with your problem, sorry for the chaos in souces, i recommand all first to remove old version and install version 1.1.1
msg31 { laco [+], posted: 02.18.04 4a•02.18.04 4a, top [^] }
hi all,
version 1.1.2 released improved abbility of sequential tweens example: http://laco.wz.cz/mc_tween/tweenseq.html
msg32 { adiacov [+], posted: 02.18.04 6a•-, top [^] }
Hi Laco,

First of all, I wanted to say that I've been trying this and I think it's a wonderful and easy tool to use.
I was also trying to combine your tweening functions with a simple 3d class, developed and distributed by the owner of bit-101.com. With that class, I could manage to use your tween function, moving a MovieClip through the z-axis, which is quite nice.
So, right now what we can do is move a MovieClip through the space.
After trying it with a few examples, I thought about an improvement to the function. I'm telling you this because I don't feel myself able to do it, and maybe you find the right way to do it easy. The thing is that right now we can move objects from one x,y,z coordinate to another x,y,z, with a linear trajectory. Would it be possible to modify your tweening function in order to add a parameter that tells the trajectory of the object from one point to the other?

Thanks.
msg33 { laco [+], posted: 02.18.04 6a•02.18.04 6a, top [^] }
Hi Adiacov,

try this simple workaround:

#include "lmc_tween.as"
Object.prototype.tween = MovieClip.prototype.tween;
//
testobj = {};
testobj.x = 0;
testobj.y = 100;
testobj.z = 200;
//

testobj.tween(["x","y","z"],[100,200,300], 1,"linear");
_root.onEnterFrame = function() {
trace(testobj.x +"//"+ testobj.y +"//"+testobj.z );
};
msg34 { adiacov [+], posted: 02.18.04 9a•-, top [^] }
laco,

Thanks. It works just fine. For creating strange movements in space, I specify three different tween functions for the same object at the same time, one for each x, y and z properties, and each one with a different easing ecuation. It's great!!

Again, thanks for your excellent functions.
msg35 { are [+], posted: 02.18.04 3p•-, top [^] }
1.1.2 broken?

Moves to coordinates -- no tweens. Reinstalled 1.1.1 and we're back to tweens.
msg36 { laco [+], posted: 02.19.04 12a•-, top [^] }
Are,
have you installed it from mxp? can you please post here commands that dont works in 1.1.2 ?
msg37 { are [+], posted: 02.19.04 4a•-, top [^] }
laco,

first installed the mxp from MM exchange, v.1.1.1.
tested most commands in my script, tween, slideTo, scaleTo, alphaTo etc, worked FINE with thanks! visited this page and dl'ed 1.1.2 from your site, removed and installed new mxp.
tested same script; did not work.
thinking I had made a typo/syntaxt error somewhere, searched and backtracked by removing these classes. Back to just two, slideTo() and scaleTo(), it still did not work. made new simple doc with two mcs and one script. did not work.
removed and resinstalled old mxp, back to 1.1.1.
all work AAA again. flash mx 2004 pro/mac os 10.2.8.
msg38 { are [+], posted: 02.19.04 4a•-, top [^] }
laco,

I am not being much help here, but can I ask a quick question? How, exactly, do I implement Penner's tweening equations into your tween prototype so the animtype prop can be used?
msg39 { laco [+], posted: 02.19.04 4a•-, top [^] }
Are,
in old version 1.1.1 on MM site was bundled RP easing equations, now i have removed it. So to integrate Penners equation with this dowload :
for AS1 file 'easing_equations.as' and copy it to your fla folder or for use it in every project in directory:
MAC
HD:Users:[username]:Library:Application Support:Macromedia Flash MX 2004:[language]:Configuration:Include
WIN
C:\Documents and Settings\[username]\Local Settings\Application Data\Macromedia\Flash MX 2004\[language]\Configuration\Include

for AS2 directory 'com' to your fla folder or for use it in every project in directory:
MAC:
HD:Users:[username]:Library:Application Support:Macromedia Flash MX 2004:[language]:Configuration:Classes
WIN
C:\Documents and Settings\[username]\Local Settings\Application Data\Macromedia\Flash MX 2004\[language]\Configuration\Classes
msg40 { Lowspeed [+], posted: 02.23.04 8p•-, top [^] }
Hey man,

I upgraded to the latest rev of your awesome tweenmanager, but when I re-added the code you gave me:

public static function getAllTweens():Number {
return tweenList.length;
}

flash gacked and said "instance variables can not be accessed from static functions"

Any idea on how to achieve the same effect with your new code?

TIA man
msg41 { laco [+], posted: 02.24.04 12a•-, top [^] }
i was rewrite tweenManager to class whitout static methods, because after loadMovieNum it was reseting all running tweens:

public function getAllTweens():Number {
return tweenList.length;
}
msg42 { driverjase [+], posted: 02.24.04 7a•-, top [^] }
Just a quick question that I'm sure you've answered elsewhere, but I was curious if you were planning on rewriting lmc_tween.as in as2 format (classes, strict datatyping, no prototyping, etc). I see you also have an lmc_tween_as1.as as well, but lmc_tween.as still doesn't take full advantage of as2 scripting.
Thanks, and by the way great script!
msg43 { laco [+], posted: 02.26.04 2a•-, top [^] }
Driverjase,
iam not planing rewrite tweening prototypes to pure AS2 format, because there is great Robert Penner or Nigel Peggs Tween class and many others..., and this script is dedicated for people they will write tweens with one line of code.
msg44 { evil [+], posted: 03.01.04 1a•03.02.04 1a, top [^] }
hi,

Awesome work! Really love it. Saved me lotsa time.

I have a question: In my code whenever I start a tween ( slideTo to be specific ) I set a callback function and for every tween ( which is 1 per movieClip ) the callback is fired twice.

Any clues.

Thanks

evil
msg45 { laco [+], posted: 03.01.04 2a•-, top [^] }
hi evil,

you are right, callbacks are fired for slideTo 2 times, because slideTo is shorcut method and callback is fired for every property. Use following code for slide to

// this fires 2 times
mc.slideTo(50,100,1,"linear",0,callback)
// this fires callback 1 time
mc.tween("_x",50,1,"linear");
mc.slideTo("_y",100,1,"linear",0,callback);

I plan in next version eliminate this issue
msg46 { Lowspeed [+], posted: 03.01.04 5p•-, top [^] }
I removed the static from the function declaration, but now when I call it in flash, it throws an error: Function is not Static.

How do I call thid from within my code?

TIA
msg47 { laco [+], posted: 03.02.04 1a•03.02.04 1a, top [^] }
Lowspeed,
as i announced, tweenManager is now typic class without static method, instance of this class is named $tweenManager, call your method:
$tweenManager.getAllTweens();
msg48 { wired [+], posted: 03.04.04 12p•-, top [^] }
This is just amazing. I've learned more in the past hour reading through this than in the past year alone. Thank you.

How does one make use of the elastic and bounce functions? I can't seem to get them to work.

Thanks in advance.
msg49 { jpm04 [+], posted: 03.04.04 3p•-, top [^] }
I was very excited to find this resource and, despite spending hours trying, I can't seem to make yours (or Zeh's) extensions work. I'm sure it's something simple in the installation or application that I'm not doing correctly. Can someone please tell me what I'm doing wrong?

I'm running FMX2004 Pro 7.0.1 on Win XP.

I downloaded and installed laco's extension 1.1.2. File "lmc_tween.as" exists in the Include directory of C:\Documents and Settings\[username]\Local Settings\Application Data\Macromedia\Flash MX 2004\[language]\Configuration\Include\.

I then downloaded and extracted Penner's AS2 easing classes to the ...\Configuration\Classes directory, keeping the folder structure of [com\robertpenner\easing\*.*] intact.

I then started a new FLA with Publish settings of AS2 and Player 7. On the first frame of the main timeline I inserted:




I created a movieclip and just tried a simple tween by attaching this script to it:




I can't get anything to work. Please help......

msg50 { laco [+], posted: 03.05.04 1a•-, top [^] }
Wired,
if you will use elastic or bounce easing use one of following parameters:
"easeInElastic","easeOutElastic","easeInOutElastic",
"easeInBounce","easeOutBounce","easeInOutBounce
my_mc.tween('_x', 400, 2,'easeoutbounce')

jpm04,
iam wondering where can be problem... all installation steps that you have here described seems ok.
Try this example with all source codes
http://laco.wz.cz/mc_tween/example.zip
msg51 { jpm04 [+], posted: 03.05.04 12p•-, top [^] }
laco,

Don't know why it didn't work yesterday, but it's working today. I had even pulled a source file off your website to make sure the problem wasn't in my FLA, but your file wouldn't work also. Today, I unzipped your example file and it tested fine. Then I tested my file and it worked fine. I moved your example file to my desktop and deleted the class and manager files you sent to make sure that it was relying on the files I loaded into my Local Settings\...\Configuration directory -- all good. Not sure what was wrong -- I'm sure it was something stupid on my end -- but now I'm happy. Thank you, thank you, thank you.

jpm
msg52 { jpm04 [+], posted: 03.08.04 9a•-, top [^] }
laco,

Have you already posted the source files somewhere for your flying floorplan demo at http://www.fatorcaos.com.br/imagedisplay.php?i=data/l2demo_1.swf&pw=770&ph=400&bg=ffffff&f=s? If not, would it be possible for you to post it here? I'd love to see how the tweens interoperate with the 3d engine.

Jason
msg53 { beaver82 [+], posted: 03.09.04 2a•-, top [^] }
tnks for the beautiful script

is there a method to stop a color transformation?
i tried stopTween("_ct_") but it seems it don't works
msg54 { laco [+], posted: 03.09.04 3a•-, top [^] }
Jason, :-) the link that you posted here is work of Zeh Fernando, http://proto.layer51.com/d.aspx?f=804 :-)

beaver82, try only stopTween() it stops tweenings of all properties.
Sorry but there is no way to stop only colorTransformation, i try fix this issue in next version.
msg55 { wired [+], posted: 03.09.04 3p•-, top [^] }
Laco-

thanks for writing back to me. unfortunately, it still doesn't work. isn't there supposed to be an amplitude variable to account for the bounce back element?

>Wired,
if you will use elastic or bounce easing use one of following parameters:
"easeInElastic","easeOutElastic","easeInOutElastic",
"easeInBounce","easeOutBounce","easeInOutBounce
my_mc.tween('_x', 400, 2,'easeoutbounce')

When I use this example it slowly creeps across the screen a la easeout mode. Any suggestions?

Thanks!
msg56 { zeh [+], posted: 03.09.04 5p•-, top [^] }
jason, here it is --

http://www.fatorcaos.com.br/downloads/l2_demo.zip

It's a bit weird though... it's an adaptation of an old 3d engine I had coded on Quick Basic4.5 (!) so it's a bit rough.

The buttons tween the camera position variables and the engine does the rest.
msg57 { evil [+], posted: 03.10.04 4a•-, top [^] }
Hi,

I dunno if anybody else has faced this problem but after installing the extension masking of text does not work. I thought it was a depth thing but that isn't it.

Could you please look into it. And its definetely the extension cause afeter uninstalling it everything works fine.

Thanks

evil
msg58 { laco [+], posted: 03.10.04 4a•03.10.04 4a, top [^] }
wired,
looks that you have not installed Robert Penners easing equations, download new extension with bundled RP easing equations
evil,
send me please *.fla iam not having problems with masking

Here is beta version of Movieclip Tweeninig prototypes 1.1.3 without as1 version:
http://laco.wz.cz/mc_tween/MovieClipTween1_1_3.mxp

Changes:
Callbacks
i have completly reworked internal mechanism for callback executing
in previous versions was callback called for every property e.g.:

function onEnd(){
trace("function onEnd()")
}
my_mc.slideTo(500,500,1,"easeoutcubic",0,onEnd)
is the same as:
my_mc.tween(['_x','_y'],[500,500],1,"easeoutcubic",0,onEnd)
//
OUTPUT:
function onEnd()
function onEnd()
In 1.1.3 is onEnd fired only 1 time

You can now pass too string as callback:
my_mc.tween(['_x','_y'],[500,500],1,"easeoutcubic",0,'trace("callback called")')
as internal parsing mechanism is used this proto:
http://proto.layer51.com/d.aspx?f=1207

there are 2 additional parameters for callback object:
updfunc: function witch is called on every tween update, as 1 parameter is passed reference to tweening movieclip
updscope: scope(this) of update function
//
function tweenUpdate_func(mc){
trace(mc._x +" this:"+this);
}
my_mc.tween('_x', 200,5,'easeoutcirc',0,{updfunc:tweenUpdate_func, updscope:this})

Delayed tweens
in 112 was not possible to stop tween with delay
getTweens() now returns only count of tweens that are currently running

added brightnessTo method
my_mc.brightnessTo(100); // to white
my_mc.brightnessTo(-100); // to black
parameter can be from -100 to 100
//
colorTransform tweens (colorTo, brightnessTo) can be stoped, pass "_ct_" as parameter:
my_mc.tween('_x',500);
my_mc.colorTo(0xFF0000);
my_mc.stopTween("_ct_");

Bundled RP easing equations

msg59 { evil [+], posted: 03.10.04 5a•-, top [^] }
Hi,

It seems like an isolated case because the same flas works fine on a system without the extension installed. And the problem is eliminated only after reinstallation of Flash MX 2004 Pro.

I have also noticed that this happened only after the RP as files are installed. Your extension alone does not cause this.

PS: The fla is pretty simple wiht layer1 only one dynamic text and its mask nothing more even the lmc_tween.as is not included. But the big thing is that at times removing the extension does work.

Sorry if this has nothing to do with your extension.

evil
msg60 { laco [+], posted: 03.10.04 6a•-, top [^] }
evil,
here is described problem with masking device fonts http://livedocs.macromedia.com/flash/mx2004/main/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004_Documentation&file=06_type5.htm
Use setMask method instead of masking layers
msg61 { evil [+], posted: 03.10.04 6a•03.12.04 1a, top [^] }
Hi,

You are so the man!!!
You just saved my life and the trouble of using ( or attempting to ) some lame ass prototype.

You rock man!!

evil.
msg62 { wired [+], posted: 03.10.04 11a•-, top [^] }
Thanks for trying to help me. i went and downloaded the penner equations and put them into a file that is referenced by "lmc_tween_as1.as". However, now nothing works at all.

Which as file should I be referencing? the one on mentioned above or the "mc_tween2.as"? I'm so sorry to be clogging the boards with my inexperience here. I just really want to learn how to get this working.

Also, does one simply paste the code generated by the custom easing too in an event handler?

Thanks in advance. .

-wired
msg63 { paulmayne [+], posted: 03.10.04 1p•07.21.04 10p, top [^] }
Laco,
Have you noticed the issue of inturrupting a tween in progress? When you do this it finishes tweening to the new position, then when complete it jumps back to the last position.

I have created an example file, viewed here:
http://www.forml.com/etween.html

(Click on the buttons 1, 2, then 3 in order, and fast enough to interrupt the current tween position. Notice it jumps back to the #2 position after tweening #3.)

Download the FLA here:
http://www.forml.com/etween.fla

Take a look see. Thanks ya, Paul
msg64 { beaver82 [+], posted: 03.10.04 5p•-, top [^] }
hello paulmayne
it's because u don't used stopTween function
in fact if u press the button 3 in your example after the tween on the button 2 fully finished it works
msg65 { laco [+], posted: 03.11.04 1a•-, top [^] }
evil, ;-)
Wired,
download the lastest version of this extension(link above) there are bundled easing equations.
use:
#include "lmc_tween.as" //for projects with actionscript 2
or
#include "lmc_tween_as1.as" //for projects with actionscript 1
and then use added methods on your movieclip
Pasting Custom easing code to event handler is not good practice, (but i try fix this issue)
//
Paul,
as beaver82 mentioned, use stopTween() before calling tween() method
goal of this engine is create too sequential tweens, adding automatic stoping of running tween would eliminate this feature
msg66 { paulmayne [+], posted: 03.11.04 7a•-, top [^] }
Fantastic! Thanks!
msg67 { dschnell [+], posted: 03.11.04 4p•-, top [^] }
Laco,
Thanks for Excellent proto!
I am trying to simulate a vehicle driving on the road from the perspective of 1st person.
I would like to use your ::prototype:: to animate the lines in the road coming toward the drive.
I was think of using the following:





I tried this also:




But I noticed that the callback is getting called twice.
Am I doing something wrong?

I am using version 1.1.3

Thanks
Don
msg68 { laco [+], posted: 03.12.04 12a•-, top [^] }
Don,
i have tested your code and for me is callback executed 1 time; maybe is in directory with your fla older version or try reinstall the extension. (the code that is on top of page is still version 1.1.2)
msg69 { beaver82 [+], posted: 03.12.04 2a•-, top [^] }
hi laco
many times when i do the tween of a _parent movieclip it was difficult to do a callback in that movieclip

for example if i use
this._parent.tween("_rotation", 0, 1, "easeOutQuad", 0, function () {
trace(this);
});
"this" goes to the _parent of the tweened mc, and i don't know the path of that movieclip is bad:(

it should be better to reference "this" in the callback to the movieclip tweened.. no?

tnks so much and bye
msg70 { laco [+], posted: 03.12.04 3a•-, top [^] }
beaver,
if you dont implicit define scope of callback function, scope is _parent of tweended movieclip

in your case is scope of function this._parent._parent
define scope of callback:
this._parent.tween("_rotation", 0, 1, "easeOutQuad", 0, {scope:this, func: function () {
trace(this);
}});
msg71 { dschnell [+], posted: 03.12.04 12p•04.03.04 5p, top [^] }
Thanks Laco,
The problem disappeared when I tried it again today.

I have another question though...
I have the following code which seems to work very well until I try to change my time (vehSpeed) variable on the fly. The mc will momentarily stop and then since there two mc tweening, one will sometimes pass the other.
Is there a method to dynamically change the velocity instead of altering the time?



msg72 { sand858 [+], posted: 03.13.04 2a•-, top [^] }
laco,

Great work. Some questions though...

1) I downloaded version 1.1.3 thinking I could use the stopTween("_ct"), but it seems to do nothing. Is there a way to revert back to the original MC, or is it blasted once I call mc.colorTo(etc..)

2) In version 1.1.3, I can't get the colorTo to work if I specify a delay... It worked fine in 1.1.2 though. Perhaps a bad installation?

Thanks for your input.

msg73 { laco [+], posted: 03.15.04 1a•03.15.04 4a, top [^] }
dschnell, sorry man this really not possible, i have no idea how to solve your problem.
sand858,
// colorTo with delay
my_mc.colorTo(0xFF0000, 2, 'linear', 2);
_root.onMouseDown = function() {
//stop tweening to red
my_mc.stopTween("_ct_");
//reset transform to normal
my_mc.colorTransformTo(100,0,100,0,100,0,100,0,1)
};
// after 2 secs, click mouse
--------
This thread describes problems with as2 in MX04
[url]http://chattyfig.figleaf.com/ezmlm/ezmlm-cgi?1:mss:92473:200310:fbfajjdnkaiifgokifmp[/url]
So basically this means that Flash 2004 has a bug and that it may be wise to clean out the ASO folder on occasion.
C:\Documents and Settings\<username>\Local Settings\Application Data\Macromedia\Flash MX 2004\en\Configuration\Classes\aso
msg74 { hotglu [+], posted: 03.17.04 6p•03.26.04 6p, top [^] }
laco-

I downloaded your tweening extension from macromedia. It appears I need to include the file: "lmc_tween_as1.as" to make this class work but the file was not part of the download. Where can I find this? Thank You.
msg75 { laco [+], posted: 03.18.04 4a•03.18.04 4a, top [^] }
Hotglu, here are sources of 1.1.1 for AS1 http://laco.wz.cz/mc_tween/test11as1.zip

Movieclip Tweening prototypes 1.1.4

*fixed bug with colorTransformTo
*added methods
lockTween()
unlockTween()
isTweenLocked()
*added other callback properties
startfunc - reference to function to be called on start of tween
startscope - scope of start function (this object)
startargs - array of arguments passed to start function
this impovement allows creating tween groups to save CPU usage:
example
msg76 { jhiner1978 [+], posted: 03.18.04 12p•-, top [^] }
why am I getting this error

**Error** Springfield:Users:admin:Desktop:___ME___:Revolution:flash:lmc_tween.as: Line 277: Classes may only be defined in external ActionScript 2.0 class scripts.
class zigo.tweenManager{
msg77 { laco [+], posted: 03.19.04 1a•-, top [^] }
You have copy and pasted too zigo.tweenManager class to file "lmc_tween.as" , class must be in extra file zigo/tweenManager.as.
Easier would be download Macromedia Extension Manager 1.6
http://www.macromedia.com/exchange/em_download/
and install the extension
msg78 { beaver82 [+], posted: 03.19.04 3p•-, top [^] }
hi, this is another possible bug
stoptween don't works if you set a delay >0
msg79 { Custa [+], posted: 03.21.04 9a•-, top [^] }
I am having some problems with this class in that when I roll over the text on my buttons sometimes it will reset parts of the button (which it shouldn't) but not others parts of it (correct).

The site is @ http://www.qrl.com.au

If anybody would like to take a look at the code please let me know. The only thing I could think of is that the text layer is above the layer that is triggering the tweens and somehow the text layer interferes with the layer activating the tweens.

Must say the AS for this is great, a rreal pleasure to work with due to it's simplicity. Once again if anybody wants to check the code to figure out what is going on just drop me a line.
msg80 { laco [+], posted: 03.23.04 3a•03.23.04 3a, top [^] }
Beaver you are right, stopTween() on delayed tweens works only without parameters (it stops all tweenings for movieclip), if you need this feature you can use version 1.0 which uses old mechanism (without setInterval) to create delayed tweens
Custa
try use stopTween() before calling the tween methods or use only 1 mc on top of the mc with _alpha=0 to trigger the booth tweens.
msg81 { Avengio [+], posted: 03.24.04 4p•-, top [^] }
Hi Laco

Great work. I'm building an application that uses your tween to scale a mc's x and y propeties. This happens on the rollover event. There are about 50 objects on the root timeline that need this functionality. The problem is that on rollover the CPU usage goes through the roof and cause a delay in the animation. Is there any way around this? Thanks for time. Keep up the great work. -b

msg82 { laco [+], posted: 03.25.04 2a•-, top [^] }
Tweening 50 objects at same time is too much, you must reorganize your fla, group objects they doing the same movement in movieclip and call tween method on it.
msg83 { Avengio [+], posted: 03.25.04 7a•-, top [^] }
Hi Laco
Thanks for the response. I think there is a misunderstanding. I am not tweening all 50 objects at once. I only need one object at a time. As the mouse rolls over the object it will scale to indicate it is selected, as the mouse rolls off the object it returns to 100% and the next object will scale, etc. At any given time perhaps two to five objects would be scaling. I may have to try an alternate way of selecting the objects. Thanks Laco. -b
msg84 { are [+], posted: 03.31.04 4a•-, top [^] }
Reporting following behavior:
Worked with 1.1.1 for months without problems.
All installs below from mxp via manager
Uninstalled 1.1.1
Installed 1.1.4
Tweening actions did not work
Uninstalled 1.1.4
Installed 1.1.1
Tweening actions did not work
And so on.
Currently on 1.1.4. The actions will work upon compilation of fla but when another swf or mc is loaded into a mc, for example, they cease to work.
Threw away .aso file for mc to no avail.
Will keep trying.
Pointers on why this is happening appreciated.
msg85 { laco [+], posted: 03.31.04 4a•03.31.04 5a, top [^] }
Are,
hard to say, where can be the problem, maybe you have older version in the same directory with the fla, because the bug with loadMovie and loadMovieNum was fixed in version 1.1
try install again 1.1.4 and use trace($tweenManager) if you see in output "[AS2 tweenManager 1.1.4]" the latest version is installed, else older versions outputs "[Object object]"


msg86 { are [+], posted: 03.31.04 5a•-, top [^] }
[AS2 tweenManager 1.1.4] it is, indeed.
Reinstalled flash mx 2004 pro from installer, also.
1.1.1 does not work at all.
1.1.4 works at first but not after an action is performed.
This is VERY bad news as I have hundreds of lines of code on this project that intermittently use this class, compiled fine with 1.1.1.
What's the breakdown of files installed by the mxp?
msg87 { are [+], posted: 03.31.04 5a•-, top [^] }
Cold sweat partly wiped,

It was a duh! Loaded old 1.1.1 compiled SWF files into the interface compiled with new 1.1.4. Obviously, the old 1.1.1 include was not too friendly with the new 1.1.4. I am seeing some new glitches, though, especially a rotateTo that now drops upon working loads into the interface. (Can't honestly see why, as the API code is the same?) Moral of the story: if it works, leave it alone.
msg88 { laco [+], posted: 03.31.04 5a•-, top [^] }
Are,
i have just found another problematic code: if you have not specified duration of tween it was used 0 (in previous versions it was 2) here it is fixed
msg89 { are [+], posted: 03.31.04 5a•-, top [^] }
laco,

just went through and updated everything in this flp. it all works as before now. must have been that some leftover older elements created hitches earlier. the tweens, if anything, appear even smoother than before, but maybe that's just me happy to see it all working again ;-)

perhaps this mild panic attack will help someone else with an equally forgetful scatterbrain?

just to mention it once more; thanks for the amazing work on this. from a design point of view, and not with a view to tween EVERYTHING, probably the most useful piece of actionscript out there.

msg90 { laco [+], posted: 03.31.04 6a•04.01.04 12a, top [^] }
;-) yes it is bit smoother, in 1.1.1 was default animation type mx.transition.easing.Strong.easeOut, now it is com.robertpenner.easing.expo.easeOut

just for all they getting problems when you upgrade from 1.1.1 to 1.1.4, i have make changes in internal structure of tweenManager class, if you will use new version, you must recompile all swf with it.
msg91 { lcsdesign [+], posted: 04.01.04 1a•-, top [^] }
hmmm I'm very sorry if this question might seem a lame one..actually it is..
I'm so excited with your tweening set that I'm trying to use them even if I'm not a skilled programmer.

I was trying to "slideTo" a mc (i.e. let it arrive in the middle of the stage) and then use the callback function calling another slideTo to let it go away. But at the moment it seems that the second slideTo uses the original xy coordinates of the movieclip and not the "updated" ones. Any way to setup the callback using mc xy values taken at the moment of calling the function?
thanks!
lorenzo.
msg92 { laco [+], posted: 04.01.04 1a•-, top [^] }
You can use folowing scripts to achieve the effect, booth do the same:
// callback
my_mc.slideTo(500, 400, 2, "linear", 0, function () {
my_mc.slideTo(0, 0, 2, "linear");
});
// sequential tween
my_mc.slideTo(500, 400, 2, "linear", 0)
my_mc.slideTo(0, 0, 2, "linear", 2)
msg93 { lcsdesign [+], posted: 04.01.04 2a•-, top [^] }
Hmmmmmm.. I've had already tried it.. and it did not work... now it works 8-)
Do you think I need some sleep? So sorry... I should have checked twice :) thanks for your patience!!


msg94 { mummla [+], posted: 04.02.04 1p•-, top [^] }
Hi,

As others already have pointed out, this is an excellent and extremely useful component.
However, i do have a problem using the "Amplitude" extra variable in a simple tween() call.
It seems logical to me that giving the amplitude a value of 0 would result in no amplitude, (and also no elastic effect) and increasing the amplitude from there would slowly add elasticity to the tween.

However, i cannot reduce the amplitude or elasticity effect to anything less than it is using no extra amplitude value. I can increase the amplitude using very large values (a value of for example 1000 gives me a hardly noticeable change). Am i doing something wrong?

code sample:





Thanks,

Nick
msg95 { ksmaert [+], posted: 04.03.04 7a•-, top [^] }
as everybody else here i love the code you have written..it's suddenly such a delight making animations, but i seem to have run into a problem with the scaleTo..it works fine like this:

myclip.scaleTo(110, 5);

but i'm not able to use a variable like this:

myclip.scaleTo(110, amp);

i'm neither able to use a variable as the delay parameter like this:

myclip.scaleTo(110, 5, "linear", amp);

i tried making adjustments to the "lmc_tween.as", but i couldn't make it work. hope there is a quick fix to my problem.

i'm using version 1.1.4 with flash mx professional

msg96 { laco [+], posted: 04.05.04 4a•-, top [^] }
mummla,
i have tested your code with other tween engines and too with RP easing equations and the effect is the same for all.

ksmaert,
for me works, try this code:
trace("amp: "+amp+", is type of: "+typeof (amp));
and check the output window, maybe is amp of wrong type or value is too low(<0.01)
msg97 { mummla [+], posted: 04.07.04 10a•-, top [^] }
Hi again,

Yes, i was afraid that was the case, the same concept really applies to any easing tween, where there is no way to control how much the easing will be "in" or "out". I do think this is a major weakness though, kind of like having an alpha slider where you only would be able to set the value between 40 and 60.. Still, no doubt that this is fantastic work!
msg98 { jmrhoades [+], posted: 04.08.04 5p•04.08.04 6p, top [^] }
Help! I'm loading an external swf into a main swf and both swfs have:
#include "lmc_tween.as" on their root timelines.

Whenever I tween a clip in the loaded swf, it permanently kills all the tweens for the main swf. I'm using version 1.1.4

If I take out the "lmc_tween.as" on the loaded clips, I can't tween them.

Am I completely screwed?

Thanks in advance.
-justin

UPDATE:
I just changed my publish settings from Player 6 to Player 7 and all is well. Is there any way to get this to work for Player 6?
msg99 { jmrhoades [+], posted: 04.09.04 9a•04.09.04 9a, top [^] }
Sorry to be a pest. is anyone else having troubles with colorTransformTo?

clip_mc.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, .4, "easeOutQuad");

works fine except the duration is extemely long no matter what value I give it. Any suggestions?

i'm using version 1.1.4a
msg100 { Aletheia [+], posted: 04.09.04 12p•-, top [^] }
thanks for the wonderful prototype,
but I'm having trouble with time values too. It seems most tweens take to long to get a speed. I'm limited to a very small time range values between 2 and 0.5.
I've decided to use linear tween until I find a solution.
msg101 { jmrhoades [+], posted: 04.09.04 12p•-, top [^] }
thanks for the tip Aletheia, no dice though.

interestingly, you can do something like this:
clip_mc.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, 12, "linear");

and it will take the same amount of time to complete as this:

lip_mc.colorTransformTo(100, 0, 100, 0, 100, 0, 100, 0, .1, "linear");

anyone out there know a solution?


msg102 { Aletheia [+], posted: 04.10.04 5a•04.10.04 6a, top [^] }
Has anyone used the scrollTo method? Could you post an example?
I'm trying this, but I see no easing and to my eye it looks it takes the same time to go up if I put 20 or 1 seconds. How should I use it?

//there is a dynamic textfield on stage named mytext. I set scroll to 30 to start and then on //frame 10 (or whatever) I call the function setText. I see the lines move up, but no easing.

mytext.text="1\n2\n3\n4\n5\n6\n7\n8\n"
+"9\n10\n11\n12\n13\n14\n15\n16\n"
+"17\n18\n19\n20\n21\n22\n23\n24\n"
+"25\n26\n27\n28\n29\nfbljalfjljdfl\nfbljalfjljdfl\nfbljalfjljdfl\n"

mytext.scroll=30

setText =function(){
mytext.scrollTo("maxscroll",15, "easeinquart")
}

//Thanks!!
msg103 { jmrhoades [+], posted: 04.12.04 3p•-, top [^] }
hey laco,

any love on the colorTransformTo issue?
msg104 { laco [+], posted: 04.13.04 3a•04.13.04 8a, top [^] }
jmrhoades, sorry for later answer, there was bug in prototype function... i corrected it.
Aletheia, scrollTo is not yet implemented... it is only in original Zeh prototype
Mummla, i have again played with parameters in elastic easing
amplitude(extra1) dependents on change parameter, if is is lower then change parameter(end value - start value) its value is set to change
period(extra2) dependents on duration parameter

Movieclip Tweening prototypes 1.1.5
fixed bug with colorTransformTo
fixed bug with stopTween on delayed movieclips
added public properties for more options:
$tweenManager.autoStop - boolean, default to false, determines if running tweens may be automatically stoped . This property is useful when you dont like to write stopTween() before tween() method call, stopTween(properties) is called automatically
$tweenManager.broadcastEvents - boolean, default to false, determines if tweening MovieClip may broadcast events (based on AsBroadcaster), useful for 1 - n relations

customEasingTool version 1.1
- added ability to create easing effects whitout line of code + example video included
- saving and loading your presets

msg105 { jmrhoades [+], posted: 04.13.04 7a•-, top [^] }
How's that for a response? Holy smokes, just when you thought this tweening class couldn't get any better, Laco updates! Thanks a million! Long live Laco!
msg106 { King of punk [+], posted: 04.13.04 6p•-, top [^] }
Laco save my life !
msg107 { jahmnawoo [+], posted: 04.15.04 5a•-, top [^] }
hey laco, thx for all the amazing work. im encountering a strange behaviour and i was wondering if you could help out. im using 1.1.5 and i have this movieclip ['test'] on stage that is linked to the AS class Test.as :



so when i put the mouse over [test] it tweens, when i take the mouse off [test] it tweens back to its original size, but now when i put the mouse back over [test] [the second time], [test] tweens to 200% but when the tween finishes [test] "jumps" back to 100% ????
msg108 { laco [+], posted: 04.15.04 5a•-, top [^] }
jahmnawoo,
you must use in function onRollOver stopTween() before calling the tween method:

function onRollOver () {
trace("over");
this.stopTween("_xscale")
this.tween ("_xscale", 200, 0.5, "easeoutback");
}

or you can turn on automatic stoping of tweens (if you dont like sequentials tweens) after include:

#include "lmc_tween.as"
$tweenManager.autoStop = true;


msg109 { jahmnawoo [+], posted: 04.15.04 6a•-, top [^] }
laco youre the best :). it solves the problem. still i was wondering though maybe you can explain further why stopTween() is needed ? if i write something like



shouldnt the second tween override the first one ? i notice that what happens is that [test] goes down for 1 sec, then back up for 0.5 secs, then jumps back down to the point it was at the 1st tween and continues that one ?
msg110 { laco [+], posted: 04.15.04 8a•04.15.04 8a, top [^] }
jahmnawoo,
no the first would not be overwriten, they is still run, this behavior is usefull in sequential types of tweens, you can do eg this without callbacks:
http://laco.wz.cz/mc_tween/tweenseq.html

Movieclip Tweening prototypes 1.1.5 update
as i found i have uploaded wrong file with bug in colorTransformTo... download it again
msg111 { jahmnawoo [+], posted: 04.15.04 8a•-, top [^] }
oy again :). yeah ok i get it that since 2 tweens might be running at the same time you cant override the first one [since the second one might be in delay and so the first once must keep running till then]. but in the example ive given tween1 starts for 2sec, but after 1sec tween2 starts for 0.5sec. that means that 1.5sec the tweenmanager will go back to tween1. what im trying to say is that onStartTween2 should stop tween1 automatically at any case. shouldnt it? and then there wont be any need for differentiating stopTween() and $tweenManager.autoStop ?
ok really sorry for bothering you on this point. its just a thought :)
your work is incredible thx J
msg112 { laco [+], posted: 04.15.04 9a•-, top [^] }
no :), that is a good idea, and it is the main difference between my and zehs proto (i was found it when this extension was in version 1.1)
msg113 { Aletheia [+], posted: 04.16.04 7a•-, top [^] }
Hi Laco,
I'm using your tween prototype 1.1.5 for AS1. I don't know if I'm finding the colorTransformTo bug, but my colorTo tweens sometimes show what seems to be an intermediate color. In this specific case I'm using colorTo tween on rollover and rollout functions for buttons; changing grey to yellow shows pink sometimes. Could it be showing this if the tween hasn't finished before I rollout? In any case, I was wondering if you changed anything recently to the AS1 version as I've read you have on this AS2 version.

On the other hand I need to stop colorTo tween somehow for the buttons. I can stop normal tweens, but how do you stop colorTo?
At the moment I'm using the clearRGB() as a fix for the problem of not being able to stop the tween. I clear the color on the rollout.

Thanks a million, and great work!
msg114 { laco [+], posted: 04.16.04 8a•-, top [^] }
HI,
I am now unsure if colorTo works correctly (i have make some changes and i have not much time to completly test it)
use my_mc.stopTween("_ct_") for stoping colorTransform tween
msg115 { jahmnawoo [+], posted: 04.18.04 5a•-, top [^] }
hi Laco. im back :)



ive been trying this [which is from your doc on 1.1.5] and i get this "There is no method with the name 'addListener'" compiler error. i guess that is coz addListener isnt in MovieClip.as but im not definitely sure. just wondering about your thoughts on this. i understand you are super busy, so take it easy and thx ... :)
msg116 { laco [+], posted: 04.19.04 3a•04.19.04 3a, top [^] }
:) thanks for finding that
i have make too tweenManager class with automatic overwriting of collapsing tweens:
http://laco.wz.cz/mc_tween/autoover.zip , can you please check it ;-)?
msg117 { jahmnawoo [+], posted: 04.19.04 9a•04.19.04 9a, top [^] }
BRILLIANT !! :) laco as far as my testing goes the issues in msgs 107/109/111 have been completely solved and ive officially switched to using this new update :). thx a million.
a couple of comments if i may, and a question :
1) i cant remember if someone already mentioned is incase you have a mc with a dynamic textfield inside, tweening the mcs' _alpha doesnt tween the textfield ??
2) when a collapsed tween is overridden the callback "func" doesnt trigger. i realize its a matter of taste whether it should or should not.
and the question, what happens now with a tween if autoStop is false. does it just keep working ? i mean should i use autoStop or stopTween to delete it ?
take care and again thx so much for your amazing effort ...
msg118 { Boppyer [+], posted: 04.21.04 9a•04.21.04 9a, top [^] }
Hi all,
Nice work Laco, just one question though concerning the use of the 'easing function Generator' this works fine when using it at root, but when trying to call the custom easing from within a movieclip it doesn't like it? it animated to the correct posistion but doesn't use the new custom tween? sorry if i am missing something very obvious. If i use the same code but use a pre-installed tween like "easeOutBounce" it works fine, but if i call 'customBounce' it won't work? thanks in advance

kind regards

Boppyer;-)
msg119 { laco [+], posted: 04.22.04 1a•-, top [^] }
jahmnawoo,
1. with device fonts you cant tween _alpha of textfield (this is known limitation of flash player) use embed fonts
2. yes the callback function is not trigger, because the tween is not finished
3. autoStop property is still there (it stops all running and delayed tweens of property) it is default to false. I was added autoOverwrite property - it is default to true.

Boppyer,
you must use correct reference to customEasing object, if you are in another movieclip and custom easing object is in root timeline, use e.g. my_mc.tween("_x",100,1,_root.customEasing). Or make easing object as global: _global.customEasing; ...

msg120 { Boppyer [+], posted: 04.22.04 4a•-, top [^] }
many thanks for you reply:-)
sorry for the lame question, thanks for all your work, it's brillaint
msg121 { jahmnawoo [+], posted: 04.25.04 3a•-, top [^] }
ok laco thx so much for your reply and adding autoOverwrite, im so happy with that feature. what i was wondering was what happens to tweens when they finish, autoStop=false and i dont call stopTween on them. do they keep running ?
i have another feature in mind but i think i better leave you alone for now :)
thx jahmna
msg122 { laco [+], posted: 04.26.04 2a•-, top [^] }
Jahmanwoo,
tweens they finish and was not aborted with stopTween() are tweening to end value and callback is executed and they are removed from array tweenList. Overwrite feature is added at start of method addTween() it loops through tweenlist array and when it finds tween with same movieclip and property it overwrites its properties (starttime, duration, callback, easing function,e1,e2) else it add new tween in tweenList array.
(Dont hesitate and tell me about that feature ;-))
msg123 { jason7655 [+], posted: 04.28.04 6a•-, top [^] }
Hello,
Just found this wonderful tool.

I'm no expert with this, so I have a question. Say I wanted to do everything with actionscript.

I create a box and give it an instance of boot_mc.
I put the following actionscript on there.
#include "lmc_tween.as"
boot_mc.tween('_x', 20,0.5,'easeoutcirc',0.5)
boot_mc.tween('_width', 760,1,'easeoutelastic',1);
boot_mc.tween('_height', 560,1,'easeoutelastic',2);
boot_mc.colorTo(0x669933,1,'easeinexpo',3);

Now it's drawn a box. Great. Just what I want.

But here's my deal. I want to know how to wait until it's loaded completely before doing something else...like loading a movieClip into the box I just created.

I saw the tween has ended thing, but I played around with it with no luck.

Hope someone can help.

Jason
msg124 { theranch [+], posted: 04.29.04 7a•-, top [^] }
Hey...
Great work on the script...I have been using this stuff since you first came out with it and I love it.
Are you planning on adding any kind of skew property to this? Or can you? ie skewTo?
Thanks,
theranch
msg125 { theranch [+], posted: 04.29.04 7a•-, top [^] }
Jason,
You can do the following..
<code>
#include "lmc_tween.as"
boot_mc.tween('_x', 20,0.5,'easeoutcirc',0.5)
boot_mc.tween('_width', 760,1,'easeoutelastic',1);
boot_mc.tween('_height', 560,1,'easeoutelastic',2);
boot_mc.colorTo(0x669933,1,'easeinexpo',3,function(){loadMovie(newmc,boot_mc.holderClip);});
</code>
I would put an empty holder movieclip inside of your boot_mc to load the other mc
into the boot_mc
Hope that helps.
theranch
msg126 { jason7655 [+], posted: 04.29.04 12p•04.29.04 12p, top [^] }
Thanks for the answer.
In your code you created a new movieclip called newmc. This is my problem, and I can't seem to get it to work with your answer.
Once the transition is done, and the color has changed. I would like it to load a swf, movie clip, image, whatever....into the boot_mc.

With your answer, I'm not sure if I do it all in actionscript or if I need to place something the stage.

I understand creating an empty movie clip in boot_mc and then loading something into that. I've done that before, just not using this code (primarily through actionscript.)

newmc and holderClip....I take it newmc is whatever I'm wanting to load. I'm taking that holderClip is the placeholder for it, but it's just not working.

EDITED: I just tried this...and you can actually see something happening. The boot_mc changes sizes but the photo doesn't display in it. This might help you see what I'm thinking.
#include "lmc_tween.as"
boot_mc.tween('_x', 20,0.5,'easeoutcirc',0.5)
boot_mc.tween('_width', 760,1,'easeoutelastic',1);
boot_mc.tween('_height', 560,1,'easeoutelastic',2);
boot_mc.colorTo(0x669933,1,'easeinexpo',3,
function(){
boot_mc.createEmptyMovieClip("newmc", 10);
boot_mc.newmc.loadMovie("grass.jpg");});

Thanks
Jason
msg127 { theranch [+], posted: 04.29.04 4p•-, top [^] }
Jason: newmc and holderClip....I take it newmc is whatever I'm wanting to load. I'm taking that holderClip is the placeholder for it, but it's just not working.

That's it exactly.
theranch
msg128 { jason7655 [+], posted: 04.29.04 7p•-, top [^] }
Ok,
But what I was saying is that it didn't work. For some reason, it's not loading it into the boot_mc where you can see it.

Here's what I'm trying to do, and once I get this concept down I'll be good to go.
I want the mc to do a tween. Once it has completed, you now have a square or whatever.
I want to load an image, swf, or whatever into that boot_mc and it be viewable.

Thanks
Jason
msg129 { GMac [+], posted: 04.29.04 7p•-, top [^] }
Sorry, but I seem to have mucked somthing up. I've uninstalled previous version (using extension manager) and have re-installed 1.1.5.

I however, keep getting:

**Error** C:\Documents and Settings\[username]\Local Settings\Application Data\Macromedia\Flash MX 2004\en\Configuration\Classes\mx\transitions\easing\Back.as: Line 1: The class 'com.robertpenner.easing.Back' needs to be defined in a file whose relative path is 'com\robertpenner\easing\Back.as'.
class com.robertpenner.easing.Back {

**Warning** Scene=Scene 1, layer=Layer 1, frame=1:Line 21: There is no class or package with the name 'mx.transitions.easing.Back' found in package 'mx.transitions.easing'.

Total ActionScript Errors: 2 Reported Errors: 2

please let me know how to correct this. Everything else seems to be working ok, and I'm LOVING this. Cheers !
msg130 { theranch [+], posted: 04.29.04 8p•05.01.04 12p, top [^] }
Jason.. email me and I'll send you the files.
theranch
msg131 { slide [+], posted: 05.01.04 9a•-, top [^] }
First off i would just like to say excellent work, this has saved me ALOT of time as im a newbie :). Ok, I was wondering if you could possibly supply some more examples of the {updfunc:tweenUpdate_func, updscopethis} as I said im new to this and flash somewhat.

Thanks :)
msg132 { vectrex [+], posted: 05.01.04 11a•-, top [^] }
aeiii! how do you unregister from receiving comment emails? I get more tween comments than I do spam ;)
msg133 { jahmnawoo [+], posted: 05.02.04 3a•-, top [^] }
hey laco. again ... thx for your reply :)
as for the feature, i am busy now trying to handle tweening of groups of MCs of which a random element is involved, so i find it difficult to exactly capture the end of tween of the whole group. there is a very good idea by RAMPAGE here, dealing with group tweening, so i still need to investigate that. right now im very busy on other stuff as well so i dont have enough time to really "sit" on this one. i will let you know how i progress [when i progress :)]. keep up the great work
msg134 { lelales [+], posted: 05.02.04 8a•-, top [^] }
what's the difference between this code and lmc_tween.as?
msg135 { laco [+], posted: 05.03.04 4a•-, top [^] }
theranch, (thanks for helping jason) , i have playing with skew method, but it is really problematic to add it there it works on rotation and scaling nested movieclips
Here is the example You cant tween booth _xskew and _yskew at same time

GMac, check if the easing equations for as2 are installed on your computer
(maybe they are damaged...)

slide,
update function is useful if you will not compute too many movieclips with
same properties or if you will make some aditional test on every tween
update.
function myupdatingfunction(){
trace("updatefunction called, scope is:" + this);
}
my_mc.tween("_x", 200, 1, "easeoutexpo", 0, {updfunc:myupdatingfunction,
updscope:_root})

vectrex, try post empty comment and then uncheck the "Send me an email
whenever someone replies" and then delete it

jahmnawoo, ok i take look on that article

lelales, it is the same
msg136 { Lowspeed [+], posted: 05.03.04 6a•-, top [^] }
:)
msg137 { plasticman [+], posted: 05.03.04 11p•-, top [^] }
I'm using a bit of a hack to get around the problem of loading a sub-movie that uses the tween engine into a main movie that also uses the engine: without modifying the code at all, the main movie stops tweening altogether.
I realized that this was probably because the tweenManager's tweenHolder clip was replacing the original, and so i modified the second movie's code so that it loads into another depth with another name.

But i don't like the duplication of code in the separate movies - any way that the child movie can use the tween engine in the parent movie instead?
msg138 { laco [+], posted: 05.04.04 12a•-, top [^] }
Hi,
when you use loadMovie on Movieclip all his properties are reseted to default (and of course the tween method is rewriten) use nested empty movieclip inside tweening movieclip to loadMovie:
e.g.:
// this will not work, after load it stops tween
my_mc.tween("_x",100)
my_mc.loadMovie("movie.swf")

// better usage:
my_mc.tween("_x",100)
var hold = my_mc.createEmptyMovieClip("holder_mc",0)
hold.loadMovie("movie.swf")
msg139 { plasticman [+], posted: 05.04.04 2a•-, top [^] }
hehe - that was simpler than i thought! ;-)
i'm a dumb-ass.

Thanks for the amazingly swift answer! and for what is probably the MOST useful piece of Actionscript that anyone has so far written! :-)
msg140 { bongoman [+], posted: 05.06.04 9p•-, top [^] }
I'm having trouble getting this to work with an mc that contains a dynamic text field. I'm wanting to alpha tween the mc to 100 and have been trying this:

#include "lmc_tween.as"

myData = new LoadVars();
myData.load("quotes.txt");

quote_mc._alpha = 50;

myData.onLoad = function(success){
if (success){
quote_mc.quote_txt.text = this.quote_1;
quote_mc.alphaTo(100,5);

} else {
quote_mc.quote_txt.text = "Hello World";
}
};

So I'm trying to trigger the alpha tween using the onLoad method but to no avail.

Any clues would be appreicated.

Bongoman
msg141 { plasticman [+], posted: 05.07.04 12a•-, top [^] }
sorry if this is too obvious, but make sure you've embedded the fonts for any fields that you want to operate any transformations on.
msg142 { laco [+], posted: 05.07.04 1a•05.07.04 1a, top [^] }
bongoman, as plasticman says, you cant tween _alpha of not embedded (device) fonts

MovieClip tweening prototypes 1.1.6 beta
added auto overwrite feature ,if you dont like it use $tweenManager.autoOverwrite = false;
added frameTo shortcut method , for tweening frames on timeline
added new animtypes to easing equations easeOutIn ,plot of all easing equations
cleaned code (i hope it has no break any features)
msg143 { plasticman [+], posted: 05.11.04 3a•-, top [^] }
hmmm - sorry - questions, questions... :-/

Anyways, now i'm trying to see how i can temporarily disable the onEnterFrame when another function needs the processor.

What i'm trying to do (using AS1 incidentally) is see if there are any tweens running, and if not then delete the onEnterFrame attached to $tweenManager. But then when needed, re-enable the enterFrame so that tweens can operate again.

Trying to do this on-the-fly, because sometimes the constant onEnterFrame eats-up performance on other functions...

Maybe there's a good way to do this?
msg144 { ltangelus [+], posted: 05.12.04 11a•-, top [^] }
Hey all.

First, brilliant component. Saving my life.

But why ain't this working? The rollOver should stop the code on the bottom, yes?



stop();

theBug_mc.onRollOver = function(){
theBug_mc.lockTween();
}

theBug_mc.onRollOut = function() {
theBug_mc.unlockTween();
}

theBug_mc.tween("_x",0,4,"linear");
msg145 { laco [+], posted: 05.14.04 3a•-, top [^] }
placticman,
i have updated the as1 file , better would be if you post your comments to this page http://proto.layer51.com/d.aspx?f=1165
ltangelus,
use stopTween to stop tween
/* here is explanation of lock and unlock methods /copyied from zehs page/ */
They're useful for buttons: for example, the user clicks a button and it fades out. But it also has a tween on the onRollOut() event. So instead of letting the onrollout event overwrite the fadeout tween, a lockTween() right after one tweening will lock the movieclip and it won't be able to accept new tweens anymore. The unlockTween() method does the contrary.

msg146 { jpm04 [+], posted: 05.19.04 8a•05.19.04 8a, top [^] }
Laco,

What is the best way to kill delays for tweens that haven't fired yet? stopTween()? If so, do I have to stop each tween individually or is there some stopAllTweens() that I'm not aware of?

I've been building an application on version 1.1.2 for a few months now. It's basically an interactive tour where the user clicks a button to pick an area to explore. The button causes external SWFs (with tweens) and FLAs to be loaded and begin playing (and tweening on delays).

However, if the user realizes she's already seen this area, I want her to be able to select another area before everything has finished. And, even though I unload all of the SWFs, the delay timers for the tweens that didn't fire are still there and wreak havoc on the tweens for the next SWF.

I hope I'm making sense. I'm happy to elaborate if necessary. My goal is to have clicking a button wipe all tweens (and delay timers) before it begins loading the next set of tweens.

jpm
msg147 { laco [+], posted: 05.19.04 9a•-, top [^] }
jpm04
try download and install latest version and then
use after #include "lmc_tween.as"
following command:
$tweenManager.autoStop = true;
It stops all tweens in every tween call

msg148 { ltangelus [+], posted: 05.19.04 9a•-, top [^] }
Hey Laco,

thanks so much for response on the response and stop tween answer. i figured it out.


but dear god, i've got another question.


is there a way to use a string in place of the prop when calling a tween, ie:

myClip.tween("_y",this._y - 100,1,easeOutQuad)

i've tried it in quotes as well and no workin'.


thanks again. btw, ever thought of starting up a paypal account? i'd donate. you're putting a lot of time here.

lt
msg149 { jpm04 [+], posted: 05.19.04 10a•05.19.04 10a, top [^] }
laco,

Thanks for the quick reply! I tried your suggestion. I installed 1.1.6 and set autoStop up on all SWFs, including the external ones, and recompiled everything. But, it still doesn't quite do what I need. In fact, some of the tweens in the various SWFs now appear to override each other in a semi-comical, unpredictable way.

The situation I need to set up is to have the ability to do sequential tweens UNTIL the user makes another selection, at which point I want to wipe out all tweens and delays that weren't reached before establishing the new tweens (and delays).

jpm
msg150 { laco [+], posted: 05.19.04 10a•-, top [^] }
ltangelus,
example you posted here works... beacause type of this._y is number, maybe you are thinking something like this?:
my_variable = "89"
myClip.tween("_y",Number(my_variable) - 100,1,"easeOutQuad")

Hmm, Paypal is not bad idea, but i live in Slovakia and paypal not supports my small country

jpm04,
sorry i was misunderstand your question first time. So interval id of delayed tweens are stored in array $tweenManager.ints and running tweens are stored in $tweenManager.tweenList
So if you would like function to stop all tweens, you must clean up these variables:
$tweenManager.stopAllTweens = function(){
// stop all intervals
for (var i in this.ints){
clearInterval(this.ints[i].intid)
}
// stop all running tweens
this.tweenList = new Array();
}
msg151 { ltangelus [+], posted: 05.19.04 11a•-, top [^] }
No Paypal? That sucks. Maybe you should set up an Amazon wish list or something. I totally think should get back something for all the work you're doing here.

You're right, btw. It works. I don't know what I was doing wrong. Ugh.

Thanks again.
msg152 { jpm04 [+], posted: 05.20.04 8a•-, top [^] }
Thanks laco, your stopAllTweens() function seems to do exactly what I need.

jpm
msg153 { d-Faktor [+], posted: 05.22.04 10a•-, top [^] }
hello,

please excuse me, as i'm a complete flash/actionscript noob. so i fail to understand the inner workings of this (great) prototype, or anything that has been written in this thread for that matter.

let me explain my situation. i have a mc on the stage. on this mc i had a onClipEvent(enterFrame) where i used setProperty(this, _x, (currentx-((currentx-targetx)/8)), which of course was a very simple equation, but nice because i could keep feeding it new targetx numbers. the problem was that i needed something that ended exactly on the targetx.

so i've been trying to implement this prototype instead, but i can't get it to work. that is, it works fine if i use it on the main timeline, or in a onClipEvent(load), but I can't get it working in a onClipEvent(enterFrame). is that because it's not supposed to?

i probably will not understand a complex scripting answer, so a simple yes or no will do for me.

thanx in advance
msg154 { plasticman [+], posted: 05.23.04 12a•05.23.04 12a, top [^] }
d-Faktor: No.

cya later!

Just kidding - the function itself uses an onEnterFrame as it's engine, so you can't invoke it using another one.
Not quite sure what you're trying to do - does the movieclip get progressively closer to it's goal over a few arbitrary steps? If so you can certainly chain together a series of tweens with this prototype, by giving them increasing delays.

Best of luck! :-)
msg155 { amartrat [+], posted: 05.26.04 4a•-, top [^] }
I've done a movie that use your incredible prototype and when I debug it the object "ints:.." is full of "0:undefined,1:undefined....", why? this slows the movie?
Thank you
msg156 { laco [+], posted: 05.26.04 5a•-, top [^] }
ltangelus,
if you really like support my proto i have created one wishlist at amazon ;-)
amartrat,
i know about this issue, ints contains id of setInterval return values (for delayed tweens), i know it is bad, but it works and i dont think it slowdowns the movie. i was added setInterval based delayed tweens in 1.1.2 if you dont like it, you can download 1.1.1 or lower from my page:
http://laco.wz.cz/tween/?page=download
msg157 { SheldonMaloff [+], posted: 05.28.04 5p•-, top [^] }
This is great stuff. It's just eliminated a lot of code that I wrote and is as feature complete as I need it to be for what I'm doing. Thanks so much!

One problem however. Some of my own classes extend MovieClip. So, following your instructions, I copied the Zigo\Shared\MovieClip.as over top of the one MM provides. My project happens to make use of mx.controls.ComboBox, which also happens to define a tween member that is expecting an mx.effects.Tween. Naturally you get a type clash trying to assign an mx.effects.Tween to your tween member that is expecting a Function.

Anyway, what I did is modify my copy of your include file and renamed the tween method to startTween everywhere in the file. Then I had to update your MovieClip.as file as well. That solved my problem. ComboBoxes still work as MM intended, and your excellent package works as intended.

I'm not sure if you can do anything about this, but I thought I'd post this for anyone else that experiences the problem.
msg158 { wired [+], posted: 06.02.04 4p•-, top [^] }
Has anyone run into this problem?

I'm scaling something up to 100 percent, and before it begins the scaling tween it shows the object that is going to be scaled upwards very large for a split second. For some reason it doesn't happen with the linear tween.

msg159 { laco [+], posted: 06.08.04 1p•06.16.04 1p, top [^] }
wired, can you post here link to *.fla?
ok found it bug was in as1 version ($tweenManager.now variable was not initialized in constructor)
msg160 { darley [+], posted: 06.21.04 9a•-, top [^] }
question:
i have 3 objects on the stage. i want to fade each one up individually with a 1 second delay between each fade up. ideas?

maybe i just overlooked this functionality.

thanks!
msg161 { laco [+], posted: 06.21.04 4p•-, top [^] }
msg162 { beaver82 [+], posted: 06.21.04 11p•-, top [^] }
hi laco
there's a modality where i can't use this classes, it's when i need to update a tween with a new final_value at every frame.
i mean if i use tween() the motion restart with the initial speed, so the motion isn't fluid, i think it's because the Robert Penner easing function starts and end at specific times, there's no way to update an existing tween...?

an example of tween that work this way is this


////////
MovieClip.prototype.my_slideTo = function(x, y, speed) {
var mc = this;
var vx, vy;
mc.onEnterFrame = function() {
var there = true;
if (Math.abs(mc._x-x)>1) {
vx = (x-mc._x)/speed;
mc._x += vx;
there = false;
}
if (Math.abs(mc._y-y)>1) {
vy = (y-mc._y)/speed;
mc._y += vy;
there = false;
}
if (there) {
mc._x = x;
mc._y = y;
delete (this.onEnterFrame);
}
};
};
////////usage:
this.onEnterFrame = function() {
myMC.my_slideTo(_root._xmouse, _root._ymouse, 4);
};
////////
msg163 { darley [+], posted: 06.22.04 7a•-, top [^] }
thanks laco, great work
msg164 { laco [+], posted: 06.24.04 3p•-, top [^] }
Beaver,
sorry but it is not possible in easy and effective way to change the tween values on fly in this proto.
msg165 { 2obvious [+], posted: 06.30.04 5a•-, top [^] }
first of all GREAT what you put together here!!

i have the following question:

movieClip.tween("_x",100,3,"easeOutElastic", 0, {updfunc:callBack});

function callBack(){

// i would like to either get the current
// values for _x while the mc is being animated
// through either passed params or just doing
// the following --> movieClip._x
trace("current xpos: " + movieClip._x);
}
the trace action right now only outputs proper values when the clip is not being animated...
so how could i get to the x-values though WHILE it is being animated?

thanks,
chris
msg166 { laco [+], posted: 06.30.04 7a•-, top [^] }
hi Chris,
you can make it with function in onEnterFrame:
mc.tween("_x", 100, 3, "easeOutElastic");
mc.oldx = mc._x;
mc.onEnterFrame = function() {
if (this.oldx != this._x) {
if (this.isTweening()){
trace("actionscript tween");
}else{
trace("timeline tween");
}
} else {
trace("no tweening");
}
this.oldx = this._x
};
msg167 { 2obvious [+], posted: 06.30.04 7a•-, top [^] }
ah i see, ok...
too bad i can't pass on the values to the callback function though... anyway, i have solved it now using a setInterval which traces the mc._x value respectively..

one more question... reading through your documentation i didn't really understand the describtion for the last two optional parameters entitled extra1 and extra2 respectively...

i using the easeInOutElastic method and i am basically trying understand how i can limit the extend of elasticity that goes beyond the target position... so lets say my target value would be _x = 200; and the mc would start at _x=0;
than due to the nature of that method i would end up getting values (not the actual values just used to explain my issue here...) like x=240, x=180, x=230, x=190 etc until i end up at 200... so how can i make sure that the max value above the goal won't go beyond let's say 220?

thanks,
chris
msg168 { laco [+], posted: 06.30.04 8a•06.30.04 9a, top [^] }
i think its not possible to define extra1 (amplitude) parameter lower than change parameter, take look at easeOutElastic equation:

if (!p) p=d*.3;

if p(period,extra2) not defined period = duration * .3, extra2 is default in 0.3 of duration (in miliseconds)

if (!a || a < Math.abs(c)) { a=c; var s=p/4; }
else var s = p/(2*Math.PI) * Math.asin (c/a);

if a (amplitude, extra1) not defined or is lower than abs of change parameter then set amplitude = change ...

try use the custom Easing tool to adjust curve of easing

or try this tutorial about elasticity:
http://www.bit-101.com/tutorials/elasticity.html

msg169 { niko [+], posted: 07.04.04 4a•-, top [^] }
Hey Laco,
Really good Work, very usefull,
that s help me a lot to keep sometime ....

clap clap clap :-)
msg170 { jeff815 [+], posted: 07.10.04 4a•-, top [^] }
Hi,
Great tool!! ^^
I am using v.1.1.6 on FlashMX Pro 2004 and encouter 2 problems.
1.) tweening doesn't work on movie clip with external jpg file loaded in
ex:
#include "lmc_tween.as"
this.createEmptyMovieClip("tmHolder", 5);
tmHolder.loadMovie("img/thum/doo1.jpg");
_root.tmHolder.onRollOver = function():Void{
this.scaleTo(300, 1.5, "easeoutelastic");
}
_root.tmHolder.onRollOut = function():Void{
this.scaleTo(100, 1.5, "easeoutelastic");
}
2.) My tweening won't work if my publish setting is "Flash Player 7 with AS2", but works fine with "Flash Player 6 with AS2". Is it unusual?

Please help

Jeff
msg171 { laco [+], posted: 07.10.04 10a•-, top [^] }
jeff815,
1/
it is known bug, after loadMovie is all properties of movieclip reseted to default, use nested movieclip to load external data:

this.createEmptyMovieClip("tmHolder", 5);
tmHolder.createEmptyMovieClip("container",0)
tmHolder.container.loadMovie("img/thum/doo1.jpg");

2/ can you be more specific how commands dont work under FP7??? (i publish always for FP6, maybe is there some bug...)
msg172 { jeff815 [+], posted: 07.10.04 12p•-, top [^] }
Hi Laco,

The "nest moveclip" code works fine with external source on both v.6 and v.7.
Now I can apply that to a more complicated project without worrying. You really make my day!
Thank you very much for the help ^^...

Jeff
msg173 { rip [+], posted: 07.12.04 4a•-, top [^] }
Hi

ihave problem whit the example http://laco.wz.cz/tween/fla/windownodisort.fla.

I have installed 1.1.6 and replaced movieclips.as

When i preview in flash and click on the resize button then only the middle mc ( c_mc ) resize?

Anyone hade the same ploblem?
msg174 { rip [+], posted: 07.13.04 2a•-, top [^] }
Now it works :)
msg175 { are [+], posted: 07.13.04 3a•-, top [^] }
laco,

possible bug:

using tween method with _xscale and _yscale, the _xscale value takes an absolute value and not a percentage. the _yscale value takes a percentage. in other words, if I enter say 200 for the _xscale it tweens the _mc to 200, not 200 percent of its orginial _width. the yscale value would tween to a scale of 200 percent.
msg176 { laco [+], posted: 07.18.04 8a•-, top [^] }
Are,

i have tested tweening of _xscale and _yscale, but i dont see any problem, can you help me find the problem and send me the .fla ?
msg177 { are [+], posted: 07.20.04 12p•-, top [^] }
laco,

Here's a code snippet outtake that caused me to post (it's a dynamic menu experiment, _mc with _txt label, just AS):

<snip>
// the original size of _mc
trace(menu4_mc._width);
trace(menu4_mc._height);
// scale vars
var xScale:Number = Math.round((menu4_txt._width/menu4_mc._width)*100);
trace(xScale);
var yScale:Number = Math.round((menu4_txt._height/menu4_mc._height)*100);
trace(yScale);
menu4_mc.tween(["_xscale", "_yscale"], [xScale, yScale], 0.5, "easeInExpo", 0, addText);
function addText() {
// add the text to the textField
menu4_txt.text = menuStr;
menu4_txt.setTextFormat(menuItem_fmt);
// add marks through ext function
addMarks();
// final size after tween
trace(menu4_mc._width);
trace(menu4_mc._height);
}
</snip>

These traces return (confirmed visually with test movie):

113 --> _width
20 --> _height
177 --> xScale
685 --> yScale
177 --> end _width
137 --> end _height

As you see, the yScale scales properly according to a percentage while the xScale math should give a final _width of 200. Instead, it returns 177 as an absolute coordinate (the input through xScale var).

This was just a code doodle; I may be dumbing down the forum...again.

msg178 { laco [+], posted: 07.20.04 3p•-, top [^] }
ok are,
when you add in addText function :

trace(menu4_mc._xscale);
trace(menu4_mc._yscale);

what it outputs???
msg179 { tiptap [+], posted: 07.21.04 4a•-, top [^] }
Hi all,

I've been using the macromedia tween class to create a similar effect as you guys (http://www.actionscripts.org/tutorials/advanced/Tween-Easing_Classes_Documented/index.shtml)

Then stumbled accross yours (which works and runs better), the only thing I would like to ask is is there a version written as a class, also the thing I liked the most with the macromedia one is the OnMotionComplete function,

It would be nice to see a similare one in yours... so it would work like this;

myClip.tween('_y', 123, 0.5, myEase, 0);
myClip.OnComplete = function (success){
trace("done tweening")
}

What do you think?
msg180 { laco [+], posted: 07.21.04 5a•-, top [^] }
hi tiptap,
now you can write the end callback function in two ways:

OnComplete = function (){
trace("done tweening")
}
myClip.tween('_y', 123, 0.5, myEase, 0, OnComplete);

or with ASbroadcaster and listeners :

myClip.onTweenFinished = function (){
trace("done tweening")
}
myClip.tween('_y', 123, 0.5, myEase, 0);
myClip.addListener(myClip);
// you can add many listeners to tween (its more flexible than only myClip.onTweenFinished)

if you like the way you write with myClip.OnComplete, you may tweak the endTween method in tweenManager class




msg181 { marcus [+], posted: 07.21.04 8a•-, top [^] }
In a new document when I have the following code:

#include "lmc_tween.as"
trace(this.getNextHighestDepth());

I get this in the output window:
6790

Why does the prototype use 6790 levels of depth before I've even used it?
I'm using Flash MX Professional 2004
msg182 { SheldonMaloff [+], posted: 07.21.04 8a•-, top [^] }
Hey Marcus,

I don't think that's this MovieClipTween package's fault. If you're using MX Pro 2004, Flash itself creates some very high MovieClips, most notably FocusManager. I can't quite recall it's depth, but this number sounds about right. Anyway, these very high movie clips make getNextHighestDepth() useless. I'm surprised Macromedia developer's didn't figure this out. I had to write my own functions to do depth calcs.

Sheldon
msg183 { marcus [+], posted: 07.21.04 8a•-, top [^] }
#include "mc_tween2.as"
trace(this.getNextHighestDepth());

outputs
0

as does
trace(this.getNextHighestDepth());

It must have something to do with the tweening prototype. I'll agree though, getNextHighestDepth isn't the best.
msg184 { SheldonMaloff [+], posted: 07.21.04 10a•-, top [^] }
Hey Marcus,

Hmmm, perhaps it's because I'm using Screens in my project and that's when FocusManager comes into existence. Perhaps in a non-Screen project there are no high MovieClips. I guess you might have to look at the lmc_tween code to see what's up. I've skimmed it when I had to modify start() to startTween()--see my prior post above--but I wasn't looking for high depth clips, so I can't comment.

Sheldon
msg185 { laco [+], posted: 07.21.04 11a•-, top [^] }
Hi Marcus,

you are right, the main controlling mc is created at depth 6789, you can modify it in the sources in init function in class tweenManager:

tweenHolder = _root.createEmptyMovieClip("_th_",6789);

msg186 { g77 [+], posted: 07.23.04 1p•07.23.04 2p, top [^] }
Hi,
im also getting the --- Type mismatch in assignment statement: found mx.effects.Tween where Function is required. __dropdown.tween = new Tween(__dropdown, __dropdown._y, point.y-__dropdown.height, getStyle("openDuration")); -- error.

im also extending the mc class in my project, & using version 1.1.6 of the tweening proto in MX 2004, with combobox component among others.

the thing is i dont want to rename the tween method since i've already used it on other ongoing projects and dont want to have to rewrite the calls to the method on those as well, also it will generate future compatibility issues w/ new releases of the tweening class.

Does anybody have another work around for this problem??

thanks
msg187 { laco [+], posted: 07.28.04 4a•-, top [^] }
g77,
if you dont like to rename the tween to startTween like SheldonMaloff in msg 157, i know about 2 workarounds:
1.
you can put the old MovieClip.as without tween function definition (from program files/flash/.. to document and settings) and call the tween function from class:
this["tween"]()

2.
try rename the variable in ComboBox.as (i dont know if it dont breaks any functionality...)
__dropdown.tween = new Tween(__dropdown, __dropdown._y, point.y-__dropdown.height, getStyle("openDuration"));
to:
__dropdown.tween2 = new Tween(__dropdown, __dropdown._y, point.y-__dropdown.height, getStyle("openDuration"));




msg188 { SheldonMaloff [+], posted: 07.28.04 8a•-, top [^] }
laco, g77,
I'm pretty sure that option #2 in the previous message won't work unless you did this change at runtime by modifying the prototype of the ComboBox class. (Which of course won't work, because the error I mentioned in msg 157 is a compile time error.) Macromedia provides the source code for their components, however the components themselves are in precompiled SWC files, so changing the code in the class file doesn't actually affect the component. At least, that's the behaviour I saw when I tried mucking with some of the code files that Macromedia provided.

Sheldon


msg189 { g77 [+], posted: 07.28.04 12p•-, top [^] }
laco, sheldon,
thanks for the replies, im going with sheldon's workaround & renaming the method in both the include and class files. just thought i asked in case there was a faster way.

laco how do you like startTween? since u r probably going to have to rename it in future versions also. btw excellent work!! made my life simpler.
thanks.
msg190 { are [+], posted: 07.29.04 4a•-, top [^] }
ok are,
when you add in addText function :

trace(menu4_mc._xscale);
trace(menu4_mc._yscale);

what it outputs???

===

It outputs the applied scale values for x and y respectively (passed through the vars in this case). Which shows that the scale properties are assigned as entered, but the _width property is not updated accordingly, while the _height is. Still puzzled by this behavior.
msg191 { treatkor [+], posted: 08.15.04 8p•-, top [^] }
okay, so i understand using isTweening() but can i use:
!this.isTweening() to check if something is NOT currently tweening?

i need to check if two conditions are false, like this:

if (this !== curr_selected || !this.isTweening()) {
rolCol = (curr_slctcolor);
this.colorTo(rolCol,.01);
}

how would i do this?
msg192 { tom24569 [+], posted: 08.16.04 6a•-, top [^] }
Some of the examples on laco's website - such as windowdistort - seem to work only with the AS1 include, not the #include "lmc_tween.as" for the AS2 version. Am I doing something wrong, or does the code for those examples have to be modified?

Thanks.
msg193 { Lowspeed [+], posted: 08.16.04 1p•-, top [^] }
tom24569,

You have to change the #include line. After changing the include, you must save the file in 2004 format. You must then change the publish settings to Flash Player 7, and Actionscript setting to 2.0.

If you follow these steps your problems should melt away (your flash problems anyways)

:)

Lowspeed
msg194 { tom24569 [+], posted: 08.16.04 3p•-, top [^] }
<headslap/>
Yes - you're right. I was still working in AS1, player6 mode - once I changed to AS2/Player7, everything worked.

Thanks.
msg195 { tom24569 [+], posted: 08.16.04 3p•-, top [^] }
Whoa - not so fast. The zoomingicons example still doesn't work, even with the correct include and AS2/player7 setup. Anything extra that needs to be done?
msg196 { orangechicken [+], posted: 09.21.04 6p•-, top [^] }
Anyone have problems using AS2 and publishing to Flash 6? I'm running into a *bizarre* issue where something happens to my movie where all tweens cease working. The rest of the site still works... just nothing with a tween.

Strange thing is, this only happens if the Flash 6-published movie is played in the Flash 7 player. Playing it in a Flash 6 player everything works flawlessly.... Like I said, bizarre.

Any ideas anyone?
msg197 { orangechicken [+], posted: 09.21.04 6p•09.22.04 9a, top [^] }
Alright. Problem solved. And lmc_tween.as should be edited:

In Flash 7, apparently if you don't specify _global then Flash doesn't look in the global namespace... at least that's the case here. Maybe it's the AS2/Flash 6 pairing but changing line 7 of lmc_tween.as from:

if ($tweenManager == undefined ){

to

if (_global.$tweenManager == undefined){

fixes everything. It's strange that it's not like that in the first place since on the very next line _global is used and it seems more consistent to use _global on both lines for clarity.

I highly recommend this change to lmc_tween.as so future users do not run into this issue. The specific problem here was that a Flash 6 movie was loading another SWF that was published (both with lmc_tween.as) as a Flash 7 movie. The different versions apparently don't see the _global namespace in the same default way and $tweenManager was being overwritten with a new instance of zigo.tweenManager). Make sense? Clear as mud I'm sure...


EDIT: I removed the [ code ] tags because they don't display properly in Firefox (and apparently not on Mac OS either).
msg198 { laco [+], posted: 09.22.04 1a•-, top [^] }
aah there was the problem, i was getting many questions why the FP6 swf files not working together with FP7 published files, thanks again orangechicken ;)
msg199 { swirlywonder [+], posted: 09.30.04 11a•-, top [^] }
I've come across a situation that seriously effects tween performance when using repeated delayed tweens.

I've built a dynamic XML generated ticker to display flight data for a regional airport. There are 5 "flights" displayed at a time, each rolled in sequence. The first moves up immediately, the second moves up with a .25 second delay, the third with a .5 second delay, and so on. A tween listener 'fires' when the last item is in place. A second set of tweens is then 'fired' to move out the 'flight info' in the same staggered sequence. When the last item has finished, the listener fires again and the cycle starts over.

Everything works perfectly with the exception of the growing 'ints' Array that holds the delayed tween data. If a user lets this flight data run in the background, the length of this 'ints' Array can grow into the thousands. The tween array that holds the tween data after completion of the delay is spliced when that index is no longer needed, thus managing its size. The ints array, however, continues to grow.

It was previously mentioned that this issue does not effect performance. This is true if it is only used to build a stage or used only a few times. But if used in a timed loop or loops, the issue rockets out of control.

I have created a temporary solution by avoiding the delay attribute, invoking my own delay timer/array, and removing unused indexes. Is this something that will be corrected in the future for the TweenManager Class?
msg200 { laco [+], posted: 10.01.04 12a•-, top [^] }
hi swirlywonder,
i know about this issue - bug, but i cant split from ints array, when you you use the stopTween, the indexes needs to be again assigned to correct tweens...i was leaving as it is, due i has no idea how to make it better :( (just have once, when firing the delayed tween, check if are all items in ints array is undefined and then reinitialize it ). I am looking forward for your temporary solution, write me mail and we can discuss it in better detail. Thanks for your time
msg201 { amartrat [+], posted: 10.01.04 3a•-, top [^] }
Hi Laco,
thanks for your fantastic prototypes. I'm not an expert in actionscript but I use your prototype and it works great.
But I don't know if there is a better use than mine to animate a series of clips, here's an example of how can I do that:

#include "lmc_tween.as"
var Eq:Array = ["linear", "easeInQuad", "easeOutQuad", "easeInOutQuad", "easeInCubic", "easeOutCubic", "easeInOutCubic", "easeInQuart", "easeOutQuart", "easeInOutQuart", "easeInQuint", "easeOutQuint", "easeInOutQuint", "easeInSine", "easeOutSine", "easeInOutSine", "easeInExpo", "easeOutExpo", "easeInOutExpo", "easeInCirc", "easeOutCirc", "easeInOutCirc", "easeInElastic", "easeOutElastic", "easeInOutElastic", "easeInBack", "easeOutBack", "easeInOutBack", "easeInBounce", "easeOutBounce", "easeInOutBounce"];
MovieClip.prototype.quadrat = function(x:Number, y:Number, w:Number, h:Number, fc:Color, fa:Number, lc:Color, la:Number, lg:Number) {
this.beginFill(fc, fa);
this.moveTo(x, y);
this.lineStyle(lg, lc, la);
this.lineTo(w, y);
this.lineTo(w, h);
this.lineTo(x, h);
this.lineTo(x, y);
this.endFill();
};
function inici() {
for (var i = 0; i<10; i++) {
var quin:String = "q"+i;
createEmptyMovieClip(quin, i);
this[quin]._alpha = 0;
this[quin].quadrat(null, null, 20, 20, 0x000000, 100);
this[quin].tween(["_alpha", "_x", "_y"], [100, Math.random()*550, Math.random()*400], 3, Eq[26], i/3, {scope:this[quin], func:function () {
this.tween(["_x", "_y"], [Math.random()*550, Math.random()*400], 1, Eq[0], null, {scope:this, func:function () { if (this._name == "q9") {continuar();}}});
}});
}
}
function continuar() {
for (var i = 0; i<10; i++) {
var quin:String = "q"+i;
this[quin].tween(["_alpha", "_x", "_y"], [0, Math.random()*550, Math.random()*400], 3, Eq[26], i/4, {scope:this[quin], func:function () {
if (this._name == "q9") {
trace("end");
}
}});
}
}
inici();

Thanks for your time
msg202 { blackire [+], posted: 10.07.04 3p•-, top [^] }
I am trying to make an mc repeat on itself, or loop the image for a panorama.Currently i call the image mc with

#include "lmc_tween.as"
this.createEmptyMovieClip("panorama_mc", 0);
panorama_mc.loadMovie("panorama.jpg");

then i have a button on the right and left taht make the clip move right and left

on (rollOver) {
_root.right_invis.useHandCursor = false;
_root.panorama_mc.tween("_x", -2500, 5, "easeinoutquad", 0);
}



how do I get the MC to loop to display the left and the right side of the mc simultaneously to bridge the gap in my panorama?


Thanks!
msg203 { madnet [+], posted: 10.08.04 9a•-, top [^] }
Hello.

still I´m getting "There is no method with the name 'tween'"


I have replace the file "MovieClip.as" in Flash MX 2004\[language]\First Run\Classes directory with file in this location
C:\Documents and Settings\[username]\Local Settings\Application Data\Macromedia\Flash MX 2004\[language]\Configuration\Shared\Zigo

What I´m doing wrong?

thks
msg204 { guest [+], posted: 10.14.04 7a•-, top [^] }
Can anyone suggest a way to "pause" a tween? Baiscally I want to be able to start tweening a MC (e.g., mc.alphaTo(0,3,"easoutcubic",0)), pause it, then continue tweening where it left off.

Any help would be much appreciated.
msg205 { laco [+], posted: 10.14.04 12p•-, top [^] }
sorry all for later answer, the main forums for this script is now here
forum: http://laco.wz.cz/forum/

amartrat, i see the code looks scary, but if it works let it be as it is... imho you can use more variables to become the code more readable

blackire, i think you can make it without this script, just make simple onEnterFrame with if condition

madnet, you must install the extension, and rewrite the file in
C:\Documents and Settings\[username]\Local Settings\Application Data\Macromedia\Flash MX 2004\en\Configuration\Classes\

guest, you cant pause, you can make it with RP tween class or use the new version, there is link
http://laco.wz.cz/forum/viewtopic.php?t=56 (is not yet completly tested and finished)
msg206 { kord [+], posted: 10.18.04 4p•-, top [^] }
Just want to say THANX for this amazing work. ;)

Kord
http://www.flashig.com
msg207 { LeepAn [+], posted: 01.16.05 5a•-, top [^] }
I am 2 days try installing you GREAT job.
I am have Sucses only after this example http://laco.wz.cz/mc_tween/example.zip
Please on your site in "instal" part add this example with comment for dummies like me.
THANK YOU
msg208 { theranch [+], posted: 05.17.05 8a•-, top [^] }
This sample is awesome...
----------------------------
sg56 { zeh [+], posted: 03.09.04 5p•-, top [^] }
jason, here it is --

http://www.fatorcaos.com.br/downloads/l2_demo.zip

It's a bit weird though... it's an adaptation of an old 3d engine I had coded on Quick Basic4.5 (!) so it's a bit rough.

The buttons tween the camera position variables and the engine does the rest.
---------------------------

Has anyone used this to move around an mc rather than the 3D layout that is produced in the Flash movie?
Thanks,
Gerry
www.thespikeranch.com