Make Buttons disappear

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Maril
    New Member
    • Jul 2007
    • 2

    Make Buttons disappear

    Hi I'm a beginner in Flash and I was wondering if it's possible, for example :

    if you have 4 buttons on a page, that when the mouse is over one button, that the others disappear(fade out) and reappear on mouse out?

    Thanks to any help I can get!

    Maril
  • ghostface
    New Member
    • Jul 2007
    • 13

    #2
    Hi Maril,

    Yes it is possible. You just have to put your button inside a movieclip first so you can access it dynamically.

    Example:

    Create your four buttons, now create a movieclip, place the first button there and name the movieclip btn01. Then create another movieclip, place the second button there and name it btn02. Repeat the steps with the other buttons.So now, you have four buttons and four movieclips. Your movieclip's name should be: btn01,btn02,btn 03,btn04. Place the four movieclips on your workarea.

    We now have all the objects we need. Let's start coding.

    1. Double Click on btn01, It will open the MovieClip, now on the button itself. Put this:

    on(RollOver)
    {
    _root.btn02.alp ha=0;
    _root.btn03.alp ha=0;
    _root.btn04.alp ha=0;
    }
    on(RollOut)
    {
    _root.btn02.alp ha=100;
    _root.btn03.alp ha=100;
    _root.btn04.alp ha=100;
    }

    2.Now go back to your main scene. DoubleClick on btn02. On the Second Button put this:
    on(RollOver)
    {
    _root.btn01.alp ha=0;
    _root.btn03.alp ha=0;
    _root.btn04.alp ha=0;
    }
    on(RollOut)
    {
    _root.btn01.alp ha=100;
    _root.btn03.alp ha=100;
    _root.btn04.alp ha=100;
    }
    3.For the Third button:
    on(RollOver)
    {
    _root.btn01.alp ha=0;
    _root.btn02.alp ha=0;
    _root.btn04.alp ha=0;
    }
    on(RollOut)
    {
    _root.btn01.alp ha=100;
    _root.btn02.alp ha=100;
    _root.btn04.alp ha=100;
    }
    4.And lastly:
    on(RollOver)
    {
    _root.btn01.alp ha=0;
    _root.btn02.alp ha=0;
    _root.btn03.alp ha=0;
    }
    on(RollOut)
    {
    _root.btn01.alp ha=100;
    _root.btn02.alp ha=100;
    _root.btn03.alp ha=100;
    }
    5. Run it and see if it works for you.

    Well, That's kinda long.. hehe.. Try it first if it works. Hope this helps.

    Comment

    • Maril
      New Member
      • Jul 2007
      • 2

      #3
      Thanks a lot, I'll try that!

      CIAO CIAO! Maril

      Comment

      • rsjpx
        New Member
        • Jul 2007
        • 1

        #4
        Hi,

        Do you happen to know how to remove flash video swf from HTML code after it plays or after a user clicks on the close button? I created a transparent flash swf file. I created the close button and it stops and clears the screen. After the movie plays, I want it to somehow be removed, otherwise hyperlinks in the page “behind” the transparent movie will not function, and this will cause problems with clients’ sites. I refer to www.rovion.com, if you place their movie over working hyperlinks, they will not be available during playback, but it become available after the movie is unloaded.

        If you know of any links to sources, please help me :*(
        Thank in advance,
        rsjpx

        Comment

        • ghostface
          New Member
          • Jul 2007
          • 13

          #5
          Hi rsjpx,

          I'll just clear if I get what you're trying to do.You have an swf file embedded on your html page. You want it to disappear from your html page when it is over or you click a link/button.. is this correct? simplest way is to hyperlink to a dummy page which displays the same contents except the swf file. Another is through ASP. When the page loads, it checks a certain variable before it displays the swf file. Example:

          <%
          if temp=0 then
          response.Write( "<embed src=""yourswfhe re.swf"">")
          end if
          %>

          Now by default, the value of temp is automatically 0. So it will play your swf movie. Question is how you turn this temp to any number so the movie will not display.

          <%
          response.Write( "<a href=""youasphe re.asp?value=1 "">Hide Movie </a>")
          %>
          The link will give a value of 1. Now we try to retrieve it to our asp page.

          Put the codes below, before the "if" statement

          reqValue=Reques t.QueryString(" value")
          conValue=round( reqValue,1)
          temp=conValue

          We retrieve the QueryString which contains the value 1. Now we convert it to a number/round it so it will not conflict our "IF" statement. And pass the it to our temp variable. When it enters the "IF" statement, it will not display the swf anymore.

          Final code should look like this.

          <%

          reqValue=Reques t.QueryString(" value")
          conValue=round( reqValue,1)
          temp=conValue

          if temp=0 then
          response.Write( "<embed src=""yourswfhe re.swf"">")
          end if
          %>
          <%
          response.Write( "<a href=""youasphe re.asp?value=1 "">Hide Movie </a>")
          %>

          Hope it helps. Btw, this should rather be on the ASP topic.

          Comment

          Working...