brendanb
03-18-2005, 02:00 PM
Here is my code:
_global.main1=0;
_global.main2=0;
function increaseVar(addToThis){
addToThis+=1;
}
btn1.onRelease=function(){
increaseVar(_global.main1);
}
btn2.onRelease=function(){
increaseVar(_global.main2);
}
I want different variables to increase based on pressing different buttons. I am very confused as to why this won't work. Any help would be appreciated!
Thanks,
Brendan
_global.main1=0;
_global.main2=0;
function increaseVar(addToThis){
addToThis+=1;
}
btn1.onRelease=function(){
increaseVar(_global.main1);
}
btn2.onRelease=function(){
increaseVar(_global.main2);
}
I want different variables to increase based on pressing different buttons. I am very confused as to why this won't work. Any help would be appreciated!
Thanks,
Brendan