Visit the FlashNewz Directory

Software
Download, Desktop...

Communities
Communicate, Help...

Forums
search, learn...

Animation
Animate, Frames...

Resources
books, help...

Tools
add ons, extra's...

Tutorials
books, help...

News
Technology, Business...

Submit your site for FREE

Organize Imports in FlexBuilder


Stefan Richter By: Stefan Richter

Do you write a lot of ActionScript classes in FlexBuilder? I do and one of the great little keyboard shortcuts I use time and time again is Apple-Shift-O (or Source > Organize Imports, for a Windows shortcut consult the docs).

What this command will do is remove all unnecessary imports and organize all the required ones nicely. A block of code such as this:

import flash.display.Loader;
import flash.display.MovieClip;
import com.muchosmedia.liveplayer.ApplicationFacade;

import org.puremvc.as3.interfaces.IMediator;
import org.puremvc.as3.interfaces.INotification;
import org.puremvc.as3.patterns.mediator.Mediator;
import flash.events.MouseEvent;
import com.muchosmedia.liveplayer.model.FlashVarsProxy;
import com.pyar.countdownClock.CountdownClockEvent;
import flash.text.TextColorType;
import flash.geom.ColorTransform;

will end up looking like this:

import com.muchosmedia.liveplayer.ApplicationFacade;
import com.muchosmedia.liveplayer.model.FlashVarsProxy;
import com.pyar.countdownClock.CountdownClockEvent;

import flash.display.Loader;
import flash.events.MouseEvent;

import org.puremvc.as3.interfaces.IMediator;
import org.puremvc.as3.interfaces.INotification;
import org.puremvc.as3.patterns.mediator.Mediator;

So hit that shortcut once in a while, it’s worth the split second it take. Note that this won’t work with MXML files, but only in ActionScript class files.

About The Author

Stefan is a certified Flash Developer who has been involved with Flash Media Server since its very early days. From his home office in the UK he has handled a variety of projects, specializing in Flash Video and Rich Internet Applications for clients that include CNET, USA Network and Unilever. Stefan is the author of a series of Adobe Developer Center articles, has spoken at several industry events and contributes a regular column on Flash Video to Streaming Media Magazine. His site www.flashcomguru.com is one of the largest online resources on Flash Video.

Leave a Reply