Home >
Web Front-end >
JS Tutorial >
Basic tutorial on interactive communication between Javascript and flash_javascript skills
Basic tutorial on interactive communication between Javascript and flash_javascript skills
WBOY
Release: 2016-05-16 19:02:05
Original
1127 people have browsed it
Below are some examples of direct communication between Flash and HTML files using Javascript. Each example has simple steps
This article discusses 3 basic methods of Flash/Javascript communication: Javascript to Flash Communication----Use Flash player's javascript method Flash to Javascript communication----Use Flash's fscommand Flash to Flash communication----------Use local connection object Or combine the above 2 technologies
Not all browsers attach great importance to scripts. In order to communicate with the Flash player, the browser must have a built-in hook so that the Flash player can 'listen'. The browser must be The following: Netscape Navigator 3.0-4.7x, and Netscape 6.2 or higher (Windows 95/98/NT/2000/XP or MacOS; allows Java and LiveConnect) Internet Explorer 3.0 or Higher (Windows 95/98/NT/2000/XP only; ActiveX allowed)
Javascript to Flash communication
This example demonstrates how to use Flash methods Send variables from the HTML input text to the Flash file in the page. The HTML input data is sent to the Flash file through the SetVariable method of Flash.
View example: Example Download source file: javascript_to_flash .zip(17k)
Steps:
Flash 1. Create a new file and save it as javascript_to_flash.fla 2. Use the text tool to create a text field on the stage 3. Select this text field, in the properties panel, select Dynamic Text from the drop-down list, and fill in "myVar" in the variable column Note: The best habit is to use Instance , use myVar.text to change the value of myVar. For simplicity and compatibility with Flash4 and Flash5, we use the form of variable names. 4. Save the file 5. Publish HTML files and SWF files
In Dreamweaver The next step of work is transferred to Dreamweaver, of course it can also be other HTML editors 1. Open the HTML file published in the previous step 2. Insert the generated SWF file and OBJECT /EMBED tag (1) Insert>Media>Flash, and select this Flash (2) Switch to the code view, we need to modify the selected
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