Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Is there any way of knowing that a looping movie clip has reached a given frame? — Gideros Forum

Is there any way of knowing that a looping movie clip has reached a given frame?

petecpetec Member
edited February 2013 in General questions
I've got a looping animation using code similar to this:
self.anim = MovieClip.new{
	{1, 10, self.animFrames[1]},			
	{11, 20, self.animFrames[2]}
	}
self.anim:setGotoAction(20, 1)
I want to trigger a sound every time the loop starts (so on frame 1 of the animation). Is there any way of doing this? If so, can it be used to trigger on any frame of the animation (e.g. if I wanted to trigger a sound on frame 5)?

Thanks
Pete

Comments

  • techdojotechdojo Guru
    Accepted Answer
    Not with the existing system.

    The only way to do this would be to create a new class that wraps lists of smaller movie clips that you'd chain together in a seemless sequence, however you'd then be able to pickup the end of a smaller sequence (using the COMPLETE event), trigger whatever event you wanted (sound effects etc) and then continue the sequence.

    Alternatively you could create a new class that was inspired by MovieClip and had these extra features.

    Sorry I couldn't be of any more help.
    WhiteTree Games - Home, home on the web, where the bits and bytes they do play!
    #MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
  • @techdojo - Thanks for the reply and the suggestion. As the animation starts with a touch event I may just fudge it in this case by using a timer to play the sound at the correct time.
  • No worries, that should work, but won't be very responsive to changes. Does the TNT animator library give you that flexibility?
    WhiteTree Games - Home, home on the web, where the bits and bytes they do play!
    #MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
  • I agree that it will be a pain if I change things, but luckily it is in a very simple situation so I think it will be OK. I don't know about TNT animator library as I've not played with it. I'll take a look sometime.
Sign In or Register to comment.