Showing posts with label wii. Show all posts
Showing posts with label wii. Show all posts

05 February 2010

BUG : onUnload not called on Wii Flash Lite connection

Step to reproduce this bug

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

A small tip to help you debug your Flash Lite app/game :

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

While debugging my Poulpytris port (still in alpha stage), I found another strange thing.

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)

After some basics testing, I jumped to a more exciting test : the Wiimote support!

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

I made a quick test to enable exchange between Flash Lite & 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

If you're not using a third library (more on this soon), the input on Flash app/game played on Opera Wii version are very limited!

- 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

Today, I run some tests to find the capabilities and fscommand available on the latest Flash Lite player on the Wii.
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 (?!)

02 September 2009

Wii with Flash Lite 3.1, free!

Thanks to scott, I just installed the Wii Internet Channel for free and with the last update (yes, even here in France)!
I planned to install it for so long...but I wasn't able to admit I had to pay for it!

It's a very good news (no just for me) because it means almost any Wii player will now be able to play Flash Lite games, for free.
A better stuff would be to Nintendo to include the browser on the next release of the Wii (with system 4.1+)

Now, the only problem is to find how to attract Wii gamers to our site.
All the Wii only websites I found about games are full of all Flash 6 games....