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

swfの置いてあるBaseパスを取得

Get Adobe Flash player
by naoto5959 25 Aug 2009
package {
    import flash.display.Sprite;
    import flash.text.*;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            var parseURL:Array = root.loaderInfo.url.split("/");
            var swfName:String = parseURL.splice(parseURL.length - 1, 1);
            var baseURL:String = parseURL.join("/");
            
            var txt:TextField = new TextField();
            txt.text = "swfURL: " + root.loaderInfo.url 
                     + "\nswfName: " + swfName 
                     + "\nbaseURL: " + baseURL;
            txt.autoSize = TextFieldAutoSize.LEFT;
            addChild(txt);
        }
    }
}