Move the Registration of a DisplayObject in AS3

It is very simple to move the pivot point of a DisplayObject such as a Sprite or movie clip. A lot of articles around the web suggest putting the DisplayObject inside of another Movieclip and giving it negative X/Y coordinates. This to me is not the same thing, and over complicates things by adding an unnecessary container.

Resolved: Flash Builder Crashes on Startup

So you start Flash Builder and the splash screen pops up, then disappears. What gives? Here’s a way to fix it in most cases.

Make sure that flash builder is not running in processes. (ctrl-shift-escape to open task manager)

Navigate to /users/yourname/Adobe Flash Builder 4.7/.metadata

delete .lock file.

Ternary / Conditional Operator in Actionscript 3

Like in many programming languages, Actionscript 3 allows for use of the ternary operator ?:

Let’s take a normal if statement as an example:

1
2
3
4
5
6
7
8
if( score == 10)
{
    win = true;
}
else
{
    win = false;   
}

This could be written in a different way using the ternary operator:

1
win = (score == 10) ? true : false;

So the syntax is: Expression ? statement : statement

Bring to Front Function

This one has been covered a million times on other sites but I thought I’d include it here anyway.

To move a MovieClip or other DisplayObject to the front of the stack, you can use the following function:

Annoying Adobe Illustrator Behavior Problem Solved

I am often given AI files (Adobe Illustrator) for the purpose of extracting assets for my flash projects. Over the past few months, I’ve been receiving a lot of files having been giving me this same issue.