3 Replies - 1207 Views - Last Post: 14 January 2009 - 01:22 PM

#1 launcher  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 01-January 09

How to fix the error?

Posted 14 January 2009 - 03:10 AM

I tryed to send information from php file to flash file but there is one error that i can't fix.Can someone tell me from where it comes from and how can i fix it.

here's my code.

PHP
..............

while($array = mysql_fetch_array($action)) 
{		
$id_vic = $array['0']; 
$vic_ = $array['1']; 
echo('<? xml version="1.0" encoding="UTF-8" standalone="no" ?>');
echo('<root>');
echo("<item id=\"$id_vic\" vic=\"$vic_\"> </item>");
echo('</root>');	
}
mysql_close($conn);

............



action script
var xml:XML;
var xmlList:XMLList;
var xmlLoader:URLLoader = new URLLoader;
					
xmlLoader.load(new URLRequest("../PHP/general.php"));
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
															 
function xmlLoaded(event:Event):void
{
xml = XML(event.target.data);
xmlList = xml.children();
trace(xmlList.attribute("vic"));
}



error
TypeError: Error #1090: XML parser failure: element is malformed.
	at MethodInfo-142()
	at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
	at flash.events::EventDispatcher/dispatchEvent()
	at flash.net::URLLoader/flash.net:URLLoader::onComplete()



This post has been edited by launcher: 14 January 2009 - 01:51 PM


Is This A Good Question/Topic? 0
  • +

Replies To: How to fix the error?

#2 BetaWar  Icon User is offline

  • #include "soul.h"
  • member icon

Reputation: 1184
  • View blog
  • Posts: 7,254
  • Joined: 07-September 06

Re: How to fix the error?

Posted 14 January 2009 - 06:32 AM

Well, xmlList should be an array so that means you would have to access it like so:

xmlList[0].attribute("vic");


To get the first element of the array.

Hope that works
Was This Post Helpful? 0
  • +
  • -

#3 launcher  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 10
  • Joined: 01-January 09

Re: How to fix the error?

Posted 14 January 2009 - 07:13 AM

The same error. With XML works but with xml created by php doesnt work. Why?
Was This Post Helpful? 0
  • +
  • -

#4 Jayman  Icon User is offline

  • Student of Life
  • member icon

Reputation: 418
  • View blog
  • Posts: 9,532
  • Joined: 26-December 05

Re: How to fix the error?

Posted 14 January 2009 - 01:22 PM

Modified title to be more descriptive of the problem.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1