views:

123

answers:

1

So i had a video that was in quicktime format, threw it into flash, encoded it without a problem and here is the result i got: http://www.healthcarepros.net/travel.html

I would like the video to "loop" or "autorewind" as soon as it ends but i am having the hardest time trying to figure how to do this. Here is my code, any help would be greatly appreciated...

if (AC_FL_RunContent == 0) {
    alert("This page requires AC_RunActiveContent.js.");
} else {
    AC_FL_RunContent(
        'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
        'width', '330',
        'height', '245',
        'src', 'healthcare-video',
        'quality', 'high',
        'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
        'align', 'middle',
        'play', 'true',
        'loop', 'true',
        'scale', 'showall',
        'wmode', 'window',
        'devicefont', 'false',
        'id', 'healthcare-video',
        'bgcolor', '#ffffff',
        'name', 'healthcare-video',
        'menu', 'true',
        'allowFullScreen', 'false',
        'allowScriptAccess','sameDomain',
        'movie', 'healthcare-video',
        'salign', ''
        ); //end AC code
}

    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="330" height="245" id="healthcare-video" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="loop" value="true" />
<param name="play" value="true" />
<param name="movie" value="healthcare-video.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />    <embed src="healthcare-video.swf" play="true" flashvars="autoplay=true&play=true&autorewind=true" quality="high" bgcolor="#ffffff" width="330" height="245" name="healthcare-video" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>

A: 

You will have to do this within the player that you set up. You cannot change this in the HTML/Javascript that displays the SWF.

In the FLA you create to make the SWF, you will need to add some Actionscript. It will need to listen for the video's COMPLETE event and then replay it once that event fires. The code is different depending on if you are using AS2 or AS3.

Are you using the built-in FLV Component?

If you are using AS2 and just using a Video object, use this code:

ns.onStatus = function(info) {
   if (info.code == "NetStream.Play.Stop") {
   ns.seek(0);
   }
}; 

As noted here: http://www.communitymx.com/content/article.cfm?cid=984BA

If you are using the FLV component, in AS3, you would use the following code to control looping:

import fl.video.*;

// Video component instance name
var flvControl:FLVPlayback = display;
var flvSource:String = "Call_to_Action.flv";

// Loop the video when it completes
function completeHandler(event:VideoEvent):void
{
   flvControl.seek(0);
   flvControl.play()
}
flvControl.addEventListener(VideoEvent.COMPLETE, completeHandler);

// Set video
flvControl.source = flvSource;

As noted here: http://www.adobe.com/devnet/flash/articles/flvplayback_programming_04.html

The concept is to listen for a particular event from the FLV, and then restart the video from the beginning.

The code you will need to use really depends on how you put the video into the FLA file. Hope this helps!

liquidleaf
Thank you, i used the actionscript 3 code and it works perfectly
james