swfの置いてあるBaseパスを取得
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);
}
}
}