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.
29 August 2010
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 ;)
I'll try it next week, perhaps it will help me for one of my entries on a constest ;)
Labels:
AIR mobile
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 ;)
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 ;)
Labels:
android
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)
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)
Labels:
android
31 July 2010
Android Fragmentation
I talked about it last times, Android's fragmentation is a shame because your mobile will be updated to the last android version only when manufacturers want to.
I found an 'official' reply of Google about this problem during Google IO. Something like
So bad... :(
I found an 'official' reply of Google about this problem during Google IO. Something like
Sorry, it's a shame but we can't do anything about this
So bad... :(
Labels:
android
27 July 2010
Debug a Mobile Flash project using Flash Builder, Flash CS5 & Device Central CS5
Despite the poor bridge implementation between these 3 products, I HAD to find a way to debug Flash 10 mobile code using Flash Builder. Debugging using Flash CS5 is just insane ;)
I finally found 2 ways to do this, based on the same discovery but dependant on the project type.
I'll first explain for a Flash professional project, ie based on a .FLA/.XFL file
the Flash part
Create a Flash project using the previous method (and throught Device Central)
On Flash CS5, select File > Publish settings
on Flash tab, be sure to check "Permit debugging"
On Flash Builder, publish the project (Alt+Shift+F12 or the first Flash icon in toolbar)
You now have a Flash professional project on Flash Builder, which generate a SWF with debug data but doesn't launch Flash CS5
(reminder : don't forget to uncheck the option before deployment !)
the Device Central part
Create a debug.bat batch file on your Flash project folder with this line :
Edit Flash CS5 folder path if needed and remove any line break (it MUST be one full line)
This is the command line (used by Flash CS5) to open an SWF on Device Central CS5 with a specific mobile
%1 is the first parameter and is the mobile profile ID
%2 is the full path to the SWF file
open C:\Users\<you>\AppData\Local\Adobe\Adobe Device Central CS5\Devices\<your_device>_Main.xml to get the mobile profile ID
for example, the Nexus One id is 1494, retrieved from Google_Nexus_One_Main.xml :
Still on Flash builder, add an External tool with Run > External Tool > Open external tools Dialog...
Add a new program (DC for exemple) with these info
In Location, Browse workspace up to your debug.bat
=> this will result in something like ${workspace_loc:/<projectname>/debug.bat}
Define Working directory to ${workspace_loc:/<projectname>} if you load external assets
In Arguments, add the mobile ID (first arg) and the full path to the generated swf file (second arg)
=> this will result in something like 1494 ${workspace_loc:/<projectname>/<file>.swf}
Apply
Run
Congratulations! You are now able to open the SWF on Device Central directly from Flash Builder!
(reminder : you'll need one external tool per Flash project since I didn't find a way to make it dynamic using variables)
The final tricky part
Import this Flash Builder project : DebugLauncher.zip
Build the project, which will create the needed files in bin-debug
On project properties, add a new Run/Debug > Web Application
Do not use the default value (bin-debug\DebugLauncher.html) but bin-debug\fake.html
fake.html is an empty HTML (ie w/o Flash) so if you try to debug DebugLauncher, Flash Builder will be in debug mode, waiting for a Flash with debug informations to be loaded.
(reminder : you'll only need one DebugLauncher, not one per Flash project)
Mix the 3 parts
Always open these 2 projects (DebugLauncher and <your fla project>)
When you want to debug, publish your flash (Alt+Shift+F12) -> this will generate a debug swf file
open DebugLauncher.as in editor (mandatory else it will try to debug your flash project file)
launch a debug session of DebugLauncher -> this will put Flash Builder on debug mode
close the browser this will open
Launch the external tool -> this will launch the swf file on Device Central
Debug
Close Device Central when finished (mandatory since Device Central finally crashes when you try to launch while it is alread launched !)
Final notes
The process is a hack, it's not that easy to handle and you need to go throught 3 steps to debug (against one : "debug") but it's, for me, easier and less buggy than the 'official' process
I tried to make a better external tool but I wasn't able to find a way to retrieve the full swf file from the current project.
External tool location and arguments can't use double quote, so I had to use a batch file....sorry for Mac users but I don't know how to do this on Mac (using a shell?)
EDIT : find a way on Actionscript project mode
Coming soon See also the Actionscript project way
I finally found 2 ways to do this, based on the same discovery but dependant on the project type.
I'll first explain for a Flash professional project, ie based on a .FLA/.XFL file
the Flash part
Create a Flash project using the previous method (and throught Device Central)
On Flash CS5, select File > Publish settings
on Flash tab, be sure to check "Permit debugging"
On Flash Builder, publish the project (Alt+Shift+F12 or the first Flash icon in toolbar)
You now have a Flash professional project on Flash Builder, which generate a SWF with debug data but doesn't launch Flash CS5
(reminder : don't forget to uncheck the option before deployment !)
the Device Central part
Create a debug.bat batch file on your Flash project folder with this line :
"C:\Program Files (x86)\Adobe\Adobe Flash CS5\Device Central\adcdl.exe" "<mobileSettings><testDevices><testDevice id="%1" selected="yes"/></testDevices><contentType id="HTMLembedded"/></mobileSettings>" %2
Edit Flash CS5 folder path if needed and remove any line break (it MUST be one full line)
This is the command line (used by Flash CS5) to open an SWF on Device Central CS5 with a specific mobile
%1 is the first parameter and is the mobile profile ID
%2 is the full path to the SWF file
open C:\Users\<you>\AppData\Local\Adobe\Adobe Device Central CS5\Devices\<your_device>_Main.xml to get the mobile profile ID
for example, the Nexus One id is 1494, retrieved from Google_Nexus_One_Main.xml :
<adp:deviceProfile xmlns:adp="http://ns.adobe.com/devicecentral/profile/" id="1494" modelVersion="3.0" ....>
Still on Flash builder, add an External tool with Run > External Tool > Open external tools Dialog...
Add a new program (DC for exemple) with these info
In Location, Browse workspace up to your debug.bat
=> this will result in something like ${workspace_loc:/<projectname>/debug.bat}
Define Working directory to ${workspace_loc:/<projectname>} if you load external assets
In Arguments, add the mobile ID (first arg) and the full path to the generated swf file (second arg)
=> this will result in something like 1494 ${workspace_loc:/<projectname>/<file>.swf}
Apply
Run
Congratulations! You are now able to open the SWF on Device Central directly from Flash Builder!
(reminder : you'll need one external tool per Flash project since I didn't find a way to make it dynamic using variables)
The final tricky part
Import this Flash Builder project : DebugLauncher.zip
Build the project, which will create the needed files in bin-debug
On project properties, add a new Run/Debug > Web Application
Do not use the default value (bin-debug\DebugLauncher.html) but bin-debug\fake.html
fake.html is an empty HTML (ie w/o Flash) so if you try to debug DebugLauncher, Flash Builder will be in debug mode, waiting for a Flash with debug informations to be loaded.
(reminder : you'll only need one DebugLauncher, not one per Flash project)
Mix the 3 parts
Always open these 2 projects (DebugLauncher and <your fla project>)
When you want to debug, publish your flash (Alt+Shift+F12) -> this will generate a debug swf file
open DebugLauncher.as in editor (mandatory else it will try to debug your flash project file)
launch a debug session of DebugLauncher -> this will put Flash Builder on debug mode
close the browser this will open
Launch the external tool -> this will launch the swf file on Device Central
Debug
Close Device Central when finished (mandatory since Device Central finally crashes when you try to launch while it is alread launched !)
Final notes
The process is a hack, it's not that easy to handle and you need to go throught 3 steps to debug (against one : "debug") but it's, for me, easier and less buggy than the 'official' process
I tried to make a better external tool but I wasn't able to find a way to retrieve the full swf file from the current project.
External tool location and arguments can't use double quote, so I had to use a batch file....sorry for Mac users but I don't know how to do this on Mac (using a shell?)
EDIT : find a way on Actionscript project mode
Labels:
AIR mobile,
android
26 July 2010
Flash game portals ready for Froyo ?
From Emanuele, an interesting review of the Flash game portal ready for Froyo.
I was so happy that I tried myself on the HTC Desire and, suddenly, the dream disappears : almost every game avaible on ArmorGames are old flash web games, not optimized for mobile (using cursor, small text, drag'n'drop! ....)
It's everything but not serious!
"He! look! We have a lot of games for mobile!...well...a lot of games which kinda work on mobile..."
Hopefully you'll find a lot more games in end september, thanks to the current contests...
I was so happy that I tried myself on the HTC Desire and, suddenly, the dream disappears : almost every game avaible on ArmorGames are old flash web games, not optimized for mobile (using cursor, small text, drag'n'drop! ....)
It's everything but not serious!
"He! look! We have a lot of games for mobile!...well...a lot of games which kinda work on mobile..."
Hopefully you'll find a lot more games in end september, thanks to the current contests...
Labels:
android
Subscribe to:
Posts (Atom)