shish101shish101

Main News Games Favorites Reviews Stats
Add to Favorites

Contact Info / Websites

Entry #1

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

1/9/10 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.


LORRDVID LORRDVID

2/7/10

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;
}