SimpleAS3: It Doesn’t Get Any Easier Than This!

What is SimpleAS3?

SimpleAS3 offers a fresh approach to Flash scripting that helps regular users create interactive experiences with less code than standard AS3. Typical daily tasks are easier when the compiler is not as strict, and you can do your job without constantly searching for the meaning of a million obscure errors.

Example Task: Loading An External Image And Making it Link to a Website Upon Clicking It

Standard AS3 Code:

var imageLoader:Loader = new Loader();
this.addChild( imageLoader );

var request:URLRequest = new URLRequest( "images/button.png" );
imageLoader.load( request );

loader.addEventListener( MouseEvent.CLICK, imageClickHandler );
function imageClickHandler( event:MouseEvent ):void
{
	var request:URLRequest = new URLRequest( "http://www.example.com/" );
	navigateToURL( request, "_self" );
}

Using SimpleAS3 Syntax:

var loader = this.loadChild( "images/button.png" );

loader.onClick(function()
{
	getURL( "http://www.example.com/", "_self" );
});

Understanding the Difference:

There obviously a lot less code when using SimpleAS3 and that’s all in a nutshell. If you are a non-developer or simply don’t have time to learn AS3 from scratch, I think SimpleAS3 will benefit you. However, if you are a Flash developer, I’d recommend stick to learning AS3 from scratch.

Additional Resources:

2 thoughts on “SimpleAS3: It Doesn’t Get Any Easier Than This!

  1. i used the standard as3 code but the image isnt clickable.

    what happens is the image loads at x=0, y=0, (even if my loader movieclip is located anywhere else on the screen).

    clicking on the image doesnt work, only clicking on the movieclip called loader works. this is a problem if i want my image to load right on top of the movieclip named loader, because the mouseclick cant focus on the mc loader due to it being hidden under my image.

Comments are closed.