I have a problem with AS3.
Check for your self in the SWF (located below).
It wont load only one report form a user. It loads it from both users.
I need help to stop this, and only load it on the selected user.
How could I go about doing this?
Test it out and tell me what's wrong:
IF YOU WANT TO SEE THE XML FILE:
http://teamwhatsthei...lp/userTest.xml
Please, tell me!
Here's the script:
import flash.display.Sprite;import flash.events.Event;import fl.events.ListEvent;import fl.controls.List;import flash.net.*;var myXML:XML;var myLoader:URLLoader = new URLLoader();var req:URLRequest;var txt:String = "! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ";var myXML2:XML;var item:Object;req = new URLRequest("userTest.xml");myLoader.load(req);myLoader.addEventListener(Event.COMPLETE, processXML);myLoader.addEventListener(ProgressEvent.PROGRESS, progXML);myLoader.addEventListener(IOErrorEvent.IO_ERROR, failXML);function progXML(event:Event):void { feedBack.text = "Loading, please wait";}function processXML(e:Event):void { myXML = new XML(e.target.data); feedBack.text = "Loaded!"; scrollBar.update(); selectUser(myXML);}function failXML(e:Event):void { feedBack.text = "Failed Loading."; reasonBox.text = "Event happened: "+e; scrollBar.update();}function selectUser(userXML:XML):void { my_lst.removeAll(); feedBack.text = "Finding Users"; var userList:XMLList = userXML.user; for each (var userUser:XML in userList) { my_lst.addItem({label:userUser.userName, data:userUser.userName}); feedBack.text = "Found Users"; } my_lst.addEventListener(ListEvent.ITEM_CLICK, sendUserData);}function sendUserData(e:ListEvent):void { my_lst.removeAll(); Parseuser(myXML); feedBack.text = "Sending User Data";}function Parseuser(userXML:XML):void { var userList2:XMLList = userXML.user; for each (var userTitle:XML in userList2) { my_lst.addItem({label:userTitle.report.item.title, data:userTitle.report.item.reason}); feedBack.text = "Found Reports"; } my_lst.addEventListener(ListEvent.ITEM_CLICK, announceLabel); feedBack.text = "Finding Reports";}function announceLabel(e:ListEvent):void { titleBox.text = ""; reasonBox.text = ""; item= e.item; trace("Label: " + item.label); trace("Data: " + item.data); titleBox.text = item.label; reasonBox.appendText(item.data);}function xmlLoadError(e:IOErrorEvent) { trace("Unable to connect to Data source. \n" + e.text); reasonBox.htmlText = "<b>Unable to connect to Data source. /n"+e.text;}function handleSecurityError(e:SecurityErrorEvent ) { trace("SecurityErrorEvent: " + e.text); reasonBox.htmlText = "<b>SecurityErrorEvent:</b> "+e.text;}
Plus, I haven't gotten down to the reload button, or most of the clear button ><
Just busy fixing the bugs.
Please help!
-Fighterlegend