AS: Main - all sorts of coo stuffs
This is another tutorial that helps alot with debugging, I will cover manipulation of the output panel, it allows you to output text when testing your movie/game, it is VERY importent for de-bugging since you can check all the variables/expressions with him.
The basic "trace" command
the simplest and most importent command for the output window is the trace command:
trace()
Availability
Flash Player 4.
Usage
trace(expression)
Parameters
expression An expression to evaluate. When a SWF file is opened in the Flash authoring tool (using the Test Movie command), the value of the expression parameter is displayed in the Output panel.
Returns
Nothing.
Description
Statement; evaluates the expression and displays the result in the Output panel in test mode.
Use this statement to record programming notes or to display messages in the Output panel while testing a SWF file. Use the expression parameter to check whether a condition exists, or to display values in the Output panel. The trace() statement is similar to the alert function in JavaScript.
You can use the Omit Trace Actions command in the Publish Settings dialog box to remove trace() actions from the exported SWF file.
-------
I just copied the documentation since "trace" is a rather simple command.
trace(string);//traces the string
trace("Hello");//traces hello
trace("HP is :"+hp);//traces HP is: and then the variable hp
trace is very simple, and VERY powerful, use it to track variables hitTests and others
The outputPanel object
note: I'll make it clear again that it ONLY WORKS WHEN YOU TEST THE MOVIE, it's FOR DEBUGGING.
the outputPanel uses flash MX 2004's ability to use JSAPI, you can access it the way you access other flash java commands, I'll brief you since it's not as hard as it sounds.
to clear the entire debugging screen use the "clear" command, this is it's syntax
fl.outputPanel.clear();
the fl. represents your current flash movie, I rather you just remmember the syntax ;)
fl.outputPanel.save(fileURI [, bAppendToFile])
this saves the output window context to your hard drive allowing you to analyze the results, it's syntax is for example
fl.outputPanel.save("file:///c|/log.txt");
you can use any available path, flash will create/rewrite the file, however if you want flash NOT to be able to rewrite the file, but only to be able to append io it, you can use
fl.outputPanel.save("file:///c|/log.txt",true);
this will extend the current log
that's basically it. Very useful once you get to know it.
As ususal ask any questions