HOWTO use the Wiimote buttons in Flash

Technology
HOWTO use the Wiimote buttons in Flash

wiimote_20070620-1.jpg
A while back, WiiNintendo posted the keycodes that are detectable by Javascript when the Wii’s buttons are pressed. With this ability, you can create Javascript games that will play on your Wii. Unfortunately, even though the Wii browser ships with the Flash plugin, those keycodes cannot be detected natively in the Flash environment.

Quasimondo came up with a really clever hack that solves the problem. You can create a second flash movie and use Javascript to resize it to specific widths for particular keycodes. Even though Flash cannot detect the keycodes, it does receive an onResize event. When it receives this event, it then retrieves its current width, which was set to the value of the keycode. This second swf file can then use Flash’s LocalConnection to communicate that value to the primary swf.

How to Make the Wiimote Work in Flash – Link
Aral Balkan’s discussion on using the Wiimote in Flash – Link
Wiimote Key Codes @ WiiNintendo – Link

What will the next generation of Make: look like? We’re inviting you to shape the future by investing in Make:. By becoming an investor, you help decide what’s next. The future of Make: is in your hands. Learn More.

Tagged
Discuss this article with the rest of the community on our Discord server!

ADVERTISEMENT

Escape to an island of imagination + innovation as Maker Faire Bay Area returns for its 16th iteration!

Prices Increase in....

Days
Hours
Minutes
Seconds
FEEDBACK