Organize Imports in FlexBuilder
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.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.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.







