dcsimg
A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Help with hiding a control bar in flash

  1. #1
    Junior Member
    Join Date
    Jan 2010
    Posts
    4

    Help with hiding a control bar in flash

    I have a flv playback compotent and I created a control bar with play and pause button. I would like to hide the bar until the mouse rolls over it and then it would appear for a few seconds and then hide again. Much like the skin effect, but I'm not using the skins. If someone could take a look at the file http://www.impactspokesperson.com/downloads/miranda.zip and walk me through how to code it, I would appreciate it. Thanks

  2. #2
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    First of all your bar is a graphic but needs to be a Movieclip. When I changed that and tested the movie once I got an error since impact is not defined.

    Here is the code to hide and show the bar. I don't know what you mean with skin effect.
    bar.addEventListener (MouseEvent.MOUSE_OVER, onMouseOver);
    bar.addEventListener (MouseEvent.MOUSE_OUT, onMouseOver);
    function onMouseOver (e:MouseEvent):void
    {
    if(e.type == "mouseOver")
    {
    e.currentTarget.alpha = 1;
    }
    else
    {
    e.currentTarget.alpha = 0;
    }
    }
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  3. #3
    Junior Member
    Join Date
    Jan 2010
    Posts
    4
    Quote Originally Posted by cancerinform View Post
    First of all your bar is a graphic but needs to be a Movieclip. When I changed that and tested the movie once I got an error since impact is not defined.
    Ok, I am new at flash programming... Let me see if I understand you. I need to create the bar as a movie clip and I need to define impact. Creating the movie clip I understand. Will the control bar sit on a new layer? or will I just drop it on the stage on the layer that has the flv playback component? Secondly, will I need to give the bar movie clip an instance name? As far as defining impact which is a link... you will have to walk me through that as well. Thanks

  4. #4
    Mod cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    All you need to is open the library, right-click on the bar icon and change graphic to Movieclip in the menu. Then you click on the bar in the movie and do the same in the prop inspector.
    It is generally better to have items distributed in different layers.
    You need to give an instant name. If you write impact you need to have an object with that name somewhere or you get errors.
    - The right of the People to create Flash movies shall not be infringed. -
    | www.Flashscript.biz | Flashscript Biz Classes/Components |

  5. #5
    Junior Member
    Join Date
    Jan 2010
    Posts
    4
    ok... I have done that and for testing purposes, I removed the code:
    impact.addEventListener(MouseEvent.CLICK, onMouseClick);
    function onMouseClick(e:MouseEvent):void
    {
    var url:URLRequest = new URLRequest("http://www.impactspokesperson.com");
    flash.net.navigateToURL(url,"_blank");
    }

    This was a button...
    Anyways, I converted bar graphic clip to movie clip and gave it the instance name of bar_mc and I added the code,

    bar_mc.addEventListener (MouseEvent.MOUSE_OVER, onMouseOver);
    bar_mc.addEventListener (MouseEvent.MOUSE_OUT, onMouseOver);
    function onMouseOver (e:MouseEvent):void
    {
    if(e.type == "mouseOver")
    {
    e.currentTarget.alpha = 1;
    }
    else
    {
    e.currentTarget.alpha = 0;
    }
    }

    I tested the clip and it works. The control bar will appear until I put my mouse over it and then it will hide. But now my play / pause button and mute button don't work. We I have to hard code that into the script as well?

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