outputPanel object

 < Day Day Up > 

Availability

Flash MX 2004.

Description

This object represents the Output panel, which displays troubleshooting information such as syntax errors. To access this object, use fl.outputPanel (or flash.outputPanel). See fl.outputPanel.

Method summary for the outputPanel object

The outputPanel object uses the following methods.

Method

Description

outputPanel.clear()

Clears the contents of the Output panel.

outputPanel.save()

Saves the contents of the Output panel to a local text file.

outputPanel.trace()

Adds a line to the contents of the Output panel, terminated by a new line.


outputPanel.clear()

Availability

Flash MX 2004.

Usage

outputPanel.clear()

Parameters

None.

Returns

Nothing.

Description

Method; clears the contents of the Output panel. You can use this method in a batch processing application to clear a list of errors, or to save them incrementally by using this method with outputPanel.save().

Example

The following example clears the current contents of the Output panel:

fl.outputPanel.clear();

outputPanel.save()

Availability

Flash MX 2004; bUseSystemEncoding parameter added in Flash 8.

Usage

outputPanel.save(fileURI [, bAppendToFile [ , bUseSystemEncoding ] ])

Parameters

fileURI A string, expressed as a file:/// URI, that specifies the local file to contain the contents of the Output panel.

bAppendToFile An optional Boolean value. If TRue, it appends the Output panel's contents to the output file, and if false, the method overwrites the output file if it already exists. The default value is false.

bUseSystemEncoding An optional Boolean value. If TRue, it saves the Output panel text using the system encoding; if false, it saves the Output panel text using UTF-8 encoding, with Byte Order Mark characters at the beginning of the text. The default value is false.

Returns

Nothing.

Description

Method; saves the contents of the Output panel to a local text file. You can also specify that the contents be appended to the contents of a local file, rather than being overwritten. If fileURI is invalid or unspecified, an error is reported.

This method is useful for batch processing. For example, you can create a JSFL file that compiles several components. Any compile errors appear in the Output panel, and you can use this method to save the resulting errors to a text file, which can be automatically parsed by the build system in use.

Example

The following example saves the Output panel's contents to the batch.log file in the /tests folder, overwriting the batch.log file if it already exists:

fl.outputPanel.save("file:///c|/tests/batch.log");

outputPanel.trace()

Availability

Flash MX 2004.

Usage

outputPanel.trace(message)

Parameters

The message parameter is a string that contains the text to add to the Output panel.

Returns

Nothing.

Description

Method; sends a text string to the Output panel, terminated by a new line, and displays the Output panel if it is not already visible. This method is identical to fl.trace(), and works in the same way as the trace() statement in ActionScript.

To send a blank line, use outputPanel.trace("") or outputPanel.trace("\n"). You can use the latter command inline, making \n a part of the message string.

Example

The following example displays several lines of text in the Output panel:

fl.outputPanel.clear(); fl.outputPanel.trace("Hello World!!!"); var myPet = "cat"; fl.outputPanel.trace("\nI have a " + myPet); fl.outputPanel.trace(""); fl.outputPanel.trace("I love my " + myPet); fl.outputPanel.trace("Do you have a " + myPet +"?");

     < Day Day Up > 


    Developing Extensions for Macromedia Flash 8
    Developing Extensions for Macromedia Flash 8
    ISBN: 032139416X
    EAN: 2147483647
    Year: 2005
    Pages: 81

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net