Quick Links: Gideros Home | Download Gideros | Developer Guide
How to check which frame is in the MovieClip?
  • Greetings,
    I have the following doubt. I'm doing a program in which every time I click on the screen a MovieClip is added to the stage and its animation is executed.

    Minah doubts how do I check that MovieClipe has reached the last frame of the animation so that I can perform my playlist, memory and screen removal procedures?

    Does anyone know if there is a native MovieClip method to know if the animation has reached its last frame?

    Thank you
  • pie +1 -1 (+1 / -0 )
    Member
    @kinrpg yes, there is event complete, however I think it will be casted even on stop action

    http://docs.giderosmobile.com/reference/gideros/MovieClip/Event.COMPLETE

    Likes: kinrpg

  • pie said:

    @kinrpg yes, there is event complete, however I think it will be casted even on stop action

    http://docs.giderosmobile.com/reference/gideros/MovieClip/Event.COMPLETE



    Nice,
    So does this event run every time the animation stops?
    Exactly what I needed.

    Forgive my amateur, but what is the right way to use the event?

    a) MovieClip[x]:addEventListener(Event.COMPLETE, function)

    b) stage:addEventListener(MovieClip[x].Event.COMPLETE, function)

    Or are they both wrong? I have read the documentation several times and I still have doubts.

    Tnx
  • pie +1 -1 (+2 / -0 )
    Member
    a) MovieClip[x]:addEventListener(Event.COMPLETE, function)
    but I won't use the word MovieClip to name a table, it would overwrite MovieClip class :)

    you can use almost anything else
    mclips[x]:addEventListener(Event.COMPLETE, function)

    Likes: kinrpg, antix

  • kinrpgkinrpg +1 -1 (+1 / -0 )
    Member
    pie said:

    a) MovieClip[x]:addEventListener(Event.COMPLETE, function)
    but I won't use the word MovieClip to name a table, it would overwrite MovieClip class :)

    you can use almost anything else
    mclips[x]:addEventListener(Event.COMPLETE, function)



    Now I understood why it was not working.
    Thank you for your help :)

    Likes: antix

  • Also, a new method called MovieClip:getFrame() is now available (but not yet documented I believe).
    My Gideros games: www.totebo.com

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