Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Pause and resume movieclip animation ? — Gideros Forum

Pause and resume movieclip animation ?

Paulo777Paulo777 Member
edited March 2018 in User experience
Hii
I'm having a mind-blowing issue. I tried to 'pause' and 'resume' a movie clip animation and I wonder if there is a way to do this and if this exists on Movieclip class? Because I tried everything and nothing worked! Absolutely nothing! There is few methods like play, stop, setGotoAction, etc and nothing of it was suitable and useful for my needs... I tried to set a goto action, it plays constantly, but if I don't set a goto action and set this later it simply doesn't works... this remain static. If a set a goto action and stop action, when I play, It simply plays one frame... don't understand that once I set a goto action, it should understand that it is inside a loop, not only a single frame... if I set a goto action then play also nothing works... Will I actually have to create my own animation method using enterframe events? Because I simply can't get it to work with movieclip.

Thanks in advance
Tagged:

Comments

  • olegoleg Member
    Accepted Answer

    num = MovieClip:getFrame(frame)

    MovieClip:stop()


    MovieClip:gotoAndPlay(num)

    Likes: Paulo777, antix

    my games:
    https://play.google.com/store/apps/developer?id=razorback456
    мій блог по гідерос https://simartinfo.blogspot.com
    Слава Україні!
    +1 -1 (+2 / -0 )Share on Facebook
  • oleg said:


    num = MovieClip:getFrame(frame)

    MovieClip:stop()


    MovieClip:gotoAndPlay(num)

    Hii @oleg thanks for your attention! I'll try it when I get home :smiley:
  • Paulo777Paulo777 Member
    edited March 2018
    Hello! @oleg Now it worked! I've set a boolean flag initially to false and when It gets to the place to play, set the flag to true that it may not enter and play every frame
    --init function
    movieclip:setgotoaction(100,1)
    movieclip:stop
    self.play = false
    ................
     
    --enter frame event
     
    if not self.play then
    	self.movieclip:gotoAndPlay(1)
    	self.play = true
    end
    Thanks over again for the help

    Likes: Apollo14, antix

    +1 -1 (+2 / -0 )Share on Facebook
Sign In or Register to comment.