dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: Rewind and replay .swf files

  1. #1
    Join Date
    Nov 2003
    Posts
    1

    Question Rewind and replay .swf files

    I've got a page I'm trying to develop that will pop up a window with a .swf file. The .swf file morphs one image to another. I created the .swf file with a freeware program (WinMorph). I want to give the user the option of clicking a button to rewind and replay the .swf file. I know that you can right click the image and do it that way but not everyone who might access the page would necessarily know that. I'd like some advice on how to create some javascript code to add the rewiind/replay buttons. Here's a copy of what I have so far (not sure if this will display well):

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
    <html>
    <head>
    <title>Kitchen-Dining Room Makeover</title>
    <script language="javascript">
    function Start(page,height,width){
    OpenWin = this.open("","Images","toolbar=no,directories=no,status=no,scollbars=no,resizable=no,width=400,heigh t=500,top=50,left=50");
    OpenWin.document.open();
    OpenWin.document.write('<title>Image Window</title><body bgcolor="#FFFFFF"><center><object><PARAM NAME="autostart" VALUE="true"><embed src="'+page+'" height="'+height+'" width="'+width+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" quality="best" play="true" loop="false"></object><P><form><input type="button" value="Close Window" onClick="window.close()"></form></center></body>')
    OpenWin.document.close();
    }
    </script>
    </head>
    <body>
    <h1>Kitchen-Dining Room Makeover</h1>
    <a href="javascript:Start('KD-1.swf','360','240')" ;>View 1</A>
    <BR>
    <a href="javascript:Start('KD-2.swf','240','360')" ;>View 2</A>
    <BR>
    <a href="javascript:Start('KD-3.swf','360','240')" ;>View 3</A>
    <BR>
    <a href="javascript:Start('KD-4.swf','240','360')" ;>View 4</A>
    <BR>
    <a href="javascript:Start('KD-5.swf','240','360')" ;>View 5</A>
    <BR>
    <a href="javascript:Start('KD-6.swf','240','360')" ;>View 6</A>
    <BR>
    <a href="javascript:Start('KD-7.swf','360','240')" ;>View 7</A>
    <BR>
    <a href="javascript:Start('KD-8.swf','360','240')" ;>View 8</A>
    <BR>
    <a href="javascript:Start('KD-9.swf','360','240')" ;>View 9</A>
    <BR>
    <script language="JavaScript" type="text/javascript">
    <!--
    document.write("Last Modified " + document.lastModified)
    // -->
    </script>
    </body>
    </html>

  2. #2
    Join Date
    May 2003
    Location
    Mordor
    Posts
    454
    Not entirely sure, but try this...

    you will need to give your flash player a name (in the <embed> tag, add name="myflash".

    then you can control the player like this...

    OpenWin.document.myflash.Rewind();
    OpenWin.document.myflash.Play();
    OpwnWin.document.myflash.StopPlay();

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles