Привет всем, сегодня я пытаюсь получить ссылку на файл XML, переданный из кода Object Embed в мой Flash-фильм.(Не используя SWFobject).У меня есть 1 SWF-файл, который можно подключить к 3 различным XML-файлам.
Попытка 1
Ниже приведен HTML-код (я пытаюсь получить theXMLпуть):
<div class="left">
<h2>300 x 353 Green Accent Color</h2>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','300','height','353','src','TEN','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','TEN' ); //end AC code
</script><noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="300" height="353">
<param name="movie" value="player.swf" />
<param name="quality" value="high" />
<param name="XML" value="client_user.xml" />
<embed src="T.swf" allowscriptaccess="always" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="300" height="353"></embed>
</object></noscript>
</div>
Класс документов
private var theXML:String = root.loaderInfo.parameters.xmlPath;
public function TEN():void
{
if (stage) init();
else addEventListener(Event.ADDED_TO_STAGE, init);
}
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
xmlLoader.addEventListener(Event.COMPLETE, xmlCompleteHandler);
xmlLoader.load(new URLRequest(root.loaderInfo.parameters.xmlPath));
loader = new BulkLoader("bulky");
loader.logLevel = BulkLoader.LOG_INFO;
loader.addEventListener(BulkLoader.COMPLETE, onBulkLoadComplete);
loader.addEventListener(BulkLoader.PROGRESS, onBulkLoadProgress);
//loader.add("client.xml",{id:"xmldata"}); //<- for TESTING
//loader.add(theXML+".xml",{id:"xmldata"}); //<- for LIVE
loader.add(xmlPath+".xml",{id:"xmldata"}); //<- for LIVE
loader.start();
}
Попытка 2
HTML с другим синтаксисом передачи PARAM:
<div class="right">
<h2>520 x 477 Blue Accent Color</h2>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','300','height','353','src','TEN','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','TEN' ); //end AC code
</script><noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="300" height="353">
<param name="movie" value="T.swf?xmlPath=0" />
<param name="quality" value="high" />
<param name="xmlPath" value="520.xml" />
<embed src="T.swf" allowscriptaccess="always" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="300" height="353"></embed>
</object></noscript>
</div>
Попытка 3
Обновление флэш-кода:
private var theXML:String = "";
private function init(e:Event = null):void
{
removeEventListener(Event.ADDED_TO_STAGE, init);
theXML = stage.loaderInfo.parameters.xmlPath;
loader = new BulkLoader("bulky");
loader.logLevel = BulkLoader.LOG_INFO;
loader.addEventListener(BulkLoader.COMPLETE, onBulkLoadComplete);
loader.addEventListener(BulkLoader.PROGRESS, onBulkLoadProgress);
//loader.add("client_user.xml",{id:"xmldata"}); //<- for TESTING
loader.add(theXML,{id:"xmldata"}); //<- for LIVE
//loader.add(theXML+".xml",{id:"xmldata"}); //<- for LIVE
loader.start();
}
Обновление HTML-кода:
<div class="right">
<h2>520 x 477 Blue Accent Color</h2>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','300','height','353','src','TEN','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','T' ); //end AC code
</script><noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="300" height="353">
<param name="movie" value="T.swf?xmlPath=0.xml" />
<param name="quality" value="high" />
<param name="xmlPath" value="520.xml" />
<embed src="T.swf?xmlPath=520.xml" allowscriptaccess="always" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="300" height="353"></embed>
</object></noscript>
</div>
Rightтеперь он не загружает XML-файл из параметра: (