This entry was posted
on Friday, July 13th, 2007 at 2:13 am and is filed under Actionscript, Flash, News, Twease.
You can follow any responses to this entry through the RSS 2.0 feed.
You can leave a response, or trackback from your own site.
That’s not a bug in Twease, it’s how Flash works. You’re essentially turning it to just a string, so it reads it as my_number not, a string of that variable. To do that, try instead:
An anoter problem is (I think it;s again a Flash problem), that is if I define a onRollOver function for one of my movieclips, Twease seems to count how many times the cursor rolled over the mc, and plays the Twease tween again and again.
I didn’t had this with other tween engines. Is there a wrokoround for this thing?
Like check if the Twease tween is playing currently, something with “upfunc”i?
if Twease == running
mymc.diable
else
mymc.enable
P.S:
I plan to use Twease from now on, I love it, it’s soo small. The other scrips seems to me an overkill for some little button state changes.
Would be interesting to know what tweens you are planning to add to Twease!
Currently I just miss one for colors.
It’s not a bug, that’s an intended feature I call ‘stacking‘. Basically, if you call a tween while one is already running, it will basically auto queue itself and run when the first one is running, like a sequencer. It will keep doing this each time Tween() is called for that property.
If you don’t want that, just delete the current tween before calling the new one:
delete Twease.tweens[this]._x;
That should work. It will delete all tweens for that property. To delete every tween on an object, just delete the object:
delete Twease.tweens[this];
If you’re doing a rollover/rollout where the object moves out, then back to the original position, I would suggest using absolute values (Numbers) instead of relative (Strings) so it always goes back to the original position incase a tween gets interrupted.
But you can also prevent the tween from being called with your idea in a few ways:
if(Twease.activetweens[this]._x == undefined){
//do tween here
}
or
if(Twease.tweens[this]._x.active != true){
//do tween here
}
Lots of stuff going on there, but should be pretty straightforward. If you have any questions, just ask.
Tweenlite seems pretty nice, and currently does color which mine doesn’t, but I haven’t played with it much. Twease being mine, I’m slightly biased. Twease is also a sequencer, so that is an advantage. I think the ‘from’ and ‘to’ concept is neat, but just more overhead. Mine is very compact with minimal functions, yet the features are great and are abound, even if there’s no direct function call for them.
I’m not also a fan of the syntax, though I do get the logic behind it. Pure features, power, and performance, Twease is superior. The only thing missing that may put some off is color, but this is just a core engine, so special props like that will be added separately later. But really, that’s about it.
I’ll take a look at the source and see how it works sometime. I’ve optimized the hell out of it, so the guts of the engine are like polished chrome. I’m not saying Tweenlite isn’t either, so I don’t know how benchmarks would hold up. Try it out, and take a look at the site. It’s brand new, so docs are a bit lacking.
I think it still may be good to see a swf or and example of something in action. Considering how many engines there are, there is something to be said about the ability to quickly see a working example - regardless of ease of use.
in fuse you can trigger a fuse to start before the previous fuse is complete.
as in I want box_mc to tween 100px to the right and take 4 seconds but Id like circle_mc to start to fade 2 seconds into box_mc’s fuse..
July 15th, 2007 at 2:12 pm
A great tween engine.
I have been searching a lot for a lightweight engine like this.
Thanks a lot!
July 16th, 2007 at 5:46 am
I have built a small demo for me with your Twease tween engine. It’s really good, althrough there is a small problem!
This works:
Twease.tween({target:my_mc, time:0.3, _x:’-20′});
This Too:
var my_number:Number = 55;
Twease.tween({target:my_mc, time:0.3, _x:my_number});
This does not work (at least for me):
var my_number:Number = 55;
Twease.tween({target:my_mc, time:0.3, _x:’my_number’});
It seems that relative (prop += value) values from variables does’nt work.
But anyway, its a great class!
P.S.: Sorry if I made some mistakes, my english is not the best
July 19th, 2007 at 8:13 am
Zsolt:
That’s not a bug in Twease, it’s how Flash works. You’re essentially turning it to just a string, so it reads it as my_number not, a string of that variable. To do that, try instead:
_x:my_number.toString()
July 24th, 2007 at 2:53 am
ohhhh, I ‘d better learn actionscript well
An anoter problem is (I think it;s again a Flash problem), that is if I define a onRollOver function for one of my movieclips, Twease seems to count how many times the cursor rolled over the mc, and plays the Twease tween again and again.
mymc.onRollOver = function () {
Twease.tween({target:this, func:myEndFunction, time:1.5, _x:’-20′, ease:Twease.easeOut});
}
I didn’t had this with other tween engines. Is there a wrokoround for this thing?
Like check if the Twease tween is playing currently, something with “upfunc”i?
if Twease == running
mymc.diable
else
mymc.enable
P.S:
I plan to use Twease from now on, I love it, it’s soo small. The other scrips seems to me an overkill for some little button state changes.
Would be interesting to know what tweens you are planning to add to Twease!
Currently I just miss one for colors.
July 24th, 2007 at 9:01 am
It’s not a bug, that’s an intended feature I call ‘stacking‘. Basically, if you call a tween while one is already running, it will basically auto queue itself and run when the first one is running, like a sequencer. It will keep doing this each time Tween() is called for that property.
If you don’t want that, just delete the current tween before calling the new one:
delete Twease.tweens[this]._x;That should work. It will delete all tweens for that property. To delete every tween on an object, just delete the object:
delete Twease.tweens[this];If you’re doing a rollover/rollout where the object moves out, then back to the original position, I would suggest using absolute values (Numbers) instead of relative (Strings) so it always goes back to the original position incase a tween gets interrupted.
But you can also prevent the tween from being called with your idea in a few ways:
if(Twease.activetweens[this]._x == undefined){//do tween here
}
or
if(Twease.tweens[this]._x.active != true){//do tween here
}
July 28th, 2007 at 1:14 pm
Can you post a working example?
And how do you feel this stacks up to http://www.tweenlite.com/, another 2k tween engine.
July 28th, 2007 at 6:00 pm
Sure, it’s pretty straight forward, I’m not sure a swf is necessary, but here’s some full AS:
////////////////////////////
import com.visualcondition.twease.Twease;
var t:MovieClip = _root.createEmptyMovieClip(’5′, 3);
t.beginFill(0,100);
t.lineTo(50,0);
t.lineTo(50,50);
t.lineTo(0,50);
t.endFill();
var f1:Function = function(target){trace(”One ” + target)};
var k:MovieClip = _root.createEmptyMovieClip(’mc3′, 4);
k.beginFill(0×555050,100);
k.lineTo(50,0);
k.lineTo(50,50);
k.lineTo(0,50);
k.endFill();
Twease.tween({func:f1});
var s = Twease.tween([{time:2, _rotation:'365'}, {delay:1, func:f1}, {target:t, _x:100, _y:100, _alpha:50, delay:0, ease:Twease.easeOut, time:2, cycles:3}, {time:2, _rotation:'25'}, {time:2, _rotation:'-55'}, {time:2, _rotation:0}], k);
Twease.tween([{target:t, _rotation:50, time:2}, {target:k, _xscale:50, time:2}]);
////////////////////////////
Lots of stuff going on there, but should be pretty straightforward. If you have any questions, just ask.
Tweenlite seems pretty nice, and currently does color which mine doesn’t, but I haven’t played with it much. Twease being mine, I’m slightly biased. Twease is also a sequencer, so that is an advantage. I think the ‘from’ and ‘to’ concept is neat, but just more overhead. Mine is very compact with minimal functions, yet the features are great and are abound, even if there’s no direct function call for them.
I’m not also a fan of the syntax, though I do get the logic behind it. Pure features, power, and performance, Twease is superior. The only thing missing that may put some off is color, but this is just a core engine, so special props like that will be added separately later. But really, that’s about it.
I’ll take a look at the source and see how it works sometime. I’ve optimized the hell out of it, so the guts of the engine are like polished chrome. I’m not saying Tweenlite isn’t either, so I don’t know how benchmarks would hold up. Try it out, and take a look at the site. It’s brand new, so docs are a bit lacking.
July 30th, 2007 at 2:27 pm
Thanks for the info.
I think it still may be good to see a swf or and example of something in action. Considering how many engines there are, there is something to be said about the ability to quickly see a working example - regardless of ease of use.
November 29th, 2007 at 5:38 pm
Hey Andrew - first of all, thanks for this!
Im working on some banners and thought Id give this a try.
I do have a “how would you do it: question…
How would you delay 2 sec - the at the same time zoom(xscale:200,yscale:200) and blur the same mc 50% quality high while it’s zoomin?
thanks
andy
November 29th, 2007 at 5:43 pm
one other question while I have ya ; )
in fuse you can trigger a fuse to start before the previous fuse is complete.
as in I want box_mc to tween 100px to the right and take 4 seconds but Id like circle_mc to start to fade 2 seconds into box_mc’s fuse..
make sense?
December 2nd, 2007 at 1:43 pm
Create 2 tweens, one for the scale and one for the blur. Set a delay of 2 for both. Instructions for filters are on the Twease page.
Just create 2 tweens, and have the circle_mc with a delay of 2, and then just call them at the once.
It sounds as if you’re over complicating things. You can just use regular static tweens for these, no need for sequences (fuses).
Hope this helps.
January 24th, 2008 at 4:54 am
Is there a way to make twease _global like “mc_tween2″ is ?
Include or import everything once on one timeline making it available on any timeline?
January 24th, 2008 at 7:30 pm
I’m sure you could do something like:
_global.Twease = com.visualcondition.twease.Twease;
January 25th, 2008 at 1:40 am
Thanks Andrew!
I had a feeling my question may be in the gentle realm of general flash.
Ha ha ha dare I say I think im lovin twease like a mad man with tweasers.
January 25th, 2008 at 9:57 am
Ha, thanks, I’m glad you’re lovin it.