So what is different in Flash?

Monkey Targets Forums/Flash/So what is different in Flash?

Xaron(Posted 2012) [#1]
Hi all,

I want to create a flash version for BFG for my game Blotty Pots which works fine on all targets except for Flash.

I ran into the problem that this sweeping action does not work correctly. Is it possible to do offscreen rendering in flash?

Clicking into my GUI doesn't work either. Anything special to keep in mind here?

Thanks!


therevills(Posted 2012) [#2]
that this sweeping action does not work correctly


Sweeping action?

Clicking into my GUI doesn't work either


Strange - does it work with all the other targets (GLFW, HTML5?)


Xaron(Posted 2012) [#3]
Oh with sweeping I mean that you can scroll through the menu by dragging on the touchscreen. For that I use offscreen rendering, where parts of the image are rendered outside of the screen.

If works perfectly on all 3 phone targets, GLFW and HTML5. I will create a flash and html5 example to show you the difference. :)


therevills(Posted 2012) [#4]
Yeah an example of the issues would be great to help you.


Xaron(Posted 2012) [#5]
Here's the HTML5 version: http://www.xaron.net/dl/blottypots/html5/MonkeyGame.html

Here's the Flash version: http://www.xaron.net/dl/blottypots/flash/MonkeyGame.swf

You can see, clicks doesn't work onto the buttons, and dragging and moving the screens look strange too, with black parts.


therevills(Posted 2012) [#6]
Yeah that is strange!

Can you reproduce it in a small(ish) code sample?


Floyd(Posted 2012) [#7]
Trying with Win 7 and Chrome, the Flash version doesn't start up properly. All I get is an empty gray window. If I reload the page with F5 it then starts.

On HTML5 the game fits in a small rectangle in the upper left corner of the screen. The Flash version is in the middle of the screen and is twice as big in width and height.

Also on Flash if I drag to the second screen I am able to make selections, such as Medium and 5x5. But I can't start the game. When I press the left mouse button on Start the red X's disappear, but reappear when I release the button. Nothing else happens.


slenkar(Posted 2012) [#8]
maybe its cos you have filled the entire screen with the flash game,
try to go back to the original settings by editing the .as3 file or the html file
setting the screen dimensions


Xaron(Posted 2012) [#9]
I've set it to 320x480 like in the flash example both in MonkeyGame.html and .as. Thanks so far guys!

I'll try to create a smaller example...


slenkar(Posted 2012) [#10]
in the .as there are 2 places where you have to edit the screen dimensions, BTW


Foppy(Posted 2012) [#11]
If you visit MonkeyGame.html at the flash address (instead of the SWF version directly) the dimensions are correct. The black areas and click problems are still there though.


Xaron(Posted 2012) [#12]
I think I nailed it down. Does Flash have problems with wav files?

I should have enable debug mode earlier. Now I get null object access violations in mojo/audio while trying to play a simple wav.

edit: Bug report: http://www.monkeycoder.co.nz/Community/posts.php?topic=2136


bruZard(Posted 2012) [#13]
look at CONFIG.txt, you have to add |*.wav if you want to load it.


Xaron(Posted 2012) [#14]
Oh my.... Thanks bruzard! I guess this is for v52? I still use v51, where is no config.txt for flash.


therevills(Posted 2012) [#15]
From the docs:

Also, not all audio formats are supported by all targets:

wav : glfw, android, ios, xna (sounds)
mp3 : flash, android, ios, xna (music)
m4a : flash, android (music), ios
wma : xna (music)
ogg : android



And from Mark's Audio Test sample:


#If TARGET="glfw"
'
'GLFW supports WAV only
'
soundFmt="wav"
musicFmt="wav"
'
#Elseif TARGET="html5"
'
'HTML5 supports WAV, OGG, MP3, M4A. However...
'
'IE wont play WAV/OGG
'FF wont play MP3/M4A
'
'So this wont work on IE...
'
soundFmt="wav"
musicFmt="ogg"
'
#Elseif TARGET="flash"
'
'Flash supports MP3, M4A online, but only MP3 embedded.
'
soundFmt="mp3"
musicFmt="mp3"
'
#Elseif TARGET="android"
'
'Android supports WAV, OGG, MP3, M4A
'
soundFmt="wav"
musicFmt="ogg"
'
#Elseif TARGET="xna"
'
'XNA supports WAV, MP3, WMA
'
soundFmt="wav"
musicFmt="wma"
'
#Elseif TARGET="ios"
'
'iOS supports WAV, MP3, M4A, CAF, AIFF
'
soundFmt="wav"
musicFmt="m4a"
'
#End



I've been meaning to add a warning to Diddy for this kind of user error...


Xaron(Posted 2012) [#16]
edit: works.

Should read the documentation. :)

THANKS!