Welcome to the Graphic and Web Design Forum


your forum for all things Design


  •  » Graphic Design
  •  » Web Design
  •  » Logos and Branding
  •  » Illustration
  •  » Photography
  •  » Design Tutorials
  •  » Plenty of Off Topic Chat

Register now to remove this ad box


YES! I want to register an account for free right now!


-->
  1. #1

    Need help pausing video once it plays

    ADS NOT VISIBLE TO MEMBERS
    I set up a flash video player using some code from tutorials. But right now, it just keeps going through and looping, playing until the end of time. How can I just have it stay paused once it completes?

    Here is the code:
    Code:
    var nc:NetConnection = new NetConnection(); nc.connect(null); var ns:NetStream = new NetStream(nc); ns.setBufferTime(5); ns.onStatus = function(info) { if(info.code == "NetStream.Buffer.Full") { bufferClip._visible = false; } if(info.code == "NetStream.Buffer.Empty") { bufferClip._visible = true; } if(info.code == "NetStream.Play.Stop") { ns.seek(0); } } UnityRingsWEB.attachVideo(ns); ns.play("flv/UnityRingsWEB.flv"); rewindButton.onRelease = function() { ns.seek(0); } playButton.onRelease = function() { ns.pause(); } var videoInterval = setInterval(videoStatus,100); var amountLoaded:Number; var duration:Number; ns["onMetaData"] = function(obj) { duration = obj.duration; } function videoStatus() { amountLoaded = ns.bytesLoaded / ns.bytesTotal; loader.loadbar._width = amountLoaded * 461; loader.scrub._x = ns.time / duration * 431; } var scrubInterval; loader.scrub.onPress = function() { clearInterval(videoInterval); scrubInterval = setInterval(scrubit,10); this.startDrag(false,0,this._y,431,this._y); } loader.scrub.onRelease = loader.scrub.onReleaseOutside = function() { clearInterval(scrubInterval); videoInterval = setInterval(videoStatus,100); this.stopDrag(); } function scrubit() { ns.seek(Math.floor((loader.scrub._x/431)*duration)); }

  2. #2
    ADS NOT VISIBLE TO MEMBERS
    If you want it not to loop...just make a new frame at the end of your video (F6 or F7)

    and place the easiest code ever on that frame:
    stop();

Similar Threads

  1. Not sure if this is the right place - VIDEO ?
    By webnoob in forum General Web Design Forum
    Replies: 4
    Last Post: 01-02-2009, 01:30 PM
  2. Bruce Lee plays ping pong with nunchuck
    By pablo795 in forum Off Topic
    Replies: 2
    Last Post: 24-11-2008, 02:30 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Log in

Log in