Home :: Forums :: Downloads :: Shop

Flash Advanced Buttons using variables

  Post new topicReply to topicPrintable Version
<< View previous topic View next topic >>
Share: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb   More...
#1Tue Jan 18, 2005 8:38 am   Flash Advanced Buttons using variables
asgsoft
CZ Super Newbie
asgsoft has been a member for over 9 year's 9 Year Member
egypt.gif
Status: Offline
Joined: Dec 12, 2004
0.01 posts per day
Posts: 30
Points: 1,122
   
how can i make a button that when you click on it it loads a movie into a specified loaction and when you click on the button again the movie is unloaded? i know it can be done by variable but the problem is how



Back to top Reply with quote
#2Wed Jan 19, 2005 5:36 pm   re: Flash Advanced Buttons using variables
bpat1434
CZ Newbie
bpat1434 has been a member for over 9 year's 9 Year Member
usa.gif maryland.gif
Occupation: EMT, Community Assistant, Webmaster, Firefighter, Web Host
Age: 30
Website: www.xraidershosting.com
Status: Offline
Joined: Jan 19, 2005
0.01 posts per day
Posts: 21
Points: 783
AIM Address Yahoo Messenger MSN Messenger 
This is really quite easy.

I'm assuming you can correctly create a button.

Open the Action Script Editor. Then create a variable (I'll call it $var1).

Then you assign it an initial value for when the movie starts:
$var1 = 0;

Now, select the button and add the following:

on(release){
if($var1=='0'){
holder_mc.loadMovie("movie1.swf");
$var1 = '1';
}
else{
$var1 = '0';
holder_mc.loadMovie("movie2.swf");
}
}

Then test your movie. It should work, I may have my action script mixed up with php, but I'm pretty sure that's correct. Your editor has to be in the non-automated mode (Expert Mode).

Hope I helped you.

~Brett

I've attached the fla file so you can see it. It includes the two small movie clips that you need to export prior to viewing. And you'll be able to view it here as well: [ Register or login to view links on this board. ]




movie2.swf
 Description:
N/A
 Filesize:  885 Bytes
 Viewed:  7156 Time(s)





movie1.swf
 Description:
N/A
 Filesize:  883 Bytes
 Viewed:  7156 Time(s)





test.swf
 Description:
N/A
 Filesize:  6.05 KB
 Viewed:  7156 Time(s)






Back to top Reply with quote
#3Tue Jan 25, 2005 7:01 pm   re: Flash Advanced Buttons using variables
asgsoft
CZ Super Newbie
asgsoft has been a member for over 9 year's 9 Year Member
egypt.gif
Status: Offline
Joined: Dec 12, 2004
0.01 posts per day
Posts: 30
Points: 1,122
   
how do u download the file. by the way that what i want thanks alot



Back to top Reply with quote
#4Tue Jan 25, 2005 7:07 pm   re: Flash Advanced Buttons using variables
bpat1434
CZ Newbie
bpat1434 has been a member for over 9 year's 9 Year Member
usa.gif maryland.gif
Occupation: EMT, Community Assistant, Webmaster, Firefighter, Web Host
Age: 30
Website: www.xraidershosting.com
Status: Offline
Joined: Jan 19, 2005
0.01 posts per day
Posts: 21
Points: 783
AIM Address Yahoo Messenger MSN Messenger 
I have no idea..... I'll try and attach it again....

~Brett

Then again, I guess I can't add that as an attachment. I'll just upload the FLA and give you a direct link.

[ Register or login to view links on this board.]



Back to top Reply with quote
#5Sun Mar 06, 2005 8:02 am   
asgsoft
CZ Super Newbie
asgsoft has been a member for over 9 year's 9 Year Member
egypt.gif
Status: Offline
Joined: Dec 12, 2004
0.01 posts per day
Posts: 30
Points: 1,122
   
so what is wrong with this code now

on (release) {
if ($line == '0') {
_root.whiteline._visible= false
$line = '1';
} else {
$line == '1';
_root.whiteline._visible= true

}
}


I have set the variables in the frame



Back to top Reply with quote
Display posts from previous:      
Add To: Del.icio.us  Digg  Google  Spurl  Blink  Furl  Y! MyWeb   More...
<< View previous topic View next topic >>
Post new topicReply to topic

Jump to 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum