28 November 2010
Test touch game w/o a real device is a pain
It's pure AS3 so I would like to port it to Nokia's FL4 devices
I think it works, but how could I seriously release a game for a device without real touch tests ?
I tried with Remote Device Access but I don't know if my game is slow or if the web is slow ;) Emulate touch throught Web is almost impossible....
So I think I'll keep this version for me until I got, perhaps, a FL4 enabled device (which I doubt since I'll soon receive an Android based one)
Plus I can't release it since I need to package it in a .sisx file and, so, need a valid IMEI....
why don't they support .nfl on S60 devices ?!!!
It's been so long we're asking for... :(
12 October 2010
Back to Nokia ?
It was a real pleasure to, AT LAST, develop using AS3 !
But I must say it was painfull to handle multi res, multi input, etc....
It was strange because it made me remember my first tries with Flash Lite 2.0 with a MAJOR difference : I was able to handle ANY device screen size on Flash Lite 2.0
I'm pretty sure we'll meet a LOT of problems we almost solved on Symbian in a near future :
- screen size
- screen orientation
- device os version (Froyo doesn't mean FP10 every times) with a come back of WURFL ?
- system call (need to test AIR as soon as possible for this)
- size (look at FP runtime weight...and AIR runtime weight)
- os update breaking previously working app...and so handling update OTA
At the same times, Nokia is releasing Symbian^3 devices with FLite4 support (AS3!) and drop the OVI Publisher cost...
I think it's time for me to came back to a platform I knew a lot :)
I wonder if I could easily port my AS3 game to FLite4.....
perhaps it's because the roadmap of Android isn't clear enougth or because my HTC Desire keeps crashing for nothing...or because it's clearly interesting
If at least I could win some bucks at Flash Game License compo, I'll be able to pay my Android Market registering cost to (try to) make money with AIR ;)
01 May 2010
HTC Desire incomplete UAProf ?
Everywhere you'll see it's Flash Lite 4 enabled (even Mark said so), but I was unable to confirm this using its official technical details nor its uaprofile.
WURFL to the rescue ? ...nothing on the FLite part :(
It will be again hard to detect Android Flash Lite 4 enabled phones it seems ...
Did Adobe miss something in 2007 ?
I know you can see my posts like rockets against Apple.
Yes, a lot of things make me upset against Apple.
Yes, iPhone has a very great UI, so much that I was about to buy an iPhone for my wife...but I canceled it yesterday (boycott mode on)
But NO, I'm not a PRO Adobe, I'm just trying to choose the best path, as a developper, I must follow in the coming months/years.
For what could be seen as my own moral, I can't follow Apple path, sorry.
But, at the same times, I'm really asking myself if Flash is the future.
If you read some of my other posts, you'll see how much I hate to fight with bugs on Flash Lite, how much I dislike to be unable to talk with the OS and how I'm afraid when Adobe drops the low phones market to focus on smartphones only. (And I won't talk about the heavy AIR for mobile).
I already said "flash on every screen" was a dream. It recently became "develop one, release to many" which is also a dream, from my point of view (close to Steve Jobs' point of view about optimized code I think).
And so I read this post on Wired : did Adobe really miss the iPhone train 3 years ago ?
Like every post on the web recently, it's not neutral since Corona competes with Flash. But it should be something I must be aware of.
If I focus on Flash technology, I must know if Adobe decisions are good or not.
It's not the first time someone critizes the Adobe strategy about mobiles.
I personnaly like Flash for its ability to make something great really fast.
But I personnaly think Android is the future. Flash will be soon on Android so we'll see how it works, even if I already started to develop on Java for Android.
So, finally, will Flash become a prototype tool ? If so, I really think Adobe should start to think about code export (Flash to Java, Flash to ObjC...) but I read a post on an Adobe blog (sorry, can't find the link) it isn't an option.
2 years ago, I was waiting for Adobe to make an useful Flash mobile solution. Flash Lite 3 was near to succeed...
I don't know what is Flash Lite 4 (apart to be AS3 based, at last) and I know Flash 10 won't be a solution for my main target : phones, not smartphones.
Perhaps Adobe is right : smartphones are the future. But, for now, I'm making money from Europe and India's gamers, on standard phones.
So, again, wait and see.
18 April 2010
Flash Lite 4 AS3 reference
While testing Flash Builder 4 (I won't comment here about the good and bad thing of this product), I noticed you can filter the AS3 reference to one or more runtimes.
Flash Lite 4 is one of them !
Good thing if you dev in Flex but want to port it to FL4 (I know, it should be Slider's job).
So, we now have all the docs....We're now waiting for Slider and FL4 based phones (HTC Desire?)
02 March 2010
Flash Lite 4.0 ?
the HTC Desire ROM (shown below) is running a new alpha version of Flash Lite that supports AS3
Some days later, Alessandro shared this interesting post about the several versions of Flash available on Android.
It's now clear that a new Flash Lite is coming 'soon'.
What is it (apart to support AS3, alleluia) ? For which platform ? Available throught CS4 or CS5 ?
Like I reported previously, it's strange how Adobe isn't sharing the information on FLite 4.0...Perhaps to avoid the confusion with FP10.1 ?
I only hope one thing : to see FL4 (and FP10.1) working on Android emulator!
Actually, apart an old S60 SDK which let you play FL1.1, I never found an emulator (nokia, se, android,...) able to play FL files
and no, unfortunatly, the HTC Desire ROM doesn't work on Android emulator, since it's not for the right ARM processor :(
05 February 2010
BUG : onUnload not called on Wii Flash Lite connection
I got it playing with the Wii, so it should be tested elsewhere too...
this.pressedDelegate = Delegate.create(this, buttonPressed);
Wii.getRemote(0).addEventListener("buttondown", this.pressedDelegate);
private function buttonPressed(event:Object):Void {
_root.gotoAndPlay("new_game");
}
at this time, onUnload isn't called...very annoying since I usualy clean my listeners here !
To be more precise:
A SWF calls a function of my SWF via LocalConnection
this function callbacks the listener added
the listener calls gotoAndPlay
so it's perhaps because it's in the LocalConnection chain or because of Delegate ?
04 February 2010
Wii Flash Lite - quick debug
getURL("javascript:alert('debug this!')");
It will open the Opera's alert dialog with any text you want
03 February 2010
Wii Flash Lite - full screen size
Although screenResolutionX returns 640 and screenResolutionY returns 800, the fullscreen size is different.
Even worst,it could be different according user 'Toolbar Display' settings.
(toolbar option on a Wii...in french)
Here you have 3 choices
- Always display toolbar (default)
- Auto-Hide toolbar (show toolbar on rollover toolbar zone)
- Button toggle (show toolbar on demand with button1)
Using window.innerHeight & window.innerWidth, I found the final fullscreen value
- Always display toolbar = 800x508
- Auto-Hide toolbar = 800x608
- Button toggle = 800x608
So basically, to handle the 3 modes, you have to follow these steps
- create a 800x608 FLA
- design your UI with nothing 'important' on the last 100 pixels
- remove any margin with
<body style="top:0px;left:0px;margin:0px;">
- place on the first image the magic
Stage.align="TL";
Stage.scaleMode="noScale";
- using wiicade, on initializeWiiCadeAPI, replace the Flash detection (assuming you have one and only SWF on screen) with
var tags = document.getElementsByTagName("object");
var objectFlash = tags[0];
objectFlash.height = window.innerHeight;
The Flash is so resized to 508 when needed.
Why not used a 800x608 on all cases ? to avoid the scrolling with B button on the first case!
Unfortunatly there is one 'feature' we can't handle on every settings : the scrolling.
I don't know why but, in this last version, Opera added a very annoying feature, activated by default: horizontal margins
I really don't understand the meaning of this, perhaps for some kind of TV screen, but anyway, with this option, Opera keeps a 10 (20?) pixels margin before and after the HTML document.
This extra zone is inactive, input isn't handled there.
So very annoying and, I repeat, ACTIVATED BY DEFAULT.
Plus, you can't detect it, to show an alert or similar.
Since you can't intercept B button, you can't desactive scroll and you stuck with this, unless the player desactivated the option...which means almost never!
If someone find a hack for this (or a way to detect the option), I'm very interested in!
Oh, I also found a bug on Opera :
if you select Auto Hide toolbar, it automatically zooms to 120%
also annoying since I hook the zoom button : no way to zoom back to 100%
07 January 2010
Wii Flash Lite - trying to handle Wiimote(s)
Before the update, the Wiicade API was the lib to use.
(4 wiimotes on Wii Flash Player 2 years ago)
I so implemented it using the same example : unfortunatly it is no longer working!
Honestly, I was afraid of this since I saw the B button was no longer logged, even using the official Opera example : Browsing button.
So, what are the problems ?
- B button isn't logged, for any of the wiimotes
- the update of the remote data is no longer fast enought : you press several buttons, stop and see the buttons pressed after some delays.
Opera thinks your wiimote is disconnected on startup- angle and distance are totally wrong
so...bad news....:(
It's sad because, apart for the B buttons, everything is still working on the Browsing buttons example (in full javascript) so they didn't broke the initial JS API..
So, it's time for some R&D ;)
EDIT : in fact, LocalConnection calls are queued, it's why, if you move a lot your wii or press a lot of buttons, every lags...got to find how to optimize this
06 January 2010
Wii Flash Lite and Javascript
ExernalInterface still doesn't work
LocalConnection still works (hurra!!!)
For information, it was the way guy like Quasimondo & WiiCade team found to handle 4 Wiimotes with partial nunchuk suport on Flash Lite
See you soon for a test of WiiCade api...does it sill work too ?! I hope so!
05 January 2010
Wii Flash Lite - basic input
- The wiimote acts like a mouse (use a mouselistener!) where A button is the mouse button
- Input texts are handled : if you select one, the Wii opens its virtual keyboard on full screen
- No keydown except a very strange one : after a click on a the screen, if you press the A button with the curson OUTSIDE the screen, you receive a keydown where Key.getCode() returns 57433 and Key.getAscii() returns...57433 (ie 0xE059)! I don't know what it means, I found nothing on the web (bluetooth related?) but it perhaps could be used to know when you're out of the screen.
Wii Flash Lite - capabilities & fscommand
Note, Device Central CS4 still includes the previous version, not the latest, updated on September'09
Here are the capabilities
audioMIMETypes = audio/mp3,
imageMIMETypes =
MIMETypes = audio/mp3,
videoMIMETypes =
avHardwareDisable = true
has4WayKeyAS = true
hasAccessibility = false
hasAudio = true
hasAudioEncoder = false
hasCMIDI = false
hasCompoundSound = true
hasDataLoading = true
hasEmail = false
hasEmbeddedVideo = true
hasMappableSoftKeys = false
hasMFI = false
hasMIDI = false
hasMMS = false
hasMouse = true
hasMP3 = true
hasPrinting = false
hasQWERTYKeyboard = true
hasScreenBroadcast = false
hasScreenPlayback = false
hasSharedObjects = true
hasSMAF = false
hasSMS = false
hasStreamingAudio = true
hasStreamingVideo = true
hasStylus = false
hasVideoEncoder = false
hasXMLSocket = true
isDebugger = false
language = fr
localFileReadDisable = true
os = undefined
screenOrientation = normal
screenResolutionX = 640
screenResolutionY = 800
softKeyCount = 0
version = AFL 9,1,122,0
Some interesting things to note
os return nothing
imageMIMETypes & videotype return nothing while it should be able to read video (more test later) and has hasStreamingVideo to true
has4WayKeyAS return true while keydown aren't read by default, perhaps because of the virtual keyboard (hasQWERTYKeyboard is true)
Here come the fscommand2 available
fscommandname, return, optional var defined
FullScreen -1
SetQuality 0
SetInputTextType 0
SetSoftKeys -1
ResetSoftKeys -1
StartVibrate 0
StopVibrate 0
GetVolumeLevel -1
GetMaxVolumeLevel -1
GetDateDay 5
GetDateWeekday 2
GetDateMonth 1
GetDateYear 2010
GetLocaleShortDate 0 01/05/2010
GetLocaleLongDate 0 Tue, Jan 05, 2010
GetLocaleTime 0 23:30:23
GetTimeHours 23
GetTimeMinutes 30
GetTimeSeconds 23
GetTimeZoneOffset 0 0
GetBatteryLevel -1
GetMaxBatteryLevel -1
GetPowerSource -1
GetTotalPlayerMemory -1
GetFreePlayerMemory 40706
GetDevice -1 undefined
GetDeviceID -1 undefined
GetPlatform -1 undefined
GetLanguage 0 fr
GetSignalLevel -1
GetMaxSignalLevel -1
GetNetworkConnectStatus -1
GetNetworkRequestStatus -1
GetNetworkStatus -1
GetNetworkName -1 undefined
So, no information on system (memory, os, etc...)
Hard to detect you're on a Wii !
StartVibrate return 0 while I wonder what could vibrate on a wii (no, not the wiimote)
40Mo free memory (?!)
09 December 2009
KuneriLite : SWFPack offline ?
This tool has the same functionnality than SWFPack (on the free version, w/o plugins)
Follow the wiki and you'll be able to make a .sis in a few second
The only drawback is it only uses S60 3rd MR SDK
03 December 2009
WillNa SIS packer
At that time, I was fighting with a bug (on my side) about a SVG icon SWFPack didn't like.
Due to the recent events, I finally took some times to finish it.
Of course, it's mainly based on Nokia's Library "Create a stub application" article
But, I added a way to configure everything throught an ini file
You could use it like it or use it as a start project to make your own.
I plan to make an AIR (with the FINALLY available 2.0 version) app with CAB, SIS & NFL support, projects management,etc... but for now, this batch is enought for me
Download WillNa Packer
12 October 2009
How to debug LoadVars call on phones - phones
Go to showip.com or show-ip.com or whatismyipaddress.com or http://www.find-ip-address.org/ or whatever ip lookup website to retrieve your IP
Go to RDA (or launch your phone and configure it in a similar way)
Choose a phone (here the Nokia N95 8GB)
Go into Tools > Settings > Connection > Access points
Select your access point (here I choose 'Rda')
Using left softkey menu, choose Advanced Settings
Enter your IP in Proxy server address and 80 in Proxy port number
Et voila, launch a webpage or your SWF, choose the correct access point (here 'Rda') and look to your access.log and error.log
On google, I have
194.137.80.96 - - [08/Oct/2009:23:51:18 +0200] "GET http://www.google.com/ HTTP/1.1" 302 218 "-" "Mozilla/50 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413"
194.137.80.96 - - [08/Oct/2009:23:51:18 +0200] "GET http://www.google.fr/ HTTP/1.1" 200 948 "-" "Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413"
you see a Nokia95 8GB asking for http://www.google.com/ and get redirected (code 302) without problem (code 200) to google.fr which is 948bytes
194.137.80.96 - - [12/Oct/2009:23:15:25 +0200] "GET http://www.wwf.mobi/ HTTP/1.1" 200 2936 "-" "Mozilla/5.0 (SymbianOS/9.3; Series60/3.2 NokiaE72-1/021.011; Profile/MIDP-2.1 Configuration/CLDC-1.1 ) AppleWebKit/525 (KHTML, like Gecko) Version/3.0 BrowserNG/7.1.14371"
Here, using a Nokia E72, I connected to WWF.mobi
Using Ctrl Panel > Connectivity > WLAN wizard > (Options)> Edit access point > (Options)> Advanced Settings
or
Ctrl Panel>Settings>Connection>Destinations>Internet>Rda> (Options)>Edit>(Options)> Advanced Settings
194.137.80.96 - - [12/Oct/2009:23:21:58 +0200] "GET http://ea.mobile.nokia.com/ea/ HTTP/1.1" 302 - "-" "Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaE71-1/300.21.012; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413"
Using a Nokia E71, using Connectivity > WLAN wizard > (Options)> Edit access point > (Options)> Advanced Settings
or
Tools>Settings>Connection>Access points> Rda> (Options)>Edit>(Options)> Advanced Settings
The interesting part : you could find an error looking for 404 error like in
194.137.80.96 - - [08/Oct/2009:23:54:18 +0200] "GET http://www.find-ip-address.org/crossdomain.xml HTTP/1.1" 404 948 "-" "Mozilla/5.0 (SymbianOS/9.2; U; Series60/3.1 NokiaN95_8GB/31.0.015; Profile/MIDP-2.0 Configuration/CLDC-1.1 ) AppleWebKit/413 (KHTML, like Gecko) Safari/413"
More info on HTTP Error codes
If the problem is on the POST/GET data itself, look into the error.log
To be honest, it's a real mess so you'll know what to do with it knowing what you're looking for only !
And remember to reset the proxy settings BEFORE the end of your reservation on RDA !
Note you could also duplicate an access point and add the proxy settings if you want to avoid killing pre-defined access points.
How to debug LoadVars call on phones - WampServer
So, how to configure a Forward Proxy on your desktop ?
First you'll need a http server : Apache.
You can download a ready to use version like WampServer
Install it then edit the file httpd.conf to configure our proxy for our need
First the proxy itself
find and uncomment these 3 lines
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so
LoadModule proxy_http_module modules/mod_proxy_http.so
add/update these lines
<IfModule mod_proxy.c>
#enable forward proxy
ProxyRequests On
#enable any address to use the proxy
<Proxy *>
Allow from all
</Proxy>
</IfModule>
you limit the valid address using
Order deny,allow
Deny from all
Allow from
you could also use mask, domain name and UserAgent filter
To only allow Nokia phones, use 194.137.80.*
You could also define the allowed ip on the
Second, optional, add the UserAgent in log
be sure you have
LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
and uncomment
LoadModule logio_module modules/mod_logio.so
CustomLog "logs/access.log" combined
(note 'combined' reference to LogFormat xxxx 'combined' ... and adjust the path of the log to access.log)
comment
#CustomLog "c:/wamp/logs/access.log" common
to avoid mix of the 2 logs
Third, to log POST/GET data on the error.log (not on the acces.log)
uncomment
LoadModule dumpio_module modules/mod_dumpio.so
and add
<IfModule dumpio_module>
LogLevel debug
DumpIOInput On
DumpIOOutput On
</IfModule>
Then, put it online using, on <Directory "???/www">
Order Allow,Deny
Allow from all (or any specific IP/domain/mask like 194.137.80.*)
and not
Order Allow,Deny
Deny from all
Allow from 127.0.0.1
on WampServer, it will give you
How to debug LoadVars call on phones - intro
You can also use the free WireShark (also knows as Ethereal)
It helps you to find a bug or a wrong return in seconds, without altering Flash code using a lot of trace.
I was looking for a solution for mobile, mainly a Symbian port of WireShark but never found it .
I only found IPTrace for Symbian (with output compatible with WireShark) but no chance to test it.
Note you could easily use WireShark if your phone is using a WiFi connection (more on this later...)
Plus, if difficulty wasn't enought, I would like to be able to debug RPC on the phones available at Nokia's Remote Device Access service.
What is Charles ? A HTTP proxy. So I looked for something similar for Symbian.
I found some but I also found a lot of people got strange behaviors on Flash Lite with local/on the phone proxy.
So I finally looked for a way to make my own proxy on my own server which will be useful for any kind of remote debugging (mobile or PC, FlashLite or others...)
You could use something called phpproxy but I personnally didn't try...I found the idea to control the proxy right from my desktop a more powerfull solution.
Do to that, I need to
03 September 2009
Important AS command on touch devices
It's not a crash since I didn't exit the game.
I tried to make this bug again without success...until I realized I was on a touch device : the N97.
I finally found the reason : OK key valids (similar to a press command) the current selected movieclip.
I didn't notice it before since I set _focusrect to false.
So, the AS commands needed to handle a touch AND a non touch game are
- focusRect = false to avoid the ugly rect around movieClip
- if(System.capabilities.hasStylus || System.capabilities.hasMouse) to handle touch-only stuff, like myfakesoftkey.onRelease =
- myfakesoftkey.trackAsMenu = true to handle touch move while pressing a touchbouton
- myfakesoftkey.tabEnabled = false to avoid movieclip to be 'selected' while using right and left key (and I assume you use them a lot on a game!)
- fscommand2("DisableKeypadCompatibilityMode"); to hide the ugly fake keyboard on Nokia touch devices
16 August 2009
BUG : NetStream/NetConnection memory leak
var my_video:Video; //my_video is a video object on stage
var my_nc:NetConnection = new NetConnection();
my_nc.connect(null);
var my_ns:NetStream = new NetStream(my_nc);
my_video.attachVideo(my_ns);
my_ns.play("video1.flv");
I just found a very annoying bug on this one :
when you call my_ns.play( filepath ), something is done on the background, then the video starts to stream & play when buffer is full
if you ever kill everything while 'something is done on the background', the 'something' doesn't stop and the first blocks of memory used by buffer are filled.
This is what I did for testing
var keyListener:Object = new Object( );
keyListener.onKeyDown = function()
{
handleKey(Key.getCode()+"" );
}
Key.addListener(keyListener);
function handleKey( keycode:String ):Void
{
switch (keycode)
{
case ExtendedKey.SOFT1:
trace(_root.stream_ns);
trace(_root.connection_nc);
break;
case ExtendedKey.SOFT2:
Key.removeListener(keyListener);
_root.stream_ns.close();
_root.connection_nc.close();
delete _root.stream_ns;
delete _root.connection_nc;
// nothing still present in memory
_root.gotoAndPlay("menu"); //get out of the frame with the video object
break;
}
}
Test this with a video (or download my sample)
Don't click the softkey yet, wait for the video to start playing
When you click the softkey, you could see on the memory manager every video data is deleted
Then retest, but quickly (or at least BEFORE the video start playing or you could see 'Connect to file_path' on the trace) click the softkey
At first, nothing happens (like you want to), you even have the wanted
FTPS116: Flash Video status : (NetConnection.Connect.Closed)on the trace
BUT while the video is deconnected, closed, deleted and nulled, some (milli)seconds after you'll see a 'Connect to file_path' and the memory manager will show you something big on memory!
What happened?
I ask for a video
Flash Lite player starts something
I cancel the video and deleted it
Flash Lite doesn't know about it
Flash Lite finished its something
Flash Lite want to start the video but...err...where is my netstream ?! ok, forget it
Unfortunatly, it forget to kill its something
I fought a long time against this one, and I wasn't able to find a workaround....
The only thing I could do is to active the keylistener when the video is ready.
So no way to exit the screen before it starts playing...and so downloaded some Kbytes the user pay for! Very bad user experience !!
VGTrailers is like this, and I retried again this sunday to fix it without success...
I think it's NetStream/NetConnection bug. Not a Video bug, because if I don't use a video object and don't attachVideo, I have the same problem (and so I had sound but no video when I test)
If you ever got this one and found a solution, please, share it with me !
EDIT : I forgot to tell I tested it on read hardware, it's why you'll find oxygen's memchecker on the available test file