Ask a Question related to Macromedia Flash Data Integration, Design and Development.
-
indiramm #1
Replace XML is not working
Hi,
I'm trying to load some content into flash from an XML rss feed.
I took the original code from gotoandlearn, and all I added was some buttons
to make this content change.
that is, when I click on a button, the xml has to be replaced for another one.
It works except that instead of replacing the content, it ADDs to the XML
list, everytime I click on the buttons.
I tried removing children but it doesn't work, cause it leaves no place to put
the new content.
HAve to say I'm kinda lost :)
thanks a lot!!!
Code:
import flash.display.Loader;
import flash.net.URLRequestMethod;
import flash.net.URLLoader;
import flash.display.LoaderInfo;
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.COMPLETE, onLoaded);
lb.addEventListener(Event.CHANGE, itemChange);
function itemChange(e:Event):void
{
ta.text = lb.selectedItem.data;
}
var xml:XML;
var arr:Array = new Array();
var il:XMLList;
function onLoaded(e:Event):void
{
xml = new XML(e.target.data);
il = xml.channel.item;
for(var i:uint=0; i<il.length(); i++)
{
lb.addItem({data:il.description.text()[i],
label:il.title.text()[i]});
}
}
loader.load(new URLRequest("http://localhost/indira/category/txt/?feed=rss"));
this.bt_foto.addEventListener(MouseEvent.CLICK,Cli cFoto);
function ClicFoto(e:Event):void
{
xml = new XML
//il = 0;
loader.load(new URLRequest("http://localhost/indira/category/foto/?feed=rss"));
//il.removeItem();
//il = xml.channel.item;
//delete(xml);
trace(lb.numChildren);
}
this.bt_web.addEventListener(MouseEvent.CLICK,onCl ickweb);
function onClickweb(e:Event):void
{
trace(loader.data);
loader.load(new
URLRequest("http://localhost/indira/category/netweb/?feed=rss"));
}
indiramm Guest
-
help with the replace(pattern, replace)
hii i hope you can help me, i want to replace two parameters on the same replace, the idea it's print in a textArea a XML file from a webService,... -
Replace pages not working
I open a file Using the replace pages function under document menu Select my document and page to replace with New page shows up in current... -
Macromedia Flash Player installed and working properly suddenlys stops working..
No idea what has caused the Flash player to stop working. This is not my machine but a relatives who has asked for help over the T'giving... -
calling Javascript: location.replace('url') inside Flash not working..
Hello, I'm trying to call a Javascript statement via Flash but it will not work the way it normally does when I call it in plain HTML. I'm... -
Search and replace (super global replace)
I am using the 30 day trail of acrobate professional....before I buy it I have a few questions.... 1) is there a "search and replace" function... -
indiramm #2
Re: Replace XML is not working
Finally, it was pretty easy, at least now that it works:
I just had to remove all:
lb.removeAll();
:)
indiramm Guest



Reply With Quote

