dcsimg
A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: [F8] Trouble making adjustments to script

  1. #1

    [F8] Trouble making adjustments to script

    I've inherited a project and need to make a few simple adjustments. Most are very simple, but one is causing me a few headaches. On the home page of this website, an .flv (captain-brand.flv) is loaded and plays on top of the main flash video. It is controlled with actionscript and has custom play buttons (play, pause, stop) that work fine. I need to change the script so that the video doesn't automatically play when it is loaded. I just want it to stop or pause so the user has to push the play button to view it. I've been able to make it stop by changing (var playStatus:Boolean = true to false, but when I do that, the buttons don't work quite right. Is there something I'm missing? I've pasted the code below. Thanks in advance for any help!!!

    //-- flv player --
    var nc:NetConnection = new NetConnection();
    nc.connect(null);
    var ns:NetStream = new NetStream(nc);
    ns.setBufferTime(3);
    movie_player.embed.attachVideo(ns);
    // attach the movie
    startMovie();
    vidlength = 85.285;
    // set the duration in seconds of the flv
    var playStatus:Boolean = true;
    var closeStatus:Boolean = false;
    // video controller functions
    function startMovie() {
    if (playStatus != true) {
    playStatus = true;
    closeStatus = false;
    ns.play("captain-brand.flv");
    movie_player.fade_clip.alphaTo(0, .5, "easeout", 0);
    movie_player.ctrl_pause.gotoAndStop("pause");
    } else {
    pauseMovie();
    movie_player.ctrl_pause.gotoAndStop("play");
    }
    }
    function stopMovie() {
    closeStatus = true;
    playStatus = false;
    ns.close();
    movie_player.fade_clip.alphaTo(100, .5, "easeout", 0);
    movie_player.ctrl_pause.gotoAndStop("play");
    }
    function pauseMovie() {
    if (playStatus == true) {
    ns.pause();
    this.label = "play";
    movie_player.ctrl_pause.gotoAndStop("play");
    playStatus = false;
    trace('Movie: paused');
    } else {
    ns.pause();
    this.label = "pause";
    movie_player.ctrl_pause.gotoAndStop("pause");
    playStatus = true;
    trace('Movie: playing');
    }
    }
    function rewindMovie() {
    ns.seek(0);
    }
    //
    movie_player.btn_play.onPress = function() {
    if (closeStatus != true) {
    pauseMovie();
    } else {
    startMovie();
    }
    };
    movie_player.btn_rewind.onPress = function() {
    rewindMovie();
    };
    movie_player.btn_stop.onPress = function() {
    stopMovie();
    };

  2. #2

    Please help!!!! I'm stumped!

    I haven't heard anything, but I know there is a fix for this issue. Thanks again for any help!!!

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