How to write log file in AS3 ?
Copy link to clipboard
Copied
I've a flash project that's developed in Flash 3.0 and action script 3.0. My requirement is I need to print debug statements
into a seperate text file. on the server
To be in detail Let's assume that I need to print my debug statements inside the file can someone provide us with the sample code
snippet that prints stataments inside a text file?. Your help would be much appreciated.

Copy link to clipboard
Copied
A good way to do this would be to connect to a php script and use the following statements
try{
}catch(e:Error){
var newUrlRequest('php server script here')
newUrlVariables.target=e.target
newUrlVariables.type=e.type
newUrlVariables.typeOfCaller=arguments.callee
newUrlRequest.data= newUrlVariables
sendToURL(newUrlRequest)
}
Copy link to clipboard
Copied
Is it possible to write the txt file without php.or any oher methad by to write xml file..
Copy link to clipboard
Copied
Error class haven't properties like target and type.
In most cases you must provide your custom exeptions that extends the error class or because error class is dynamic you may define own properties but must rethrow the error class.
You may in catch just log your custom msg like this
try
{
}
catch( exc: Error )
{
// Something bad was happend
}

