shaoSTYL3
07-22-2003, 02:40 AM
I started using Flash MX about 2 or 3 days ago.
I went through all the 'lessons' and have a good grasp of how to navigate with the program's GUI. After completing the puzzle piece tutorial, I decided to make a script of my own. I planned a simple script, just one with an animation in the background with music playing and a button that would start and stop said music. It turns out this simple sounding script is too much for me :(
here's what i wrote... the script for frame1
status = true;
sound.attachSound(tranzy);
_root.tranzy.start
if (status=true) {
msg = "Stop Music";
} else {msg = "Start Music";
}
the script for my sole button
on (release) {
if (status=true) {tranzy.stop();
} else {
tranzy.start();
status = false;
}
}
i'll try explaining what i was thinking if this looks like crap to all of you experts :D
the variable msg is for a dynamic text box that is on top of the button (so that it says either stop music or start music). status is a boolean for whether or not the music is playing. In my library, i have a wav that i named tranzy (in the linkage as well as in library), which is why i tried "_root.tranzy.start" (to play it from the very beginning).
Now as for the button's scripting... it should be pretty self-explanatory. Assuming that the music is already playing when the program starts (which it doesn't), clicking the button would turn it off if status were true and turn it off if status were false. That's what i planned for it to do, but it doesn't do anything at all.
Can someone help me at all? If you don't feel like taking the time to explain, could anyone at least upload a sample .fla with a button that starts/stops sound that i could look at?
lastly, if you need anymore information about my .fla that could help you help me, let me know.
Thanks...
I went through all the 'lessons' and have a good grasp of how to navigate with the program's GUI. After completing the puzzle piece tutorial, I decided to make a script of my own. I planned a simple script, just one with an animation in the background with music playing and a button that would start and stop said music. It turns out this simple sounding script is too much for me :(
here's what i wrote... the script for frame1
status = true;
sound.attachSound(tranzy);
_root.tranzy.start
if (status=true) {
msg = "Stop Music";
} else {msg = "Start Music";
}
the script for my sole button
on (release) {
if (status=true) {tranzy.stop();
} else {
tranzy.start();
status = false;
}
}
i'll try explaining what i was thinking if this looks like crap to all of you experts :D
the variable msg is for a dynamic text box that is on top of the button (so that it says either stop music or start music). status is a boolean for whether or not the music is playing. In my library, i have a wav that i named tranzy (in the linkage as well as in library), which is why i tried "_root.tranzy.start" (to play it from the very beginning).
Now as for the button's scripting... it should be pretty self-explanatory. Assuming that the music is already playing when the program starts (which it doesn't), clicking the button would turn it off if status were true and turn it off if status were false. That's what i planned for it to do, but it doesn't do anything at all.
Can someone help me at all? If you don't feel like taking the time to explain, could anyone at least upload a sample .fla with a button that starts/stops sound that i could look at?
lastly, if you need anymore information about my .fla that could help you help me, let me know.
Thanks...