Jump to content

passing objectreferenz in functionparameter?


Rocco
 Share

Recommended Posts

function create() {..       stone_1.events.onInputDown.add(roc_start_anim, this);   // This works as expected    stone.events.onInputDown.add(roc_start_anim, stone_1);  // no error and the function is called, but the animation do not start}function roc_start_anim(st) {        st.animations.play('pulse');    text.text = "In roc_start_animate";}  

I think this is more a javascript newbie question.

 

Can someone tell me why this -> stone.events.onInputDown.add(roc_start_anim, stone_1);

isn't working proberly regardless if i define stone_1 outside or inside the create function?

 

 

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...