I have some XML that I am reading from using Flex/ActionScript. When I load the XML, Flash Builder gives me an error that says Error: Unknown Property: 'EventTitle'.
at mx.collections::ListCollectionView/http://www.adobe.com/2006/actionscript/flash/proxy::getProperty()[E:\dev\4.y\frameworks\projects\framework\src\mx\collections\ListCollectionView.as:870].
The only place that I am referencing 'EventTitle' is below where I am loading it into a list.
When I remove the <Invite>
part from the XML, it loads fine. But once I add it in again it gives me the error. Below is the structure of the XML:
<Invites>
<Invite>
<EventTitle>HelloWorld</EventTitle>
</Invite>
<Invite>
<EventTitle>HelloWorld2</EventTitle>
</Invite>
</Invites>
I am using PHP to create the XML:
if ($_POST['method'] == "GET_INVITES") {
$sql = mysql_connect("localhost:8889", "---------------", "--------------");
if(!$sql) {
die('Could not connect:' . mysql_error());
}
mysql_select_db("Calendar", $sql);
$getInvitesQuery = mysql_query("SELECT * FROM `Invites` WHERE `To`='" . $_POST['userID'] . "'");
$result = "<Invites>";
$result .= "<Result>SUCCESS</Result>";
while($row = mysql_fetch_array($getInvitesQuery)){
$result .= "<Invite>";
$result .= "<FromID>" . $row['From'] . "</FromID>";
$result .= "<EventTitle>" . $row['Title'] . "</EventTitle>";
$result .= "<EventDay>" . $row['Day'] . "</EventDay>";
$result .= "<EventHour>" . $row['Hour'] . "</EventHour>";
$result .= "<EventMinute>" . $row['Minute'] . "</EventMinute>";
$result .= "</Invite>";
}
$result .= "</Invites>";
print($result);
}
I am using HTTPService in Flex/ActionScript to load the XML from the PHP file into a list. Here is the code:
<s:HTTPService id="getInvites" result="getInvitesResult(event)" method="POST" url="http://localhost/invite.php" useProxy="false">
<s:request xmlns="">
<method>GET_INVITES</method>
<userID>{my_id.text}</userID>
</s:request>
</s:HTTPService>
<s:List id="invites" x="5" y="295" width="310" change="rowSelected(event)">
<s:dataProvider>
<s:ArrayCollection source="{getInvites.lastResult.Invites.Invite.EventTitle}"/>
</s:dataProvider>
</s:List>
I have been working and trying to figure out a solution for 2-3 hours. Any help is much appreciated.
Thanks, Jacob