tween classes?
- Started
- Last post
- 18 Responses
- jackfoley
Trying to learn these tween classes and I've found quite a few including:
http://hosted.zeh.com.br/mctween…
http://www.osflash.org/doku.php?…
http://www.osflash.org/doku.php?…
http://laco.wz.cz/tweenWhich ones are the best to use?
- stuff0
Laco. Without a doubt.
- jackfoley0
I found that a bunch of people have linked to it but I can't get the site to come up.
- mitee_0
laco.
- nRIK0
can anyone get the callback function working after a tween has finished?
ive got it working, but it only plays it ONCE, then when I call that tween again, it just ignores the callback function :|
- Beech0
I use the laco callback function like it says in the documentation and never had a problem.
- nRIK0
http://laco.wz.cz/tween/?page=do…
maybe you can help me out then?
listener.onLoadInit = function(mc){ mc.tween("_alpha",0,1,"linear",0...
trace("called");
};(hope that pasted in well)
onEnd() only works the first time, then whenever onLoadInit is called again, it doesnt work.
- nRIK0
listener.onLoadInit = function(mc)
{mc.tween("_alpha",0,1,"linear",0...
trace("called");
};
or just head on over here to view the source:
- unformatted0
var callback:Object = {};
callback.scope = this
callback.func = "yourFunction";mc.tween("_alpha",0, 1,"linear",0, callback );
or all in one
mc.tween("_alpha",0, 1,"linear",0, { scope:this, func:"yourFunction" } );
- nRIK0
did that before, same result.
- Beech0
That code looks pretty good to me, maybe it has something to do with the variable your passing into the function it maybe not treating it as a new load if you know what i mean just a new variable.
Sorry ... thats not much help
- nRIK0
yea thats what i sort of concluded too.. maybe gotta destroy the tween (i tried with .stopAllTweens())... then assign it the new tween.. but no cigar
but the wierd thing is, the output is:
mclListener.onLoadInit
_root.onEnd
mclListener.onLoadInit
mclListener.onLoadInit
mclListener.onLoadInit1st go, calls function AND calls the callback.
2nd go, calls function only.
3rd go, calls function only.
4th go, calls function only.>.
- Beech0
no I don't think you need to kill the tween, just pass the variable into the function in a different way so that the onloadinit works.
this is how I do it on my site
mcLoader = new MovieClipLoader();
loadListener = new Object();
mcLoader.addListener(loadListene...
mcLoader.loadClip(currentImage, "loader_mc");....
so currentImage is the var of the image file.hope that helps, i'm no unfitforprint
- jpea0
do your _x and _y values work when you use onLoadInit?
if they do, you can assume it's just the callback that's not working. otherwise, my thought is that you're previewing it locally, therefore movieClipLoader won't work correctly.
also, since you're only using 1 tween on mc, you can stop it by mc.stopTween();
- nRIK0
yeah... i got that too
*sigh*
//debugging is fun.
- nRIK0
jpea: yea everything works with my onLoadInit()
as you can see it also shows the trace() debugging message as well...
so i dont think its to do with my onLoadInit..
:(
maybe i should try upload it and see..
- jpea0
i haven't plugged your code in an actual fla, and this may be obvious and such, but somehow, is your mc already at 0 _alpha perhaps? if it is, it won't even get to the callback cause the tween woudn't even be called.
- nRIK0
yep jpea,
i initialised it in onLoadStart() - mc._alpha = 100;as well as in the function itself
- nRIK0
but jpea, i think it works online now
just doesnt work when you are offline/locally - even loading external images from online websites
i guess thats the key, test on your webhost!
thanks jpea & beech for trying and the tips!