shootorial


theres piece of code on shootorial (a tutorial making game) is

_root.gameovermenu.playagainbutton.onpress=function()           {                _root.ship.newgame();           } 

should same thing write

_root.gameovermenu.playagainbutton.onpress=_root.ship.newgame()  

well, isnt same thing because game doesnt work if change it, why?

you're calling function when code executes , not when object pressed.  try:

 


 

_root.gameovermenu.playagainbutton.onpress=_root.ship.newgame; 


More discussions in ActionScript 1 and 2


adobe

Comments

Popular posts from this blog

CS5 Adobe Media Encoder: Encode failed because the source duration is nil.

cf_sql_integer vs cf_sql_bigint vs cf_sql_int??

localhost/joomla15/administrator doesnt work - Joomla! Forum - community, help and support