PDA

View Full Version : if statments.....?


defrex
07-06-2001, 07:21 PM
for what i'm doing if staments seem to be what i need, but i can't seem to find a tut to show me how they work/how to use them. could you point me to one? if there is no tut do you think you could help me out?

i have 4 buttons, each plays a clip (well, half a clip). now each clip has 'going away' part, so i can get rid of each section cleanly. is there a way for me to tell the buttons; "if the clip is on frame 30, play the second half of the clip". dose that make sense? i have no idea how if statments work, so any help would be great.



[Edited by defrex on 07-06-2001 at 11:15 PM]

defrex
07-07-2001, 05:35 AM
i think i've figured it out. since i was at a stand still making my site till it figured this out i just kida played with what would seem right (i'm faintly aquanted with javascript). and this is what i came up with:

on (release) {
tellTarget ("_root.links_press") {
if (_currentframe == 40) {
play ();
}
}
tellTarget ("_root.work_press") {
play ();
}
}


it seems to do the job. lett me know if there is some huge mistake in there or somthing that i should know about.
thanx anyway though.

Jesse
07-07-2001, 10:44 AM
that's good but it could be done with better syntax:
on (release) {
if (_root.links_press._currentframe == 40) {
_root.links_press.play();
}
_root.work_press.play();
}
also note the 2nd action (work_press play) isn't in the conditional so it will always execute.. was that intended?

defrex
07-07-2001, 09:09 PM
ya, i want that one to play. thanx alot.