OnSuspend and OnResume for Flash?

Monkey Targets Forums/Flash/OnSuspend and OnResume for Flash?

SlopeOak(Posted 2012) [#1]
Been searching around for an hour or so and don't see any answer for this, though it has been discussed a few times.

Is there some reason that OnSuspend does not get called in Flash when the user clicks outside the SWF? Is there some other way to detect that the user has clicked outside the SWF, using Monkey only?

I'm aware that I can hack something up myself in AS3; I'd just rather avoid it if there's already a way!

Thanks!


marksibly(Posted 2012) [#2]
Hi,

Have you got this at the top of your main file?

#MOJO_AUTO_SUSPEND_ENABLED="true"

Also, until the app is first clicked on you wont be able to suspend/resume it.


SlopeOak(Posted 2012) [#3]
So having:

#MOJO_AUTO_SUSPEND_ENABLED="true"

Is required for this feature to work? Is there some reason it's not always enabled? (ie. Is there some downside?)

Thank you!


SlopeOak(Posted 2012) [#4]
Hm, and it looks like I can't do any sort of rendering from within OnSuspend, so I don't see how I can display a "Paused" screen or a "Click to Continue" screen before OnRender stops getting called...


Origaming(Posted 2012) [#5]
OnSuspend and OnResume work great with Android and ios, but that is not good with flash and html5

i already post it on, and that looks like i had wrong thread to post
http://www.monkeycoder.co.nz/Community/posts.php?topic=3212


SlopeOak(Posted 2012) [#6]
Well, I guess that means we just have to hack something directly in AS3 to get this functionality.


Origaming(Posted 2012) [#7]
yup, we can do some hack on mojo.flash.as line 131 and 143