Quick Links: Gideros Home | Download Gideros | Developer Guide
Removing sprite after a delay question (something like bind in js?)
  • Hi guys

    I'm trying to remove a sprite using a tweens onComplete function. I'm not sure how to make the function retain the correct reference to that sprite, so it doesn't throw an error when there are a few sprites on the screen.

    In javascript, I think you would use bind()?

    Any help would be awesome :)

    Thank you!
  • pie +1 -1
    Member Accepted Answer
    Theoretically I think that as long as the sprite belongs to the same scope of the tween it should retain the correct reference .
    Another option could be to use a single global table where every entry is a reference to a sprite you may need to remove. It's not cool to use global vars, but in this scenario you would get rid of it as soon as you no longer need it.
  • Hi @pie

    I think you're right, it seems to retain a reference to it :) I was worried it wouldn't work but after testing, everything is fine :)

    Thanks for the help!

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Login with Facebook Sign In with OpenID

In this Discussion

Top Posters