Hi guys
I have a movie clip and I need to insert 3 stop actions. On each of the stop actions, I need to use a timer to wait one second before resuming play.
I can get this working with 1 stop action, by telling the movie clip exactly which frame to resume play on, but because I can't check what frame the movieclip is on, I can't get it to work with more than 1 stop action.
The other issue I'm having is that, I've got a touch event listener on the mc, but I only want it to respond when the mc is between a certain frame range.
- Any way to check the frame I'm on?
- Can I pause and play / where left off
Any other ideas?
Thanks heaps in advance
Comments
Likes: Ninjadoodle
I can't however get it to work ...
I might be using an old version of Gideros ... I'll try to update
self.invader1.mc:gotoAndPlay(1)
self.invader1.mc:getFrame()
stage05.lua:38: attempt to call method 'getFrame' (a nil value)
When I test locally it works fine
When I try testing through the android player, I get this ...
stage05.lua:37: attempt to call method 'getFrame' (a nil value)
stack traceback:
stage05.lua:37: in function 'onBegin'
setupStage.lua:45: in function
Likes: pie
Likes: Ninjadoodle
Fragmenter - animated loop machine and IKONOMIKON - the memory game
Likes: Ninjadoodle
Likes: Ninjadoodle
For me it only return the frame in the desktop player.
Likes: Ninjadoodle
Out and about, but will try when I'm back in front of a computer.
Likes: Ninjadoodle
This example is fully working on Windows player, Android player, and as an installed APK on my Nexus 4.
I'm not sure why your code does not work. If you want me to have a look try to catch me in Skype :bz
Likes: Ninjadoodle
I'm still having the same issue with the android player - can I ask you what your android player says in the top left corner (mine says 2016.6).
I have a feeling that it's an old player, even though I've tried reinstalling the new one twice.
This time, everything works fine ... the only thing that will not work for me is setting a 'stop action', mid animation and then trying to resume using mc:play()
Likes: totebo, antix
I hope that makes sense.
Any code you can share where we could see what is going wrong would be good
Likes: Ninjadoodle
If you use setStopAction( 10 ) you need to clear it before using play() for it to continue. If you don't clear it, the stop action will trigger again when frame 10 has finished playing, and the playhead won't move to the next frame.
Likes: Ninjadoodle
Likes: Ninjadoodle
@antix - One question about the sample code you've attached. Whats the benefit of using Delta Time and OS timer, instead of let's say Timer.delayedCall (which is what I'm using)?
Thanks
deltaTime based timers are IMHO more efficient (somebody please correct me if I'm wrong)
Likes: Ninjadoodle
1. If you have just one gameloop using ENTER_FRAME (that is used for all animation etc) you can easily pause the game when needed. This is very useful.
2. If you use only ENTER_FRAME you can be sure everything is updated at the same time. Timer is not precise and can skip frames or two could happen within one frame. In practice this can lead to issues where tweens lag behind or skip frames, for example. Timers are great, but don't rely on them to manipulate graphics.
Likes: antix, Ninjadoodle