tik_webmaster
22.08.2010, 22:23
загружаю xml сохраненный в переменной из файла 32.php
import flash.display.Sprite;
import flash.events.*;
import flash.net.*;
var loader:URLLoader = new URLLoader();
configureListeners(loader);
var request:URLRequest = new URLRequest("http://localhost/lv/32.php");
try {
loader.load(request);
} catch (error:Error) {
trace("Unable to load requested document.");
function configureListeners(dispatcher:IEventDispatcher):void {
dispatcher.addEventListener(Event.COMPLETE, completeHandler);
}
function completeHandler(event:Event):void {
var loader:URLLoader = URLLoader(event.target);
var vars:URLVariables = new URLVariables(loader.data);
var xmlMenu:XML = new XML();
xmlMenu=XML(vars.xmlmenu);
trace(xmlMenu.child("items")[0].toXMLString());
}}
в php файле написано
<?php
$xmlmenu = "
<menuelements>
<items>
<item>
<label>Home</label>
<linkTo>http://localhost/samvar4/index.php?option=com_content&view=frontpage&lang=en</linkTo>
</item>
<item>
<label>About Company</label>
<linkTo>http://localhost/samvar4/index.php?option=com_content&view=article&id=3&lang=en</linkTo>
</item>
<item>
<label>Drilling</label>
<linkTo>http://localhost/samvar4/index.php?option=com_content&view=article&id=2&lang=en</linkTo>
</item>
<item>
<label>Construction of wells</label>
<linkTo>http://localhost/samvar4/index.php?option=com_content&view=article&id=9&lang=en</linkTo>
</item>
<item>
<label>Filtering</label>
<linkTo>http://localhost/samvar4/index.php?option=com_content&view=article&id=10&lang=en</linkTo>
</item>
</items>
</menuelements>
" ;
/*
print the variables to the output in order to let flash read them
*/
$vars = "" ;
$vars .= "xmlmenu=" . $xmlmenu ;
echo $vars ;
?>
выдает ошибку
TypeError: Error #1085: The element type "linkTo" must be terminated by the matching end-tag "</linkTo>".
at _fla::MainTimeline/completeHandler()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
может быть причина в специальных символах в теге linkTo ??
подскажите пожалуйста
import flash.display.Sprite;
import flash.events.*;
import flash.net.*;
var loader:URLLoader = new URLLoader();
configureListeners(loader);
var request:URLRequest = new URLRequest("http://localhost/lv/32.php");
try {
loader.load(request);
} catch (error:Error) {
trace("Unable to load requested document.");
function configureListeners(dispatcher:IEventDispatcher):void {
dispatcher.addEventListener(Event.COMPLETE, completeHandler);
}
function completeHandler(event:Event):void {
var loader:URLLoader = URLLoader(event.target);
var vars:URLVariables = new URLVariables(loader.data);
var xmlMenu:XML = new XML();
xmlMenu=XML(vars.xmlmenu);
trace(xmlMenu.child("items")[0].toXMLString());
}}
в php файле написано
<?php
$xmlmenu = "
<menuelements>
<items>
<item>
<label>Home</label>
<linkTo>http://localhost/samvar4/index.php?option=com_content&view=frontpage&lang=en</linkTo>
</item>
<item>
<label>About Company</label>
<linkTo>http://localhost/samvar4/index.php?option=com_content&view=article&id=3&lang=en</linkTo>
</item>
<item>
<label>Drilling</label>
<linkTo>http://localhost/samvar4/index.php?option=com_content&view=article&id=2&lang=en</linkTo>
</item>
<item>
<label>Construction of wells</label>
<linkTo>http://localhost/samvar4/index.php?option=com_content&view=article&id=9&lang=en</linkTo>
</item>
<item>
<label>Filtering</label>
<linkTo>http://localhost/samvar4/index.php?option=com_content&view=article&id=10&lang=en</linkTo>
</item>
</items>
</menuelements>
" ;
/*
print the variables to the output in order to let flash read them
*/
$vars = "" ;
$vars .= "xmlmenu=" . $xmlmenu ;
echo $vars ;
?>
выдает ошибку
TypeError: Error #1085: The element type "linkTo" must be terminated by the matching end-tag "</linkTo>".
at _fla::MainTimeline/completeHandler()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
может быть причина в специальных символах в теге linkTo ??
подскажите пожалуйста