Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Play a Movieclip only once — Gideros Forum

Play a Movieclip only once

DikkesnoekDikkesnoek Member
edited February 2014 in General questions
Hello,

I've tried the different methods on a Movieclip object. I have 10 sprites
and want to stop it there (this one is transparent). I also tried the
event handler but this didn't work.

First I defined:

explosionMovieClip:setGotoAction(10 * frameMultiplier, 1)
explosionMovieClip:setPosition(-100, -100) -- Off screen.
explosionMovieClip:stop()
stage:addChild(explosionMovieClip)

At a collission (onBeginContact) I do:

explosionMovieClip:gotoAndPlay(1)

The movie is starting over and over again.

Thanks,

Marc

Comments

  • Hi, tries to stop it in the selected frame:

    movieclip:setStopAction(numberframe)
  • Hi,

    Thanks, this didn't work:

    explosionMovieClip:setGotoAction(10 * frameMultiplier, 1)
    explosionMovieClip:setPosition(-100, -100) -- Off screen.
    explosionMovieClip:stop()
    explosionMovieClip:setStopAction(10)
    stage:addChild(explosionMovieClip)

    and this didn't work too:

    explosionMovieClip:gotoAndPlay(1)
    explosionMovieClip:setStopAction(10)

    At every collision, I need to restart the 10 frames Movieclip.
    So it starts with a first sprite and it ends at frame 10 with
    a empty transparent sprite. I think that you could do it by
    checking the array but I thought that it could be simpler.

    Regards,

    Marc
  • Try this:

    explosionMovieClip:setGotoAction(10 * frameMultiplier, 1)
    explosionMovieClip:setPosition(-100, -100)
    explosionMovieClip:setStopAction(10 * frameMultiplier)
    stage:addChild(explosionMovieClip)

  • That works great, thanks. Forgot that you have to
    think in videoframes.

    Marc
  • @Dikkesnoek what actually makes a loop is this line
    explosionMovieClip:setGotoAction(10 * frameMultiplier, 1)

    which says when you reach frame 10 * frameMultiplier then go to frame 1

    just so you know :)
Sign In or Register to comment.