WiiFlash Tip #1 – A virtual Wii-mouse

I’ve been doing a lot of really cool stuff with WiiFlash at the Bank – but I can’t really share any of the code. So, to help any aspiring WiiFlash developers out there, I’ll post a few tips over time with things that would have helped me out. If you don’t know anything about WiiFlash, take a look at their site, it’s a pretty cool hack. Now that I’ve got a good working class system, I just want to sit around and create mini-games.  I wish that I had the free time!

Tip #1 -Using the Wii Controller as a mouse in Flash

The toughest problem that I’ve come across so far: “how do you use the controller as a mouse (click on buttons) in a Flash movie without relying on WiiFlash’s crappy mousemode?”The “mousemode” feature takes over control of the system mouse pointer and uses the controller to point and click. I didn’t want this – I just wanted a nice Flash sprite moving around and still allow the user to click on things with their real mouse. But I wasn’t quite sure how to have this sprite fire off mouse events.

Solution: Senocular’s VirtualMouse class.

Once you’ve figured out how to read the IR points from a sensor bar (a future tip), and have a pointer moving around the screen, just set your virtual mouse instance’s X and Y values to the same as the pointer sprite. Trap the A button press event to fire off a virtual mouse CLICK event and that’s it! Well, I guess there are a few details to fill in still – but you get the general idea. Get it working properly and you can interact with your movie/game with the mouse and the Wii controller.

TweenLite.to(speedTweeningBliss);

I can’t believe that I hadn’t heard about this tweening engine before! Originally, I was using the Boostworthy system, but that was a pain the ass for the simple animations that I needed. I started Ramen using Tweener and was pretty happy. Steven Sacks mentioned TweenLite in the Flash Tiger list and I took a look at it. It was faster than Tweener and shaved 8k off of my file sizes! Sweet!

Ramen, take 2

Ok, now I really mean that I’m going to learn AS3! In November, I started to work in a new web site framework, in AS3, as a practice exercise. I’m also trying to do it right, picking up a few design patterns along the way.

The main player is about 35k. All graphics and fonts (except for the opening preloader) are external. The content is driven from XML files and each page is it’s own reusable SWF template.

It’s got a few predefined design aids – text boxes, images, FLV player, hot spots, a transition system and event an event system for controlling other items on the page.

There is still a lot of work to do, mainly around sound – but it’s shaping up pretty nicely!

RAMEN.nudoru Player

Back to Vista

I moved my Dell laptop back to Vista. I updated all of the drivers and picked a more stable nVidia driver. Now all my issues are gone! I had one outstanding issue with Flash CS3 running slow, but after switching it to run in “XP SP2 Compatibility mode,” it runs fine.

I also probably helps that I added 2gb more ram – for 4gb total. This thing is fast now!

I’m out of complaints for Vista. It took a year – but better late than never.

Moving to a Mac

The experiences that I’ve had with Vista on my Dell Latitude have really turned me away from Windows. After all of the issues with poor driver performance (boo nVidia!), sleep issues (crashes when I close the lid 1 out of 5 times), and general weird things – I’ve decided to move to the Apple side of the fence.
We bought my brother’s G4 Powerbook for Casey to use as her main PC – aging but still does everything that she needs – mail, surfing, digital photos, etc. And we splurged and bought a new midrange iMac (with Leopard) for the “family” computer. I’ll have to keep the Latitude d820 until I can afford a MacBook, but I’m going to try to work on the iMac as often as I can – I work better on a desktop than a laptop anyway.

I setup BootCamp with XP on it. Installed all of my apps – works perfectly. When I was still at Hewitt, Citrix worked flawlessly on both the OS X side and the XP side.  The Adobe apps that I use work fine in Leopard. iTunes works better. The whole experience has just been wonderfully easy. Simple. Quiet.

I did have to find a utility to format my external harddrive (200gb) to FAT32 so that I could use it in OS X and Windows. OS X should really have the ability to write to a NTFS drive out of the box. That’s been the biggest pain in the whole “switch.”

I think that I’m going to like it over here.