Home > Web Front-end > JS Tutorial > js class for viewing flash trace data on a web page_javascript skills

js class for viewing flash trace data on a web page_javascript skills

WBOY
Release: 2016-05-16 18:56:41
Original
1113 people have browsed it

Function:
Call some methods of flash to see the data output by the trace method of flash in the web page;
Method:
1. init(w,h,z);//w is the display interface Width, h is the height of the display interface, z is the level (preferably placed at the top level);
2. trace(str);//Data to be output;
Use :
1. Import jdhcn.js, Click to download jdhcn.js
2. You can rewrite a function in the body (or not):
Program code

3. In 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);//Output debugging information in the flash environment;
if(ExternalInterface.available){
ExternalInterface.call("trace", str);//Output debugging information under the web page;
}
}
}
The following is an example:
Because this is a new window pop-up to see the effect, so I put the jdhcn.js file The content is generally in HTML. Execute trace("Test jdhcn.flashDebug") to simulate that it is called through the flash method.


[Ctrl A select all Note: If you need to introduce external Js, you need to refresh to execute
]
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template