How do i stop the video from automatically playing when i enter the frame?

Dani AI

Generated

Good short fix from and nice confirmation from . For anyone revisiting this thread years later: Flash Player has reached end of life and modern browsers no longer support it — consider moving to HTML5 video when possible (Adobe Flash Player EOL, MDN video element).

Common, reliable ways to prevent a Flash video from starting automatically (without relying on the IDE inspector):

  • Programmatic playback control (ActionScript 3, NetStream pattern). Do not invoke ns.play() until a user action or explicit trigger. Example pattern:

    var nc:NetConnection = new NetConnection();
    nc.connect(null);
    var ns:NetStream = new NetStream(nc);
    var vid:Video = new Video(640,360);
    vid.attachNetStream(ns);
    addChild(vid);
    // call ns.play("file.flv") only from a user event handler
  • Delay instantiation via MovieClip timeline. Put the video/player inside a nested MovieClip on a later frame and keep that clip on an earlier frame. Move the clip to the frame with the player only when playback is wanted:

    myPlayerHolder.gotoAndStop(1); // video sits on frame 2 of holder
    // later: myPlayerHolder.gotoAndStop(2);
  • Library/export and embedding checks. Ensure the video/player symbols are not forced into the first frame via "Export for ActionScript"/export settings, and verify HTML embed/FlashVars or surrounding scripts are not instructing playback.

If migration is an option, use a simple HTML5 player with controls and no autoplay:

  <video controls width="640" height="360" poster="thumb.jpg">
    <source src="video.mp4" type="video/mp4">
  </video>

Troubleshooting notes: if the SWF still starts the clip, inspect other frames or external SWFs for playback calls, and confirm library export settings.

Recommended Answers

All 2 Replies

If you're using the built-in media-player component that ships with flash-pro IDE's, there is a property which you can set to false to stop the video from auto-playing.

I can't remember exactly what it is called, but from the flash IDE, if you select your instance of the media player component on the stage and then open the component inspector window (or was it the properties window?? Been a while since I used the flash IDE now!) Either way, somewhere in the properties or the component inspector, you should see the auto-play property. I think it's set to true by default.
Set this to false and that should be all you need to do to stop the video from auto-playing.

Cheers for now,
Jas.

you shouldn't be allowed on here, its not right cos your too good!

thank you m8, that really helped. Its close to my project hence the erractic spreading of threads and different ways to solve a problem.

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.