Mario from Quasimondo.com has found a method to get the Flash-plugin to detect the Wiimote buttons.
Now how does this work? Since all direct Javascript to Flash communication is either impossible or too slow I’m using an indirect method: I use the Stage.onResize event of one Flash file as a trigger and communication device. When a keypress is received by the Opera browser I scale the layer which contains a sender swf to a width that is equal to the detected key code. This triggers a resize event inside the sender swf which reads out its new width and sends that number via LocalConnection to the main swf. There it is processed by a Wiimote class which can then be similary used like a Key object.
Some things to be noted:
- in order to get the full 800 x 500 size for the main Flash file I put the sender swf and the receiver swf into two absolute positioned layers. Unfortunately the Opera browser uses the Wiimote’s navigation keys also for navigating inside the html page and thus interferes with the flash file by highlighting the object with the keyboard focus with a black outline. And it looks like the browser does not respect the z-index of the layers here so the outline of the supposedly hidden sender swf gets visible. I have not yet found a way how to at least tint the outline in a less visible color or hide it completely via CSS - maybe someone else finds a solution for that.- The Wii browser includes a very nasty feature: Flash files that are not inside the visible screen area or are on a hidden layer do not work at all - they get deactivated. Which means it’s not possible to simply put the sender swf on an invisible layer.
- When you point the Wiimote to the screen and the mouse pointer gets visible the behaviour of the page changes: keypresses are not registered anymore and only the “A” button gets directed to the flash file, but in a very slow and unpredictable way. So if you want reliable control do not point the mouse to the screen. In games it would probably be a good idea to trigger a pause when the mouse appears.
- I don’t know if that is a problem with the LocalConnection or with the browser’s internal key detection, but it looks like sometimes some key events get lost which means that a keyDown event is detected, but the keyUp for the same key doesn’t fire. Of course that’s not ideal.
Bwua?
[ Nintendo Wii ][ Wii Games ][ Wii Friend Codes ][ Wii Wallpapers ][ Wii Cheats ]
[ Wii Virtual Console Games ][ WiiWare Games ]













