Forum Topic: As: Output Panel Manipulation

(579 views • 7 replies)

This topic is 1 page long.

<< < > >>
None

Inglor

Reply To Post Reply & Quote

Posted at: 7/4/05 08:58 AM

Inglor NEUTRAL LEVEL 17

Sign-Up: 01/26/03

Posts: 10,948

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


None

Denvish

Reply To Post Reply & Quote

Posted at: 7/4/05 09:27 AM

Denvish DARK LEVEL 46

Sign-Up: 04/25/03

Posts: 16,229

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

None

liaaaam

Reply To Post Reply & Quote

Posted at: 2/5/06 02:45 PM

liaaaam NEUTRAL LEVEL 22

Sign-Up: 12/11/04

Posts: 14,543

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?


None

GustTheASGuy

Reply To Post Reply & Quote

Posted at: 2/5/06 02:50 PM

GustTheASGuy LIGHT LEVEL 08

Sign-Up: 11/02/05

Posts: 11,427

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

#ngprogramming at irc.freenode.net
haXe | Keel imperative | Spyro! | Thru you


None

ImpotentBoy2

Reply To Post Reply & Quote

Posted at: 2/5/06 02:53 PM

ImpotentBoy2 LIGHT LEVEL 18

Sign-Up: 04/01/03

Posts: 5,318

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

Some times my "L" key decides not to work.


None

liaaaam

Reply To Post Reply & Quote

Posted at: 2/5/06 02:55 PM

liaaaam NEUTRAL LEVEL 22

Sign-Up: 12/11/04

Posts: 14,543

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.


None

authorblues

Reply To Post Reply & Quote

Posted at: 2/5/06 02:55 PM

authorblues FAB LEVEL 12

Sign-Up: 06/21/05

Posts: 6,360

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?

GENERATION 1-i: The first time you see this, copy it into your sig on any forum. Square it, and then add i to the generation.

BBS Signature

None

ImpotentBoy2

Reply To Post Reply & Quote

Posted at: 2/5/06 03:26 PM

ImpotentBoy2 LIGHT LEVEL 18

Sign-Up: 04/01/03

Posts: 5,318

ya if you dont have php.

Some times my "L" key decides not to work.


All times are Eastern Standard Time (GMT -5) | Current Time: 04:50 AM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!