A Flash Developer Resource Site

Results 1 to 14 of 14

Thread: auto hide flv skin problem

  1. #1
    Junior Member
    Join Date
    Apr 2002
    Posts
    8

    auto hide flv skin problem

    I have an FLV in a flash movie of the same dimensions and I have clear controls over the movie with auto hide set to true. if i move my mouse slowly out of the flash movie, it will auto-hide, but if i move my mouse quickly, it will not.

    When it's just the flash swf file alone it works fine, but when the SWF is put into an html page (or just set publish settings to publish an html page) it stays visible when I roll the mouse out quickly.

    Anyone else have this issue?

  2. #2
    Junior Member
    Join Date
    Apr 2002
    Posts
    8

    Help?

    I found that if I make the flash document say 10 pixels wider on each side than the movie (so it creates a 10 pixel border of flash stage around the movie), the auto-hide feature for the controls works perfectly when published to an html page.

    But, unfortunately I need the swf to stay the exact dimensions of the movie (which I thought was the purpose of controls that sit on top of the movie rather than below). Is there a setting somewhere or something that I can change to get auto-hide to work correctly when a user moves their mouse out? Or is there a way I can define somewhere the rollover region in the movie to be smaller?

    Any help is much appreciated. I wonder how sites like metacafe and youtube achieve this without these issues?

  3. #3
    Junior Member
    Join Date
    May 2007
    Posts
    14
    I have this same problem

  4. #4
    Junior Member
    Join Date
    Jul 2007
    Posts
    9
    to make the skin hide... with mouse action... can be done with this:

    vid1.skinAutoHide = true;
    vid1.skinFadeTime =0;

    vid1 being the instance name...

    check this out:

    http://livedocs.adobe.com/flash/9.0/...l#skinFadeTime

    search skin...

  5. #5
    Member
    Join Date
    Jun 2007
    Posts
    46
    Thanks xenoyoke. I've been having this same problem too.

    But after I name the imported flv file "vid1", I put this in the Actions box:

    on (rollOut) {
    vid1.skinAutoHide = true;
    vid1.skinFadeTime =0;
    }

    I get no change in the behavior of the control bar disappearing. When I mouse on and off repeatedly, nothing happens. The control bar stays on.

    However, if I resize the window by dragging it bigger in the usual manner (and create some space around the movie file), then the control bar disappears when I roll off of the video file. This happens with or without the rollOut code (above). This corresponds to what nektir was saying in his earlier posts.

    I wonder what I am doing wrong.

    Thanks!
    CG


    Quote Originally Posted by xenoyoke
    to make the skin hide... with mouse action... can be done with this:

    vid1.skinAutoHide = true;
    vid1.skinFadeTime =0;

    vid1 being the instance name...

    check this out:

    http://livedocs.adobe.com/flash/9.0/...l#skinFadeTime

    search skin...

  6. #6
    Junior Member
    Join Date
    Mar 2008
    Posts
    2

    Same Trouble (FLV skin autohide)

    I'm having the exact same problem you described in this thread. Did you ever get it figured out?

  7. #7
    I have this same problem,too, i can't
    Last edited by ylonghome; 03-16-2008 at 08:08 AM.

  8. #8
    Junior Member
    Join Date
    May 2008
    Posts
    5
    A solution to your problems could be this:

    my flv player is called: mc_player

    the skin I use: ClearOverPlayMute.swf

    I added this piece of action script code to the timeline:

    _root.mc_player.onRollOver = function () {
    _root.mc_player.skin='ClearOverPlayMute.swf';
    }
    _root.mc_player.onRollOut = function () {
    _root.mc_player.skin='';
    }

    The last thing I did was removing the skin of the player, setting it to 'None';

    ------------------------------------

    You can replace mc_player to what ever your player is called(_root. is used to indicated to player is in the top level of the flash file)
    You can replace ClearOverPlayMute.swf with the skin you chose, just make sure the swf of the skin is in the directory as the swf.

    As soon as the mouse will move over the player the skin will appear and moving out the skin will disappear, the speed of the mouse movent doesn't effect the script, so it will always work.

  9. #9
    Junior Member
    Join Date
    May 2008
    Posts
    5
    it turns out the above methode doesn't work however I maybe thoughed of a different methode, will post it as soon as it turns out it works.

  10. #10
    Junior Member
    Join Date
    May 2008
    Posts
    5
    I tried many things, but none of them worked like it was suppose to, either the controls stopped working or the swf became unstable.

    I build the following code, it's like a 50% solution, how I like to call it.
    The script checks if the mouse is active, if the mouse is not active for over 6 seconds it will hide the player controls, when the mouse starts moving in the swf again, the controls will become visable again.

    my flv player is called: mc_player
    the skin I use: ClearOverPlayMute.swf (remember the skin has to be in your map with your swf file)

    code for in a frame:

    lastposX='0';
    lastposY='0';
    i=0;
    mc_player.onEnterFrame = function() {
    if(lastposX==mc_player._xmouse && lastposY==mc_player._ymouse)
    {
    //position is equal to the last position one frame before this,
    //this indicates the mouse has stopped or is out of the flash movie
    i++;
    if(i>72)
    {
    //the position has been on the same spot for more then 72 frames(12 fps), so 6 secs, we can let the controls disappear
    _root.mc_player.skin='';
    }

    }else{
    //the mouse started moving
    lastposX=mc_player._xmouse;//updating the position of the mouse
    lastposY=mc_player._ymouse;//updating the position of the mouse
    i=0;//resetting the counter to 0 so he has to start over again when the mouse stops moving again
    _root.mc_player.skin='ClearOverPlayMute.swf';//show the skin since the mouse in the flash file.
    }

  11. #11
    Junior Member
    Join Date
    Jul 2009
    Posts
    1

    Fix and the problem

    Make a 3-5 pixel buffer zone around the video area. It recognizes the mouse leaving the window every time

  12. #12
    Senior Member
    Join Date
    Apr 2008
    Location
    Nottingham, UK
    Posts
    348
    yep, either that or code a new player from scratch and listen for a mouseout event on the controls themselves...

  13. #13
    i have this problem too - surely there is a way to tell the FLVplayer to hide its skin in a function that gets called on the stage's mouse leave event?

  14. #14
    Junior Member
    Join Date
    Jun 2010
    Posts
    1

    resolved

    The problem is just that the Flash plugin/activex object cannot detect mouse movements outside its little rectangle, so if you move the mouse outside the whole Flash area, the Flash player will act like if the mouse is still in the last position it had inside, so the skin will not do the autohide. I consider this an ugly bug of the FLVPlayback component, and this is the code I used to fix it.

    Code is in AS3, but the idea is simple and can be adapted to AS2 too.

    : : : IMPORTANT : : :
    skinAutoHide of the component must be set to false!!!!!!! Otherwise AS3 will trigger an exception when trying to hide a null skin.



    If you just want to hide the Skin when mouse is out, it is easier:

    Code:
    vpl.skinAutoHide = false;
    
    stage.addEventListener(Event.MOUSE_LEAVE, hideSkin);
    stage.addEventListener(MouseEvent.MOUSE_MOVE, showSkin);
    
    
    function showSkin(evt:Event=null):void {
    	vpl.skinBackgroundAlpha = .01;
    	vpl.skin = "SkinOverPlaySeekMute.swf";
    }
    
    function hideSkin(evt:Event=null):void {
    	vpl.skinBackgroundAlpha = 0;
    	vpl.skin = "";
    }

    If you also want to hide the skin when the cursor is not moving (inside the movie) you should do something like this:



    Code:
    vpl.skinAutoHide = false;
    var LastMouseMove=getTimer();
    var MouseStill=false;
    
    stage.addEventListener(MouseEvent.MOUSE_MOVE,function(ev:MouseEvent) { LastMouseMove=getTimer(); });
    
    var MainCheckLoop=setInterval(function() {
    	if((getTimer()-LastMouseMove)>1000) {
    		if(MouseStill==false) {
    			hideSkin();
    			MouseStill=true;
    		}
    	} else {
    		if(MouseStill==true) {
    			showSkin();
    			MouseStill=false;
    		}
    	}
    },1000);
    
    stage.addEventListener(Event.MOUSE_LEAVE, hideSkin);
    stage.addEventListener(MouseEvent.MOUSE_MOVE, showSkin);
    
    
    function showSkin(evt:Event=null):void {
    	vpl.skinBackgroundAlpha = .01;
    	vpl.skin = "SkinOverPlaySeekMute.swf";
    }
    
    function hideSkin(evt:Event=null):void {
    	vpl.skinBackgroundAlpha = 0;
    	vpl.skin = "";
    }


    Of course you should change SkinOverPlaySeekMute with your favourite skin, and vpl with your video player instance.

    You may also consider hiding the mouse when inside the movie and not moving, but be careful not to hide it in the wrong place/time.

    Francesco

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center