Discuz! Board

 

 

Search
Discuz! Board Forum Integration Questions cant get button events to work
View: 446|Reply: 1
go

cant get button events to work

Rank: 2

Post on 2011-10-9 11:19 |All posts
I know im asking a lot of questions, just want to get this demo released but i keep running into walls.  for some reason this wont work for me:

  1. var scene = getscene();   

  2. scene.setevent(EVENT_KEYDOWN,onback);
  3. function onback(node,event,param,keycode){

  4.         quitgame();
  5.    
  6. }
Copy


any ideas of what im doing wrong, i want to be able to go back from menu to menu, but i cant even get an even to close the game with any button press key_down works in the demo script but not here for some reason ive only got 2 more things  to go (backwards menu navigation and button screenshot taking) before i can release my demo and screens and this is needed for both


Rank: 2

Post on 2011-10-12 06:43 |All posts
You might wanna set focus on scene.  that happened to me also, but setting focus did it.
try 'scene.focus(1);'

let me know if this work
Security Q&A Change Security code Change

Archiver|Comsenz Inc.

All time is GMT+8, 2013-5-22 05:54 , Processed in 0.029142 second(s), 10 queries .

Powered by Discuz! X1.5

© 2001-2010 Comsenz Inc.