JS class for viewing trace data in flash on the webpage

Source: Internet
Author: User

Function:
Flash calls some methods to view the data output by the flash TRACE method on the webpage;
Method:
1. init (W, H, Z); // W indicates the width of the display interface, h indicates the height of the display interface, and Z indicates the level (preferably at the top layer ); <this method can be omitted>
2. Trace (STR); // data to be output;
Usage:
1. Import jdhcn. js and click to download jdhcn. js.
2. You can rewrite a function in the body (or do not write it ):
Program Code
<Script language = "JavaScript">
Function trace (STR ){
G. flashdebug. Trace (STR );
}
</SCRIPT>
3. Write a Global static method in flash and replace the TRACE method with global. tracestr during debugging:
Program code
Public class global {
Import flash. External. externalinterface;
Public static function tracestr (STR: string): void {
Trace (STR); // outputs debugging information in the Flash environment;
If (externalinterface. Available ){
Externalinterface. Call ("trace", STR); // output debugging information on the webpage;
}
}
}
The following is an example:
Because this is the result displayed in the new window, you can use jdhcn. the content in the JS file is like HTML. run trace ("test jdhcn. flash debug ") to simulate the flash method call. <textarea id="runcode99757"></textarea>
[Ctrl + A select all Note: If you need to introduce external JS, You need to refresh it to execute]

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.