Copy link to clipboard
Copied
i created some swf loading a flv file in a flv playback and check on the auto/hide parameter. When i test the movie it works very well. BUT, in my website, i put those swf files in Lightbox (javascript computed) and when the mouse goes Over the flash video, it shows the Skin player and when the mouse goes Out, the Skin player stays over the video!? Why? Does someone has an idea on how to force the auto/hide paramater in this case?
Thanks for your help
Orlenka
1 Correct answer
Found this post when searching for an answer, but didn't find much elsewhere so I'll post my quick and ugly solution here. I'm sure it can be vastly improved, but I didn't have much more than 5 minutes. Note - setting .visible to false just ended up causing the autohide transition to occur over and over, so instead I'm just temporarily moving the whole sprite offscreen.
(AS3, using CS5 component... note that 'player' is the FLVPlayback instance):
//### force 'autohide' when mouse inactive
var time
...Copy link to clipboard
Copied
Or maybe is there other Action Script 3 tricks? please help, thanks
Copy link to clipboard
Copied
To see the problem, may be goes to : www.remedia.lu
Copy link to clipboard
Copied
Found this post when searching for an answer, but didn't find much elsewhere so I'll post my quick and ugly solution here. I'm sure it can be vastly improved, but I didn't have much more than 5 minutes. Note - setting .visible to false just ended up causing the autohide transition to occur over and over, so instead I'm just temporarily moving the whole sprite offscreen.
(AS3, using CS5 component... note that 'player' is the FLVPlayback instance):
//### force 'autohide' when mouse inactive
var timer:Timer = new Timer(1500, 0);
timer.addEventListener(TimerEvent.TIMER, onTimer);
timer.start();
var skinSprite:DisplayObject;
var prevMouseX:Number;
var prevMouseY:Number;
function onTimer(e:TimerEvent):void {
//get skinSprite if we haven't already
if(!skinSprite) {
var child:DisplayObject;
for(var i:Number = 0; i < player.numChildren; i++) {
child = player.getChildAt(i);
if(i == 2) { //this is the skinSprite
skinSprite = child;
}
}
}
//check to see if mouse hasn't moved since last timer event
if(skinSprite && mouseX == prevMouseX && mouseY == prevMouseY) {
skinSprite.y = -1000;
}
prevMouseX = mouseX;
prevMouseY = mouseY;
}
stage.addEventListener(MouseEvent.MOUSE_MOVE, stage_onMouseMove);
function stage_onMouseMove(e:MouseEvent):void {
if(skinSprite) {
skinSprite.y = 0;
}
}
Copy link to clipboard
Copied
You sir rock. This works perfectly.

