PDA

View Full Version : Repeat tween while mouse is over button?


PaulSheffield
08-04-2009, 01:22 PM
I'm using a tween class to give a build a 'full screen' button for my movie player. I have a small screen image within a large screen image and the idea is that onRollOver the small screen expands to the same size as the large screen (as per Youtube). So far so good.

However, the tween plays once and then stays in the 'finished' state until roll out. What I'd like is for the tween to repeat as long as the mouse is over the button.

Here's my code:
function fullscrnBtn() {
new Tween(smallTV_mc, "_width", mx.transitions.easing.Regular.easeInOut, 24.9, 55, 0.5, true);
new Tween(smallTV_mc, "_height", mx.transitions.easing.Regular.easeInOut, 16.3, 34, 0.5, true);
}

largeTV_mc.onRollOver = function () {
fullscrnBtn();
}

How do I do this?

Many thanks

Paul in Sheffield

EvLSnoopY
08-05-2009, 03:47 PM
Why not try creating an EventListener for largeTV_mc?

eggnogg
08-09-2009, 04:07 AM
there's the very usefull

tweenVar.onMotionFinished = function() {
//do
}

//example
var myTween = new Tween....
myTween.onMotionFinished = function() {
function fullscrnBtn();
}