WiiNintendo




D-Pad working (better) with Flash in Wii browser January 2, 2007

Filed under: News, Tips, Tricks, and Secrets — hey_suburbia @ 8:23 am

342579898 da3389a752 D Pad working (better) with Flash in Wii browserAs we reported last week, Arty2 got the Wiimote’s D-pad working in the Wii Opera browser using Javascript and Flash. Javascript worked great, but there were reports that the Flash input was buggy at best.

Quasimondo, was able to take it a step further and get Flash working pretty well.

“Well – I think that I have found yet another a method that works pretty okay. Especially the reaction time feels good to me – the only downside is an optical glitch which I still hope to get rid of. Check the demo here – ideally on a Wii:

http://www.quasimondo.com/flashhwiimote.php
BTW – you will not see anything on Firefox since I just use the OBJECT tag to embed the swf – I also tried to use SWFObject first for embedding, but somehow when using it the Wii scroll arrow started appearing above the Flash file – so it looks like the layer got a bit higher than the desired 500 pixels.

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.”

You can download the example files and the Wiimote class here: FlashWiiMote_v10.zip

Source + More



Discuss this and more in our forums.
Follow WiiNintendo on Twitter.
Subscribe to our RSS Feed.
Share or Save Article:
  • Digg
  • Reddit
  • Facebook
  • Twitter
  • Google Bookmarks
  • Tumblr
  • MySpace
  • StumbleUpon
  • Technorati
  • del.icio.us
  • Mixx
  • Yahoo! Buzz
  • email
  • Print
  • RSS

blog comments powered by Disqus