要从 Flash 转到页面,您需要执行navigateToURL
以下操作:
navigateToURL(new URLRequest("http://mydomain.com/test/reroute.php"), "_self");
编辑
要对重定向网址进行软编码,我建议您这样做(我怀疑这与您要查找的内容更相关)
private var loader:URLLoader=new URLLoader();
private function init():void {
//In the class initialize handler
loader.addEventListener(Event.COMPLETE, redirectReceived);
}
private function redirectReceived(e:Event):void {
if(StringUtil.trim(e.target.data).length > 0) {
navigateToURL(new URLRequest(e.target.data), "_self");
}
}
private function buttonClick(e:MouseEvent):void {
loader.load(new URLRequest("http://path_to_the_php_which_tells_you_where_to_redirect"));
}
告诉你重定向到哪里的 php 将是这样的:
<?php
session_start();
if(isset($_SESSION['user'])){
echo('Location: http://mydomain.com/test/reroute.php');
}
?>