In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

Show SWFProfiler on start

Get Adobe Flash player
by beinteractive 13 May 2009
/**
 * Copyright beinteractive ( http://wonderfl.net/user/beinteractive )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/8hhA
 */

package
{
    import flash.display.Sprite;
    import flash.display.InteractiveObject;
    import flash.events.ContextMenuEvent;
    import flash.events.IEventDispatcher;
    import com.flashdynamix.utils.SWFProfiler;
    
    public class ShowSWFProfiler extends Sprite
    {
        public function ShowSWFProfiler()
        {
            setupSWFProfiler(this);
        }
        
        private function setupSWFProfiler(context:InteractiveObject):void
        {
            SWFProfiler.init(context);
            (context.contextMenu.customItems[0] as IEventDispatcher).dispatchEvent(new ContextMenuEvent(ContextMenuEvent.MENU_ITEM_SELECT));
        }
    }
}