I had to piece this info together from bits and bobs all over the net, and even some experimentation.  I searched a LOT and there wasn’t one page that dealt with it in its entirety.  And I still had to work out some of this through trial and error.

These instructions assume you already know how to construct a class file and link it to your MovieClip.

Above your member variable that you want to expose, simply put [Inspectable], and don’t give a starting value, eg.

private var start_x:Number;

Every time you make changes like this, you have to

  1. Right click the movieclip in the library, click “Component Definition” remove all parameters (with minus button) delete the Class name, and click OK
  2. Go back to Component Definition again and re-enter the Class name (name of your linked class) and click OK
  3. Delete the MovieClip instance from the stage
  4. Re-add the MovieClip to the stage, and give it it’s instance name again.
  5. Click on the instance and on the Properties pane, under Component Parameters, you should see the variables – enter a starting value for the variable.  (A default parameter will not work, you need to enter one here to kick it off)

Additionally, if you need access to this variable to initialise the object, it won’t be available when the Class constructor is run, it’s only available when the first frame is run.  You have to add a little init hack, by creating a one time event for EnterFrame to an init function which removes itself from the event handler.  Eg.

import flash.events.Event;
private var my_var:String;

public function MyClass()
    addEventListener(Event.ENTER_FRAME, initHandler);
    trace("my_var has no value:"+my_var);

private function initHandler(evt:Event):void
    removeEventListener(evt.type, initHandler);
    trace("my_var now has a value:"+my_var);

Hey it happens to the best of us – you right-click and click something that just “felt” like the right one because you were moving too quickly… Read the rest of this entry »

You don’t want to lose all your European vacation photos by accidental deletion or hard drive failure.

Read the rest of this entry »

Posted: March 26, 2012 in Uncategorized
Tags: ,

Move iTunes Library

Posted: March 23, 2012 in Uncategorized
Tags: , ,

I found a few of these tutorials but none quite so thorough as I needed. Read the rest of this entry »

Recover iTunes purchases!

Posted: March 23, 2012 in Uncategorized
Tags: , ,

So I wiped my computer without remembering to include my iTunes music folder.  I’ve updated my backup procedure to ensure this doesn’t happen again.  But what to do in the meantime? Read the rest of this entry »

This was driving me nuts with a new motherboard, and I can’t believe I had to google for so long to find the answer. Read the rest of this entry »

Typically, DVD or CD drives stop opening reliably after a while, and sometimes if you tap forcefully on the drive after pressing eject, you can coax it open. Well here’s how to get it running smoothly again and stop the violence. Read the rest of this entry »

Posted: March 18, 2012 in Uncategorized
Tags: , ,