I'm copy-pasting this from TIGF cuz i'm lazy!
Hey guys! I wanted to show you my new project, and maybe have some people beta test it for free? This stuff is always browser-sensitive, so I want to make sure I have this junk workin right. Also, I am not really a flash or javascript guru, I just do what I can to get stuff to work! Ok, here we go!
MarioToo is a WiiMote API, like the one that seems so popular over at Wiicade, only I'm not squirreling away all my javascript, and I think I've got a much more redundant implementation anyways. My API, like Wiicade's, is based heavily off of Mario Klingemann's demo from I think December. Unlike Wiicade, he also made the javascript available for download, and I spent most of last night reengineering it to get the kinks out and make it easier for people to work with. The result is 'MarioToo', what I hope will become the standard for great Wii Flash games to come! The best part is its very easy to use, and you can deploy it on ANY website, not just wiicade's ad-fest!
MarioToo is very, very easy to use if you know any flash at all. It includes a full-featured javascript library that handles all of the HTML and reflector hacks for you; all you have to do is plug it into your flash game, and include my javascript library and flash reflector on your website. Here is the example site I am currently hosting:
http://www.lastchancemedia.com/mariotoo/This is a flash file running at 720x480, and all it does is echo button presses, very simple. It also demonstrates the smart 'classic' mode and the PC-friendly keyboard bindings a la Wiicade's closed library. Heavy redundancy and a better javascript setup mean I can handle upwards of 7 or 8 simultaneous button presses with no missed events to screw up your game state. Here is the HTML for that webpage:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 strict//EN">
<html>
<head>
<title>MarioToo: A WiiMote Flash API</title>
<script type="text/javascript" src="wiimote.js"></script>
</head>
<body>
<script type="text/javascript">
CreateHTML('MarioToo_Demo.swf',720,480,'#FFFFFF','#CCCCCC');
</script>
</body>
</html>
Very very simple as you can see. The CreateHTML call does all the heavy lifting for you, setting up and hiding the reflector, bla bla bla. It takes params for the flash file URL, width, height, page color, and flash background color. Moving on, here is all the code from the demo actionscript:
// MarioToo Wii Flash API Demo
//
// Version 1.0
// Author: Adam Saltsman <adam@lastchancemedia.com>
//
// A simple app to show how the MarioToo WiiMote API functions.
import mx.core.UIObject;
import com.lastchance.mariotoo.WiiMote;
class com.lastchance.mariotoo.MarioToo_Demo extends UIObject
{
var status:TextField;
var txtfmt:TextFormat;
function MarioToo_Demo()
{
WiiMote.init(); //initialize the wiimote
WiiMote.setClassic(true); //rotate the d-pad on the wii
WiiMote.bindDefaults(); //arrow keys, z, x, shift + ctrl
WiiMote.bind(WiiMote.BUTTON_A,65); //the 'a' key on the keyboard
txtfmt = new TextFormat();
txtfmt.size = 72;
txtfmt.color = 0xffffff;
txtfmt.align = "center";
createTextField("status", getNextHighestDepth(), 0, 200, 720, 100);
status.multiline = false;
status.selectable = false;
status.text = "";
}
function draw()
{
if(!this.onEnterFrame)
this.onEnterFrame = this.updateImage;
}
function updateImage()
{
status.text = "";
if(WiiMote.isDown(WiiMote.BUTTON_A))
status.text = "A";
if(WiiMote.isDown(WiiMote.BUTTON_B))
status.text += " B";
if(WiiMote.isDown(WiiMote.BUTTON_1))
status.text += " 1";
if(WiiMote.isDown(WiiMote.BUTTON_2))
status.text += " 2";
if(WiiMote.isDown(WiiMote.BUTTON_PLUS))
status.text += " +";
if(WiiMote.isDown(WiiMote.BUTTON_MINUS))
status.text += " -";
if(WiiMote.isDown(WiiMote.BUTTON_UP))
status.text += " ^";
if(WiiMote.isDown(WiiMote.BUTTON_DOWN))
status.text += " v";
if(WiiMote.isDown(WiiMote.BUTTON_LEFT))
status.text += " <";
if(WiiMote.isDown(WiiMote.BUTTON_RIGHT))
status.text += " >";
if(status.text != "")
status.setTextFormat(txtfmt);
}
}
Again, very very straightforward stuff. Nice and state-based, and the keyboard bindings mask themselves as regular wiimote buttons. The 'classic' mode, which tilts the d-pad for NES-style play, is automatically avoided if you are using a keyboard, so no multi-config setups for different browsers, etc etc.
Finally, here is the download for the beta version 1.0:
http://www.lastchancemedia.com/mariotoo/MarioToo_b10.rarIt includes all the actionscript, javascript, compiled .swfs, and all that junk. To get it to run on YOUR site, all you have to do is make sure you include the WiiBounce.swf and wiimote.js files in the same directory as your HTML. Then, call CreateHTML to have wiimote.js write out your flash containers for you! If you want to use the wiimote API in your flash file, just make sure you import wiimote.as. A final note, all flash files were compiled using free, open source software: mtasc and swfmill. Special thanks to those guys for making projects like this possible!
I think that's about it! I'm always open to hearing about new features people would like, but I don't want this thing to get too bloated. If you find bugs please let me know ASAP and I will fix them if the wii browser lets me

Thanks!