00:00
00:00
Newgrounds Background Image Theme

ErinJA just joined the crew!

We need you on the team, too.

Support Newgrounds and get tons of perks for just $2.99!

Create a Free Account and then..

Become a Supporter!

As: Output Panel Manipulation

2,152 Views | 7 Replies
New Topic Respond to this Topic

As: Output Panel Manipulation 2005-07-04 08:58:59


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

Response to As: Output Panel Manipulation 2005-07-04 09:27:02


At 7/4/05 08:58 AM, Inglor wrote: 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");

Wow, I never knew you could save output to file. I can't really see myself using that option, but it's interesting to know.


- - Flash - Music - Images - -

BBS Signature

Response to As: Output Panel Manipulation 2006-02-05 14:45:07


At 7/4/05 08:58 AM, Inglor wrote: 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.

You don't mention how you use it though =P You can't just type "fl.outputPanel.clear()" into the Flash IDE because it doesn't work. Can you even call jsapi functions from within a Flash?


Sup, bitches :)

BBS Signature

Response to As: Output Panel Manipulation 2006-02-05 14:50:44


At 2/5/06 02:45 PM, -liam- wrote: Can you even call jsapi functions from within a Flash?

The function's 'MMexecute("command", etc)'. I've no idea what JSAPI is, though.
XP


BBS Signature

Response to As: Output Panel Manipulation 2006-02-05 14:53:38


can this possibly be used in the standalone, or flash's built in player? cuz i think it'd be a cool feature for like creat-your-own, type games to be able to create txt files. like in punk-o-matic. but i doubt this can be used that way

Response to As: Output Panel Manipulation 2006-02-05 14:55:09


At 2/5/06 02:50 PM, -Gust- wrote: The function's 'MMexecute("command", etc)'. I've no idea what JSAPI is, though.

Yeah I know about that, but that only works from Flashes inside the WindowSWF folder.


Sup, bitches :)

BBS Signature

Response to As: Output Panel Manipulation 2006-02-05 14:55:54


At 2/5/06 02:53 PM, FlaccidLad wrote: can this possibly be used in the standalone, or flash's built in player? cuz i think it'd be a cool feature for like creat-your-own, type games to be able to create txt files. like in punk-o-matic. but i doubt this can be used that way

meh, just use flash 8 upload/download. send the file to a php script, have that write it to a txt file, and download the text file. is there an easier way than that?


BBS Signature

Response to As: Output Panel Manipulation 2006-02-05 15:26:35


ya if you dont have php.