all groups > flash actionscript > july 2006 >
You're in the

flash actionscript

group:

aaarrrrgggghhhhhh


aaarrrrgggghhhhhh samdl1
7/8/2006 8:53:44 PM
flash actionscript:
var my_xml:XML = new XML(xmlstring);
var myLoginReply_xml:XML = new XML();

myLoginReply_xml.ignoreWhite = true;
myLoginReply_xml.onHTTPStatus = function(httpStatus:Number) {
showAlert("onhs loaded");
this.httpStatus = httpStatus;
if(httpStatus < 100) {
showAlert("flashError");
}
else if(httpStatus < 200) {
showAlert("informational");
}
else if(httpStatus < 300) {
showAlert("successful");
}
else if(httpStatus < 400) {
showAlert("redirection");
}
else if(httpStatus < 500) {
showAlert("clientError");
}
else if(httpStatus < 600) {
showAlert("serverError");
}
}

myLoginReply_xml.onLoad = function(success:Boolean){
showAlert("onload called");
if (success) {
showAlert("onload success");
var messages:String =
this.childNodes[0].childNodes[1].childNodes[0].nodeValue;
showAlert("sam" + messages);
if(this.childNodes[0].childNodes[0].childNodes[0].nodeValue == "true"){
XMLStatus = true;
}
else {
XMLStatus = false;
}
} else {
showAlert("Operation unsuccessful EC:1009");
}
};

my_xml.sendAndLoad(xmlFullPath, myLoginReply_xml);


httpstatus isnt called, niether is onLoad

showAlert is a function just to popup an alert component with the specified
string - none of them popup

please can anyone see where the problem is?

Sam
Re: aaarrrrgggghhhhhh Craig Grummitt
7/9/2006 1:43:18 AM
i pasted your above code into a flash file, set the variable xmlFullPath to a
path to an xml file, set up a function showAlert to trace what it receives, and
i received the responses:

onload called
onload success
samundefined

i then tried what would happen if the path was set to undefined and i still
received a response. are you sure you don't have problems with your showAlert
function?
Re: aaarrrrgggghhhhhh Motion Maker
7/9/2006 12:35:05 PM
You can eliminate the showAlert being the problem, with trace statements. If
they are working and the showAlert is not, then you do have an issue with
showAlert.

As well if you are testing outside the IDE, then you should use a simple
dynamic TextField for tracing.

Be sure any Flash ui components are exported in time for use.

--
Lon Hosford
www.lonhosford.com
Flash, Actionscript and Flash Media Server examples:
http://flashexamples.hosfordusa.com
May many happy bits flow your way!
[quoted text, click to view]

Re: aaarrrrgggghhhhhh samdl1
7/9/2006 3:22:25 PM
thankyou for the reply

the showAlert function is definately fine..it calls no problem when the
function this code belongs to is called and in other places too...

its actually quite weird because it just kinda stopped working without really
changing much code...

I changed it to send and _blank so i could see the response and it was
absolutely fine too - sometimes i hate flash

Sam
AddThis Social Bookmark Button