|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Hi all,
I use Flash MX and planned to make a dynamic form by this tool with XML. But my flash does not work. Here is my source code. 1. Actionscript var xmlProduct; var urlProductData = "http://localhost/product.php"; function setMessage(strMessage) { lblMessage.text = strMessage; } function myOnLoad(isSuccess) { if (isSuccess) { setMessage("Request is sent. Please wait for a moment..."); } else { setMessage("Request cannot be sent. Please try again."); } } function loadProduct() { urlQuery = urlProductData + "?modelno=" + txtModel.text; setMessage("Loading... URL as " + urlQuery); xmlProduct = new XML(); xmlProduct.onLoad = myOnLoad; xmlProduct.load(urlQuery); // I halt here if (xmlProduct.loaded) { setMessage(xmlProduct.status); parseProduct(xmlProduct); } else { setMessage("No XML is loaded"); } } function parseProduct(xmlContent) { setMessage(xmlContent.toString()); } 2. XML <?xml version='1.0'?> <ecat> <product> <modelno>1234</modelno> </product> </ecat> After I check by some message, I found my flash was halt at the comment "// I halt here". Why I cannot call xml.loaded? is there any restriction? I have placed them in the same folder. What else? Please advise.
__________________
------------------------------------------ Perl Kids Kiss Perl Stanley ------------------------------------------ |
|
#2
|
|||
|
|||
|
ignoreWhite
i didn't look real close at it, but you may wanna add this line...
xmlProduct.onLoad = myOnLoad; ---> xmlProduct.ignoreWhite = true; xmlProduct.load(urlQuery); if that doesn't get you any further i'll look more into it...rob
__________________
Delenda est Carthago |
|
#3
|
|||
|
|||
|
This line that assigns the onLoad handler points to a function. That function is where you should handle your parsing.
xmlProduct.onLoad = myOnLoad; Code:
function myOnLoad(isSuccess)
{
if (isSuccess)
{
parseProduct(this)
}
else
{
setMessage("Request cannot be sent. Please try again.");
}
}
|
![]() |
| Viewing: Dev Shed Forums > Web Design > Flash Help > Flash and XML |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|
|