home *** CD-ROM | disk | FTP | other *** search
- function checkFlvfunct()
- {
- if(ns.bytesLoaded != ns.bytesTotal)
- {
- trace("loading");
- amountLoaded = ns.bytesLoaded / ns.bytesTotal;
- newWidth = Math.round(amountLoaded * loader_mc.scrubArea_mc._width);
- loader_mc.loadBar_mc.tween("_width",newWidth,1,"easeInOutSine");
- }
- else
- {
- clearInterval(checkFlvLoad);
- loader_mc.loadBar_mc.tween("_width",loader_mc.scrubArea_mc._width,0.7,"easeOutSine");
- loader_mc.loadBar_mc.alphaTo(0,0.4,"easeOutQuad",1);
- }
- }
- function videoStatus()
- {
- time_var = Math.round(ns.time);
- loader_mc.scrub_mc._x = Math.round(time_var / dur_var * bar_width);
- }
- function scrubIt()
- {
- ns.seek(Math.round(loader_mc.scrub_mc._x / bar_width * dur_var));
- }
- function checkTime(ns)
- {
- var _loc4_ = Math.round(ns.time);
- var _loc6_ = Math.floor(_loc4_ / 60);
- var _loc1_ = Math.floor(_loc4_ % 60);
- if(_loc1_ < 10)
- {
- _loc1_ = "0" + _loc1_;
- }
- var _loc3_ = dur_var;
- var _loc5_ = Math.floor(_loc3_ / 60);
- var _loc2_ = Math.floor(_loc3_ % 60);
- if(_loc2_ < 10)
- {
- _loc2_ = "0" + _loc2_;
- }
- existingTime_txt.text = _loc6_ + ":" + _loc1_;
- totalTime_txt.text = _loc5_ + ":" + _loc2_;
- }
- var nc = new NetConnection();
- nc.connect(null);
- var ns = new NetStream(nc);
- var amountLoaded;
- var dur_var;
- var scrubInterval;
- var fileNm = _root.loadPreview;
- var bar_width = loader_mc.scrubArea_mc._width - loader_mc.scrub_mc._width;
- var is_playing = true;
- loader_mc.loadBar_mc._width = 0;
- theVideo.attachVideo(ns);
- ns.onMetaData = function(infoObject)
- {
- dur_var = infoObject.duration;
- time_var = Math.round(ns.time);
- };
- ns.onStatus = function(infoObject)
- {
- time_var = Math.round(ns.time);
- };
- ns.play(fileNm);
- trace(fileNm);
- checkFlvLoad = setInterval(checkFlvfunct,1000);
- var videoInterval = setInterval(videoStatus,100);
- rewindHit_mc.useHandCursor = false;
- rewindHit_mc.onRollOver = function()
- {
- rewindOver_mc.colorTo(16777215,0.2,"easeInSine");
- };
- rewindHit_mc.onRollOut = function()
- {
- rewindOver_mc.colorTo(0,0.5,"easeOutSine");
- };
- rewindHit_mc.onRelease = function()
- {
- ns.seek(0);
- };
- playHit_mc.useHandCursor = false;
- playHit_mc.onRollOver = function()
- {
- playOver_mc.colorTo(16777215,0.2,"easeInSine");
- };
- playHit_mc.onRollOut = function()
- {
- playOver_mc.colorTo(0,0.5,"easeOutSine");
- };
- playHit_mc.onRelease = function()
- {
- ns.pause();
- if(is_playing)
- {
- playPause_txt.text = "J";
- is_playing = false;
- }
- else
- {
- playPause_txt.text = "G";
- is_playing = true;
- }
- };
- loader_mc.scrub_mc.useHandCursor = false;
- loader_mc.scrub_mc.onPress = function()
- {
- if(is_playing)
- {
- playPause_txt.text = "G";
- ns.pause();
- }
- else
- {
- playPause_txt.text = "J";
- }
- playOver_mc.colorTo(16777215,0.5,"easeOutSine");
- clearInterval(videoInterval);
- scrubInterval = setInterval(scrubIt,10);
- this.startDrag(false,0,this._y,Math.round(loader_mc.loadBar_mc._width - this._width),this._y);
- };
- loader_mc.scrub_mc.onRelease = loader_mc.scrub_mc.onReleaseOutside = function()
- {
- this.stopDrag();
- newPos = Math.round(loader_mc.scrub_mc._x / bar_width * dur_var);
- ns.seek(newPos);
- if(is_playing)
- {
- playPause_txt.text = "G";
- ns.pause();
- }
- else
- {
- playPause_txt.text = "J";
- }
- playOver_mc.colorTo(0,0.5,"easeOutSine");
- clearInterval(scrubInterval);
- videoInterval = setInterval(videoStatus,100);
- };
- var time_interval = setInterval(checkTime,500,ns);
-