开发者

ActionScript3: how to get real url of page in which swf is placed?

开发者 https://www.devze.com 2023-01-27 09:32 出处:网络
So I tried var url:String = String(this.loaderInfo.url); var request:URLRequest = new URLRequest(url); try {

So I tried

            var url:String = String(this.loaderInfo.url);
            var request:URLRequest = new URLRequest(url);
            try {
                navigateToURL(request, '_self'); // second argument is target
            } catch (e:Error) {
                ErrorButton.label = "Please refresh page manually"
            }

and

            var url:String = String(this.loaderInfo.loaderURL);
            var request:URLRequest = new URLRequest(url);
            try {
                navigateToURL(request, '_self'); // second argument is target
            } catch (e:Error) {
                ErrorButton.label = "Please refresh page manually"
            }

and FlexGlobals.topLevelApplication.url but it all gives same=(

but thay bouth return me to http://127.0.0.1/w2/window.swf while I had url http://127.0.0.1/w2/wind开发者_Python百科ow.php?action=read#1. I use flash builder. So what shall I do to recive real full link - not swf link?


What about

var _url:String = flash.external.ExternalInterface.call("window.location");
0

精彩评论

暂无评论...
验证码 换一张
取 消