Connecting Tech Pros Worldwide Help | Site Map

Make Buttons disappear

Maril's Avatar
Newbie
 
Join Date: Jul 2007
Posts: 2
#1: Jul 17 '07
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
Newbie
 
Join Date: Jul 2007
Posts: 14
#2: Jul 18 '07

re: Make Buttons disappear


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,btn03,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.alpha=0;
_root.btn03.alpha=0;
_root.btn04.alpha=0;
}
on(RollOut)
{
_root.btn02.alpha=100;
_root.btn03.alpha=100;
_root.btn04.alpha=100;
}

2.Now go back to your main scene. DoubleClick on btn02. On the Second Button put this:
on(RollOver)
{
_root.btn01.alpha=0;
_root.btn03.alpha=0;
_root.btn04.alpha=0;
}
on(RollOut)
{
_root.btn01.alpha=100;
_root.btn03.alpha=100;
_root.btn04.alpha=100;
}
3.For the Third button:
on(RollOver)
{
_root.btn01.alpha=0;
_root.btn02.alpha=0;
_root.btn04.alpha=0;
}
on(RollOut)
{
_root.btn01.alpha=100;
_root.btn02.alpha=100;
_root.btn04.alpha=100;
}
4.And lastly:
on(RollOver)
{
_root.btn01.alpha=0;
_root.btn02.alpha=0;
_root.btn03.alpha=0;
}
on(RollOut)
{
_root.btn01.alpha=100;
_root.btn02.alpha=100;
_root.btn03.alpha=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.
Maril's Avatar
Newbie
 
Join Date: Jul 2007
Posts: 2
#3: Jul 18 '07

re: Make Buttons disappear


Thanks a lot, I'll try that!

CIAO CIAO! Maril
Newbie
 
Join Date: Jul 2007
Posts: 1
#4: Jul 23 '07

re: Make Buttons disappear


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
Newbie
 
Join Date: Jul 2007
Posts: 14
#5: Jul 24 '07

re: Make Buttons disappear


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=""yourswfhere.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=""youasphere.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=Request.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=Request.QueryString("value")
conValue=round(reqValue,1)
temp=conValue

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

Hope it helps. Btw, this should rather be on the ASP topic.
Newbie
 
Join Date: Sep 2008
Posts: 3
#6: Sep 26 '08

re: Make Buttons disappear


Hey,

I would like to know how to make a button dissapear after it has been clicked using actionscript 2

i no it has something to do with onRelease

but not sure on the rest!
HELP!!!

NAble Sea
Reply