flash在初始化时候能否获得url?难道必须通过事件触发吗?
asp页面中写得一句代码,通过它获得后台的变量,即听力的url:
<param NAME="flashvars" value="url=<%=address %>">
public function init():void{pl();}public function pl():void {if(status == true) {//如果status为true,就不播放音乐,否则继续播放。}else{trace("playing the position is "+pos);tim.addEventListener(TimerEvent.TIMER,showSoundWave);tim.start();if(pos == 0){ if(soundURL == null){//此处获得asp页面传来的url变量。[color=#FF0000][u]soundURL = root.loaderInfo.parameters["url"]; [/u][/color]Alert.show("soundURL---"+soundURL,"TITILE");var loader:URLLoader = new URLLoader(); var request:URLRequest = new URLRequest(soundURL);try {loader.load(request);} catch (error:Error) {trace("Unable to load requested document.");} sud.load(request);}else{}scn = sud.play(0);sud.addEventListener(IOErrorEvent.IO_ERROR,handleError);pb.addEventListener(Event.ENTER_FRAME,ud);scn.addEventListener(Event.SOUND_COMPLETE,replay);songztime_lbl.addEventListener(Event.RENDER,stime);playtime_lbl.addEventListener(Event.RENDER,stime);status = true;}else{sud.addEventListener(IOErrorEvent.IO_ERROR,handleError); scn = sud.play(pos);status = true;} }}