29 August 2010

Debug a Flash project using Flash Builder and Device Central CS5

Yes, this time we don't need Flash CS5 to build/debug...unless you really need its classes.

Update Flash Builder 4 to support Flash Player 10.1

On Flash Builder, create a new Actionscript project.

Optional (ex: if you plan to use assets dynamic loading and not [Embed] metadata tag or others Flex SDK objects)
Remove the Flex 4.1 SDK lib
Add 3 SWC folders
- ${FLASHPRO_APPCONFIG}/ActionScript 3.0/libs
- ${FLASHPRO_APPCONFIG}/ActionScript 3.0/libs/11.0
- ${FLASHPRO_APPCONFIG}/ActionScript 3.0/FP10
I personnaly still go with Flex SDK, the use of [Embed] is such a great thing...and Flex Hero is coming!

Update Project compilation setup to only create HTML (no version check, no browser history)
Edit html-template\index.template.html to
<html><head /><body>Debug on</body></html>
Delete the no longer needed html-template\swfobject.js

On your main AS file, add the SWF metadata tag (edit it to your need)
[SWF(width="480", height="800", backgroundColor="0xFFFFFF", frameRate="25")]
Build project to generate the bin-debug\ files

add an External tool with Run > External Tool > Open external tools Dialog...

Add a new program (DC_<projectname> for exemple) with these info
In Location, Browse filesystems form the file Adobe Flash CS5\Device Central\adcdl.exe
Define Working directory to ${workspace_loc:/<projectname>} if you load external assets
In Arguments, add the magic string "<mobileSettings><testDevices><testDevice id=__mobile_ID__/></testDevices></mobileSettings>" and the full path to the generated swf file (second arg)
see method1 for more information on __mobile_ID__
ex :
"<mobileSettings><testDevices><testDevice id=1494/></testDevices></mobileSettings>" ${workspace_loc:/<projectname>/bin-debug/<file>.swf}

Now, ask for debug (F11)
close the browser it opens
launch the External tool
You can now debug

Site notes
I don't need a batch file anymore since Device Central doesn't crash if I only define the mobile ID (no more selected or <contentType />). If you had problem with it, jump back to the debug.bat usage from method 1.

28 August 2010

Flex Hero SDK available

The First Hero Stable Build is available on opensource.adobe
I'll try it next week, perhaps it will help me for one of my entries on a constest ;)

08 August 2010

HTC Desire upgraded to Froyo !

Last week, while I was waiting for it on September, HTC released the Froyo update.
They couldn't make me more happy!
I spent my sunday on testing and checking.
Good news, all the bugs I reported on HTC's previous Flash Player are gone (Accelerometer is finally here!)

I only found 2 problems, very boring :
- the phone doesn't see an accelerometer based app like an "active" app and so shut down the screen after some times
- you CAN'T force screen orientation...unless using the tips from Adobe Flash Sizing Zen which are ugly hacks, the same used in Symbian's phones which haven't the special FSCommand2... Unfortunatly, my game is on Portrait Mode, the hardest one to handle ;)

01 August 2010

Bugs in HTC's FlashPlayer

Working on a game for the contests, I found some problems in HTC own version of Flash Player, under Android 2.1 (waiting 2.2)

stage.displayState = StageDisplayState.FULL_SCREEN;
will break the player, resulting in an empty swf.

when requesting some stuff using URLLoader, the User Agent received by the server isn't
Mozilla/5.0 (Linux; U; Android 2.1-update1; en-gb; HTC Desire Build/ERE27) AppleWebKit/530.17 (KHTML, like Gecko) Version/4.0 Mobile Safari/530.17
but
mozilla/5.0 (x11; u; linux i686; en-us; rv:1.9.0.3) gecko/2008100818 firefox/3.0.3

Accelerometer unsupported

Capabilities.touchscreenType is undefined

Touch event unsupported and gesture makes player hold

0.5s delay on mouse down (you must feel a little "bump" on your phone)