Proposed:Adobe Flash

From JumbaWiki

(Redirected from Flash)
Jump to: navigation, search


Adobe Flash (formally Macromedia Flash) is a web graphics, application and animation tool. A developer version has been recently released called Flex. Flash creates SWF (Shockwave Flash) files that require the Flash Player to run.


Controlling Flash with Javascript

You can have some control over a Flash object on your site by calling its methods from Javascript. This can be useful in situations where you can't make changes to the Flash object itself. This example shows how you can start and stop a Flash movie with Javascript.

This is the HTML for the Flash object (amend to suit your needs):

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
            codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0"
            id="myFlashMovie" width=481 height=86>
    <param name=movie value="sample.swf">
    <param name=quality value=high>
    <param name=play value=false>
    <param name=bgcolor value=#FFFFFF>
    <embed play=false swliveconnect="true" name="myFlashMovie" src="sample.swf" quality=high bgcolor=#FFFFFF
            width=481 height=86 type="application/x-shockwave-flash"
            pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
    </embed>
</object>

Place the following code in the <head> area of your page:

<script type="text/javascript"><!--
    // F. Permadi May 2000
    function getFlashMovieObject(movieName)
        {
        if (window.document[movieName])
            {
            return window.document[movieName];
            }
        if (navigator.appName.indexOf("Microsoft Internet")==-1)
            {
            if (document.embeds && document.embeds[movieName])
                return document.embeds[movieName];
            }
        else
            {
            return document.getElementById(movieName);
            }
        }

    function StopFlashMovie()
        {
        var flashMovie=getFlashMovieObject("myFlashMovie");
        flashMovie.StopPlay();
        }

    function PlayFlashMovie()
        {
        var flashMovie=getFlashMovieObject("myFlashMovie");
        flashMovie.Play();
        }
//-->
</script>

Now, in an appropriate place in the <body> area, you can create links such as these:

<a href="javascript:PlayFlashMovie()">Play</a>
<a href="javascript:StopFlashMovie()">Stop</a>

When the user clicks the Play link, the Flash movie will start playing, and when they click Stop it will stop playing!

See also

External links


Web-based Adobe Software
Acrobat Family | ColdFusion | Contribute | Dreamweaver | Flash | FlashPaper | GoLive | Players | Photoshop and ImageReady
Personal tools
Australian Photography | Unique Views of Reality | Daedalus