What began as a way to embed small, vector-based animations on Web pages has grown into a development environment for entire Web sites and Web applications.Macromedia Flash has evolved into more than just a tool for animations, but an entire development environment designed for use on the Web.
Flash movies, as they are called, are created using Macromedia’s proprietary Flash and Flash MX development environments(although many graphics programs now feature an Export to Flash feature based on Macromedia’s Open SWF initiative). Because of its ubiquity,the Flash plugin now ships with most browsers, meaning that most users never have to download the plugin manually to enjoy the benefits(unless an upgrade is made available, of course).
Embedding Flash movies
To embed a Flash movie into an HTML page, use the <object/> element:
Mozilla-based browsers won’t display this properly,so you need to add a movie parameter set to the same URL as the data attribute:
Of course, if you want to support Netscape 4.x, include the <embed/> element:
Referencing Flash movies
Just like Java applets, Flash movies can be referenced in a couple of different ways depending on how you embed them(using document.getElementById() for <object/> or document.embeds for <embed/>). The following function can be used to retrieve a reference to a Flash movie regardless of the embedding process used:
This function can be called like so:var oFlashMovie = getFlashMovie(“FlashMovie”);
These methods work directly on the movie object itself,so to stop a movie named ExampleMovie, you can do this:
To get the total number of frames in the movie, use TotalFrames(). However, you must be aware of some cross-browser compatibility issues. In Internet Explorer on Windows, there is a bug where TotalFrames is an integer value instead of a function. It is necessary to check for this using typeof to determine if TotalFrames is a number or a function for cross-browser functionality:
Using SetVariable() and GetVariable(), it’s possible to pass information to and get information from a Flash movie. For this to work, the Flash movie must have a variable that is watched for a value change.The simplest way to do this is to create a text field and tie its value to a variable (by selecting Dynamic Text from the Flash Properties panel and entering the name of the variable). Then, you can get the value of the variable using GetVariable() and change its value using SetVariable(). Both methods require the name of the variable in relation to its timeline. So, to access a variable named message in the main timeline, the first argument for both methods is “/:message”, where “/” represents the default timeline, the colon indicates a part of the timeline to access, and message is the variable name.
Some methods also work on a specific timeline in the movie:
When using the timeline-specific methods, the first argument is always the name of the timeline to act on. The default timeline is represented by a single forward slash:
revar iXPos = oFlashMovie.TGetProperty(“/”, 0);
The first argument is always mirrored by the TARGET property:
Inside of the Flash movie, create a button and assign the following ActionScript to it:
When using any browser other than Internet Explorer, this function is called when fscommand() is executed. For Internet Explorer, another function is needed.
All non-IE browsers ignore this code block because “VBScript” is unrecognized as a scripting language; therefore,it’s safe to include this in your cross-browser pages (although it is still recommended that this reside in the <head/> element to prevent rendering of the code as plain text). Another alternative is to place the VBScript into an external file (ending in .vbs) and load it into the page like this:<script language=”VBScript” src=”example.vbs”></script>
Java Script Related Tutorials
|Adv Java Tutorial||Core Java Tutorial|
|Java-Springs Tutorial||Java Servlets Tutorial|
|EJB(Enterprise JavaBeans) Tutorial||JavaServer Faces (JSF) Tutorial|
|Java Swing Tutorial||Java Tutorial|
|JavaMail API Tutorial||Java 8 Tutorial|
|Java XML Tutorial||Java Bean Utils Tutorial|
|The Java Debugger (JDB) Tutorial||Java.math Package Tutorial|
Java Script Related Interview Questions
|Java Script Interview Questions||Adv Java Interview Questions|
|Core Java Interview Questions||Java-Springs Interview Questions|
|Java Servlets Interview Questions||EJB(Enterprise JavaBeans) Interview Questions|
|JavaServer Faces (JSF) Interview Questions||Java Swing Interview Questions|
|Java 8 Interview Questions||Java XML Interview Questions|
|JavaFX Interview Questions||The Java Debugger (JDB) Interview Questions|
Java Script Related Practice Tests
|Java Script Practice Tests||Adv Java Practice Tests|
|Core Java Practice Tests||Java-Springs Practice Tests|
|Java Servlets Practice Tests||EJB(Enterprise JavaBeans) Practice Tests|
|JavaServer Faces (JSF) Practice Tests||Java 8 Practice Tests|
All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.