I'm trying to get an imported movie to loop in flash. I don't know if you can do this in html. Is it possible? I know the actual flash movie loops, but the .avi isn't. help please! Thanks in advance.

b

Dani AI

Generated

— the most reliable fix is to control the video from inside the SWF instead of relying on the HTML wrapper. was on the right track to look at how the container is being looped, but the best approach is to treat the clip as a video stream and restart it from ActionScript (or use the FLVPlayback component), because timeline-embedded video and the HTML loop attribute behave differently.

Example (ActionScript 3 using NetConnection/NetStream + Video):

var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
var video:Video = new Video(640,360);
addChild(video);
video.attachNetStream(ns);
ns.client = {};
ns.play("yourVideo.flv");
ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);

function netStatusHandler(e:NetStatusEvent):void {
if (e.info.code == "NetStream.Play.Stop") {
ns.seek(0);
}
}

If you prefer the FLVPlayback component, listen for its completion event and call play(0) to restart. Also check these practical points: keep large video external (don’t embed huge video frames in the timeline), encode to a Flash-friendly format (FLV/F4V or H.264 MP4), and confirm the video is loaded from a location your SWF can access. If you need help adapting this to the way you imported the file, post the Flash version and whether the video is timeline-embedded or loaded externally and I will tailor the snippet.

Recommended Answers

All 2 Replies

if your using an embed tag, you can do loop=true. But are you trying to embed an AVI file? thats definately not a good idea

it's not an avi. loop true doesn't work with it. i think its because it's an avi inside a flash movie.
no idea

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.