Read More Ninja Action!

Sync WoW Addons and Settings with Live Mesh

By now I'm guessing that most internet junkies are aware of the buzz-wordy thing called "Cloud Computing" so I won't go into great detail about it in this article. Rather, I am going to show you how you can use some existing cloud computing technology to make your World of Warcraft life a little bit better.

Microsoft jumped onto the cloud computing scene with a little application called "Live Mesh." Sexy ehh? Ya, I thought so too...I mean, who doesn't like that term...mesh. Just rolls right off the tongue. Any way, this application aims to accomplish at least a portion of the overall cloud computing goal...data synchronization.

So how can I use this to help me play video games you're asking? Good question! Here is how:

Modern MMOs all seem to have adopted this "build it yourself UI" concept. This allows players and developers and total assholes to create and publish "add-ons" for the game's UI. Obviously this is a fantastic thing, whereas users can now get exactly what they desire out of the in-game experience however, it does come with a few drawbacks.

  • No server based settings or state
  • No data backup or restore
  • No support for multiple clients

Now with the help of Live Mesh, we are able to fix it! To start you will need to download the Live Mesh application which is simply located at www.mesh.com. At the time of this posting the application is currently in Beta, but I can attest that it works perfectly on my Mac, PC and Smart Phone.

For the sake of this tutorial I'm going to show you how I sync my addons and settings between my Macbook and my Windows Vista machine. I'll be starting with the Macbook...but you should be able to start this process with either OS. Additionally, you may be using two computers running the same OS...that works too.

After Mesh is installed, and running you will see an icon located in your application try area. You should start by ctrl-clicking, or right-clicking the icon. This will allow you to add a new "mesh enabled" folder.

New Folder

Now you'll be greated with a new folder dialog. This allows you to name the folder and choose a particular location for it. You need to name the folders according to what WoW has decided...this makes it easier in the long run.

You'll be naming the folders: Interface and LOGIN.

Choose Folder

At this point you are going to need to choose the two WoW folders which hold all of your of your addon settings and files. You will find each one of these folders at the following locations:

  • [WoW_Root]\Interface
  • [WoW_Root]\WTF\Account\Login Name

Folder Locations

After choosing these folders you will have effectly completed the "Mesh process" for your first machine. Now it is time to get these things syncing with a second computer.

Folder Locations

This process is actually very similar, with one key difference...you're syncing an existing Mesh folder, not adding a new one.

So let's start by clicking the Live Mesh icon in the application tray again. Here you will have the ability to select the folder icon. This gives you a link to "Manage folders."

This should open the "Live Mesh folders" folder. Here you will see every Mesh enabled folder you have, including ones that are already being synced.

In this case you should be looking for two non-synchronized folders called Interface, and LOGIN.

Live Mesh Folders

Now you will want to right-click one of the two folders and choose "Sync with this computer."

Sync Folders

For the final step you simply need to map to the new WoW folders. In case you forgot where they are...here's that list again.

  • [WoW_Root]\Interface
  • [WoW_Root]\WTF\Account\LOGIN

Sync Folders

So that is it. Once this is done you can now move back-and-forth between computers while maintaining your same settings and addons. It's great for those days when you just want to lie around on the coutch with the laptop.
Read More Ninja Action!

Coding a button in Actionscript 3

Hello everyone, I'm going to start off with some basics in Flash, beginning with adding scripts for buttons in AS3.

It's a fairly big departure from how you COULD use buttons in as2. The biggest change is that you should no longer put code on the button itself, code for buttons goes on the timeline in as 3.

1. So to begin we'll add a button to the stage. I normally just draw a box on the stage and convert to a button symbol. I find it's useful to use invisible buttons (just move the box into only the "Hit" area of the button symbol), it makes things far more flexible. In a later tutorial, I'll show you how to add an invisible button to the stage dynamically at runtime. Make sure you give your button an instance name. Let's call this one "myButton".

2. Now that we have a button on the stage, add a keyframe to your actions layer in the same frame as the button. Normally you would put this code on your timeline in the first frame the button shows up on the stage.

3. Enter the code below:
myButton.addEventListener(MouseEvent.CLICK, myButtonClick);

function myButtonClick(ev:MouseEvent):void
{
trace("myButton has been clicked.");
}


4. Let's go through line-by-line and examine the contents.
myButton.addEventListener(MouseEvent.CLICK, myButtonClick);

This adds an event listener to the button. Notice we use the button's instance name here ("myButton") as opposed to its name in the library. You can see here that we are listening to a CLICK, a simple mouse click. When we hear the CLICK, the function "myButtonClick" is run. "myButtonClick could be the name of any function you'd like to run when the button is clicked.
function myButtonClick(ev:MouseEvent):void

This is just a basic function declaration. First we have the name of the function ("myButtonClick"). Then we have a parameter in parenthesis, "ev:MouseEvent". This just means that this function needs to be passed a MouseEvent, and the function's name for that event will be "ev", which could really be anything you like. The void at the end just means that this function will not return anything, it runs and is finished.
trace("myButton has been clicked.");

This is just a trace statement for sending text to the output window during development. This area is where you would put all of the code you'd like to execute once the button is clicked.

Wrapping Up


That's all there is to it! In the FLA I've included below, I've also added listeners for ROLL_OVER and ROLL_OUT, two commonly used button states. ROLL_OVER is used to run a function when a user rolls over the button, and ROLL_OUT for when they roll back out of the button's hit state. Please refer to the FLA for instructions on how to use them in detail.

And the code here so you can see what I mean:

//http://www.ninjacamp.com
//First, add all of your event listeners
myButton.addEventListener(MouseEvent.CLICK, myButtonClick);
myButton.addEventListener(MouseEvent.ROLL_OVER, myButtonRollover);
myButton.addEventListener(MouseEvent.ROLL_OUT, myButtonRollout);

function myButtonClick(ev:MouseEvent):void
{
//Put code you'd like to execute when the button is clicked below
trace("myButton has been clicked.");
}
function myButtonRollover(ev:MouseEvent):void
{
//Put code you'd like to execute when the button is rolled over below
trace("myButton has been rolled over.");
}
function myButtonRollout(ev:MouseEvent):void
{
//Put code you'd like to execute when the button is rolled out below
trace("myButton has been rolled out.");
}

Sample Code (AS3, CS4)