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  
#1   Flash Advanced Buttons using variables
asgsoft
CZ Super Newbie
asgsoft has been a member for over 19 year's 19 Year Member
egypt.gif
Gender: Male
Status: Offline
Joined: Dec 12, 2004
0.00 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
#2   re: Flash Advanced Buttons using variables
bpat1434
CZ Newbie
bpat1434 has been a member for over 19 year's 19 Year Member
usa.gif maryland.gif
Occupation: EMT, Community Assistant, Webmaster, Firefighter, Web Host
Age: 40
Gender: Male
Website:
Status: Offline
Joined: Jan 19, 2005
0.00 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:  13501 Time(s)





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





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






Back to top Reply with quote
#3   re: Flash Advanced Buttons using variables
asgsoft
CZ Super Newbie
asgsoft has been a member for over 19 year's 19 Year Member
egypt.gif
Gender: Male
Status: Offline
Joined: Dec 12, 2004
0.00 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
#4   re: Flash Advanced Buttons using variables
bpat1434
CZ Newbie
bpat1434 has been a member for over 19 year's 19 Year Member
usa.gif maryland.gif
Occupation: EMT, Community Assistant, Webmaster, Firefighter, Web Host
Age: 40
Gender: Male
Website:
Status: Offline
Joined: Jan 19, 2005
0.00 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
#5   
asgsoft
CZ Super Newbie
asgsoft has been a member for over 19 year's 19 Year Member
egypt.gif
Gender: Male
Status: Offline
Joined: Dec 12, 2004
0.00 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  
<< 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