Contact Info / Websites

Entry #1

How to code a button using functions..PLEASE HELP,

2010-01-09 22:15:22 by shish101

OK CAN someone tell me whats wrong with this...

function correct(){
score+=1
nextFrame()
correctans._visible=true

}
function wrong(){
nextFrame()
wrongans._visible=true
}

right_btn.onRelease= correct;
wrong_btn1.onRelease= wrong;
wrong_btn2.onRelease= wrong;
wrong_btn3.onRelease= wrong;

when i click the buttons(which i instance named accordingly) nothing happens..
-i want function correct to execute when i press right_btn.........................this code is place on the 1st frame


Comments

You must be logged in to comment on this post.


LORRDVIDLORRDVID

2010-02-07 17:09:06

Well, i think this u problem:

function correct(){
score+=1
nextFrame()
correctans._visible=true

}
function wrong(){
nextFrame()
wrongans._visible=true
}

// Here is u mistake

right_btn.onRelease = function(){
correct;
}
wrong_btn1.onRelease = function(){
wrong;
}
wrong_btn2.onRelease = function(){
wrong;
}
wrong_btn3.onRelease = function(){
wrong;
}