A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: play/paused button not working

  1. #1
    Junior Member
    Join Date
    Sep 2007
    Posts
    14

    play/paused button not working

    Hi, I have the following code to stream an flv with a button that will pause and play the flv but it's not working.

    settings: flash 9 / actionscript 2.0

    code:

    var connection_nc:NetConnection = new NetConnection();
    connection_nc.connect(null);
    var stream_ns:NetStream = new NetStream(connection_nc);
    vidTV.attachVideo(stream_ns);
    stream_ns.play("video.flv");
    //

    myPlayPauseButton.onRelease = function (){
    if(myPlayer.paused){
    myPlayer.play();
    }else{
    myPlayer.pause();
    }
    }


    what seems to be wrong?

    Please help....thanks.

    Johan,

  2. #2
    Junior Member
    Join Date
    Sep 2007
    Posts
    14
    I also tried:

    myPlayPauseButton.onRelease = function (){
    if(vidTV.paused){
    vidTV.play();
    }else{
    vidTV.pause();
    }
    }

    but doesn't work neither.

  3. #3
    Junior Member
    Join Date
    Sep 2007
    Posts
    14
    sorry got it figured it out

    myPlayPauseButton.onRelease = function (){
    if(ns.paused){
    ns.play();
    }else{
    ns.pause();
    }
    }

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center