stop (); When I put actionscript after the code stop(); I often get a wacky response from my flash

Can someone explain to me what actionscript does when I start the actionscript in a fram with the function "stop();"

Will it stop at that frame and then continue through the actionscript following?

Or is there some other way to do this?

As I posted in my earlier post, I want to go to a frame, play an FLV video and when that video is finished I'd like it to go to the next frame.

I'm having trouble with this simple operation.

onComplete

Well, without seeing the code is pretty difficult.

Anyway, stop has no effect on the code, it works only for the timeline playhead movement.

Let's say you have a flv playing in a FLVPlayback component with "Videoplayer" as instance name.

I am assuming this is in AS2. You simply can do something like this.
You put a simple stop in the frame where the player is.
On the timeline, you put this as code:

  1. var listenerObject:Object = new Object();
  2. listenerObject.complete = function(eventObject:Object):Void {
  3. trace("FINISHED");
  4. nextFrame();
  5. };
  6. Videoplayer.addEventListener("complete", listenerObject);

if you are working in AS3, then the code is something like:

  1. Videoplayer.addEventListener(VideoEvent.COMPLETE, onComplete);
  2. private function onComplete(evt:Event):void
  3. {
  4. nextFrame();
  5. }

There are some strange cases in which the onComplete event is not fired as it should be. If this is the case, simply use the FLVPlayback properties that indicates total playing time and current playhead time to check if it has finished.

I hope this is helpful!

stop() stops timelines, not code

stop() is a method of the MovieClip that will stop a timeline on a given frame.
It has *NO* impact on the execution of ActionScript.
It is not equivalent to, break for loops, for example.

--
R Blank
CTO | Almer/Blank | www.almerblank.com
Director | Rich Media Institute | www.richmediainstitute.com
Founding Manager | LA Flash | www.laflash.org
Faculty | Information Technology Program | USC Viterbi School of Engineering

(No subject)

I had the same problem in a lot of projects. I also started coding putting a stop(); on the first line. In little projects there was no problem, instead in bigger projects sometimes actionscript wasn't executed as it must do.
For example I used this in a project:

  1. stop();
  2. function construct():Void {
  3. mc1._visible = false;
  4. mc1._alpha = 0;
  5. mc2._visible = false;
  6. mc2._alpha = 0;
  7. }
  8. // some other code
  9. construct();

and the code above doesn't work like the code below:

  1. mc1._visible = false;
  2. mc1._alpha = 0;
  3. mc2._visible = false;
  4. mc2._alpha = 0;
  5. // some other code
  6. stop();

Putting the stop() at the end and removing the initialization code from the function resolved the problem. The reason? I don't know, I cannot understand it.

p.s. all the problems I've talked about are AS2 related, I don't know if in AS3 it's the same. I'm migrating to it now.

good coding

good coding .................thanks to make available there.