Play once and stop loaded movie

I am loading into a container MC multiple .swf’s (QT videos compressed to SWF with Sorenson). I am able to the loadmovie and control its playback. However the SWF once “played” will loop until I press a “stop” button.

How can I get it to play once and stop.

I have looked all over and can’t find a workable solution.

Thank you in advance for your patience and help.

Scott::pirate:

Put a stop(); action on the last frame of the movie you are loading.

LostinBeta: Thanks for getting back to me.

I am familiar with the "add a stop () but…How do you do that to a swf file? The loaded swf’s were created from Quicktime movies compressed by Sorenson. How can you add a stop() to this file? I dont’ think you can except with Flix.

Is there another way? The call is to the external swf’s to load into a empty containerMC. I built a video controller play/stop/rewind forward etc that sits at _root. It controls the loaded movie.

How can I get the SWf to play once and stop.

Does _root.containerClip.stop() work?

I have never worked with Quicktime in Flash so I have no clue.

I thought if you imported quicktime movies into Flash then Flash automatically coverts it to frames.

Hmm, well, since I have never done it, I really have no clue. Hopefully someone else on this forum has done it before.

I hope so too. Thank you for taking the time.

S

Once your video is loaded, could you try this piece of code (with the right name of course)?

trace (containerMC._totalframes);

pom :slight_smile:

Ok then after I get totalFrames…

if totalFrames=100
gotoAndStop (1)

Is this the idea?

Should it come right after loadMovie?

Thanks pom for helping :slight_smile:

Well, yeah, the idea would be to have a controller clip that will check if the movie is playing its last frame. If it is the case, then you stop it. The code would be something like this:

if (containerMC._currentFrame==containerMC._totalframes) containerMC.stop();

But I have no idea if this can work :-\

Looks like it could to me.

In theory that is.

Still can’t get it to work here is the code on the button to loadmovie.

Should the “trace” and 'if" go somewhere else?

Confused but appreciative for all your help!

code:--------------------------------------------------------------------------------
on (press) {
_root.HOME_TVFAMILY_MOV.redMC2.loadmovie(“kswf.swf”, _root.redMC2);
trace (_root.redMC2._totalframes);
}

on (release) {
if (_root.HOME_TVFAMILY_MOV.redMC2._currentFrame == _root.HOME_TVFAMILY_MOV.redMC2._totalframes)
_root.HOME_TVFAMILY_MOV.redMC2.stop(“kswf.swf”, _root.redMC2);
}


Well I am thinking if you want the movie to just play once through, the code would go on a frame, not on a button.

And the trace isn’t required, that is just a preview in Flash thing, it pops up the output window with whatever you are asking it to display. It comes in handy A LOT later on (if you get into AS that is).

What frame?
The video source in a short film trasferred to QT compressed and converted to SWF. There is no original FLA.

It seem strange I can control all other aspects of the SWF:
Start stop nextFrame, prevFrame, play…but not be able to tell it to play once or to play and gotostop (1)

Well aren’t you using Flash MX to load the movie into?

How else are you creating buttons with actions in your movie.

If you are using Flash to add the buttons and such, then you should be using a .fla file.

I am confused now. :q:

*Originally posted by ilyaslamasse *
**Well, yeah, the idea would be to have a controller clip that will check if the movie is playing its last frame. If it is the case, then you stop it. The code would be something like this:

if (containerMC._currentFrame==containerMC._totalframes) containerMC.stop();

But I have no idea if this can work :-\ **

After seeing that, makes total sense to me. But unlikely I would go there by my own.

Thanks for reminding me how simple I am:-\

I am using Flash MX. I am loading an external file. myMC.swf in to a containerMC. the button calls myMC.swf to load into the container.

Once the file is loaded I have video controls (buttons) which control the containerMC.

I do not want to embed the quicktime into the FLA ( it would be an answer but the video inlfates to an ungodly size.

Yes, but when you load a .swf file into Flash, it too converts that to frames.

So Ilyas’ method in theory should work.

But you have to put it on a frame on the timeline. You will have to right click on the frame you want your movie to load one, open up the actions panel, then apply Ilyas’ code to that frame.

this software (Sorenson?) that you are using to compress the QT movie doesn´t have an option to disable the looping? Like the animated gif softwares?

=)

Unfortunely it does not. However other programs do… like Flix . Considering getting it. Just thought it could be elegantly solved with an actionScript solution.

Baffled

Should the solution fall on the video control button? PLAY?
:q:

Well no, because then you have to press the button, and if when you press the button it isn’t on the last frame, then it won’t work.

So you will have to A)Put it on the frame or B)But it on an empty movie clip through the onClipEvent(enterFrame) handler.

How would you use the onClipEvent(enterFrame) handler?