0

Hi I have been trying to get this to work for ages but no luck. I want that when you scroll over the swf it begins its tween until finished (even if you take mouse away from swf) and if you hover over it again, it starts from the beginning. I have attempted to do it as you can see bellow... I have three layers on the mane scene:

Action (Frame till the end) with code:

'var Tragic:URLRequest = new URLRequest("MM_openBrWindow('http://tragicclothing.co.uk/playlist.html','','scrollbars=yes,width=750,height=10000000')");

btn.addEventListener(MouseEvent.ROLL_OVER, btnOver);
btn.addEventListener(MouseEvent.ROLL_OUT,btnOut);
btn.addEventListener(MouseEvent.CLICK,btnClick);

function btnOver(event:MouseEvent):void{
btn.gotoAndPlay("Over");
}
function btnOut(event:MouseEvent):void{
btn.gotoAndPlay("Out");
}
function btnClick(event:MouseEvent):void{
navigateToURL(Tragic)
}
btn.buttonMode=true;'

.

Base (frame till end) With the Tween

.

Label which has frames up to one before the end where it is named Over and 1 at the end which is named Out

I have given the movie clip (used on Base) the instance name 'btn'

(This has all been done using Adobe Flash CS6)

Thanks

Max

user1806497
  • 65
  • 1
  • 7

2 Answers2

0
stop(); 

stage.addEventListener(MouseEvent.MOUSE_OVER, playMovie); 

function playMovie(event) { play(); }
loxxy
  • 12,990
  • 2
  • 25
  • 56
user1806497
  • 65
  • 1
  • 7
0

Its a problem of focus, add your events on stage instead, like this:

stage.addEventListener(MouseEvent.ROLL_OVER, btnOver);
stage.addEventListener(MouseEvent.ROLL_OUT,btnOut);
stage.addEventListener(MouseEvent.CLICK,btnClick);
simo
  • 23,342
  • 38
  • 121
  • 218