I'm building an application where the user needs to double-click to load a new movie.
The code works for one button (buttonA) but i'm not sure how to loop it so that button B, button C, button D etc all do the same thing (but pass a different specified variable). I've tried repeating the code, but changing buttonA to button B but but i think there may be a clash of variables or something.
This is the code (it goes in frame 1 of the actions layer)
------------------------------
//set initial variables
click = false;
//function for the button press
buttonA.onPress = function() {
//if this is the first click
if (!click) {
timer = getTimer()/1000;
_root.click = true;
}
else {
timer2 = getTimer()/1000;
//if it is a double click
if ((timer2-timer)<.25) {
//load movie and pass variables
loadVariables("exemplar_variables.txt", "_root.target")
loadMovie("answers.swf",target);
_root.frame = 1;
} else {
timer = getTimer()/1000;
_root.click = true;
}
}
};
-----------------------------------------
Thanks
E
The code works for one button (buttonA) but i'm not sure how to loop it so that button B, button C, button D etc all do the same thing (but pass a different specified variable). I've tried repeating the code, but changing buttonA to button B but but i think there may be a clash of variables or something.
This is the code (it goes in frame 1 of the actions layer)
------------------------------
//set initial variables
click = false;
//function for the button press
buttonA.onPress = function() {
//if this is the first click
if (!click) {
timer = getTimer()/1000;
_root.click = true;
}
else {
timer2 = getTimer()/1000;
//if it is a double click
if ((timer2-timer)<.25) {
//load movie and pass variables
loadVariables("exemplar_variables.txt", "_root.target")
loadMovie("answers.swf",target);
_root.frame = 1;
} else {
timer = getTimer()/1000;
_root.click = true;
}
}
};
-----------------------------------------
Thanks
E