Hey guys below you will find my code, I was the one asking about windows
process and how to minimize it or kill it.
I am wondering is its my code thats mkaing the process climb espspecially the
seek fucntion.
Any help would be great guys.
Tony Trapp - DBTWeb.com
#include "NetDebug.as"
#include "NetServices.as"
//function updateProgress()
//{
//var _loc1 = video_ns.bytesLoaded;
// var _loc2 = video_ns.bytesTotal;
//movieScrubber.loadProgress._width = Math.round(_loc1 / _loc2 *
movieScrubber.clipTimeline._width);
//if (_loc1 > 4 && _loc2 > 4 && _loc1 >= _loc2)
//{
// trace ("FLV loaded");
//clearInterval(intID);
//intID = null;
//} // end if
//} // End of the function
function loadPreferences()
{
var _loc3 = new XML();
_loc3.ignoreWhite = true;
_loc3.onLoad = function (success)
{
if (success)
{
trace ("XML loaded.");
for (var _loc2 = this.firstChild.firstChild; _loc2 != null; _loc2 =
_loc2.nextSibling)
{
trace (_loc2.nodeName + ": " + _loc2.firstChild.nodeValue);
owner[_loc2.nodeName] = _loc2.firstChild.nodeValue;
} // end of for
setupVideo();
}
else
{
trace ("Error loading XML preferences.");
} // end else if
};
_loc3.load(configURL == null ? ("config.xml") : (configURL));
} // End of the function
function setupVideo()
{
oSound = new Sound(this);
soundLevel = volume;
setVolume(soundLevel);
video_nc = new NetConnection();
video_nc.connect("rtmp:/MSW/MWSVIDS/"+clipdir+"");
video_ns = new NetStream(video_nc);
//video_ns.setBufferTime(buffer);
myVideo.attachVideo(video_ns);
video_ns.play(clipdir); // was flvURL /// clipdir
//intID = setInterval(updateProgress, 100);
// totalTime = 1000;
video_ns.onStatus = video_onStatus;
video_ns.onMetaData = video_onMetaData;
} // End of the function
function setVolume(v)
{
volumeSlider.volumeDot._x = Math.round(volumeRange * v / 100);
oSound.setVolume(v);
var _loc1 = Math.round(volumeSlider.volumeDot._x / volumeRange * 100 / 33)
+ 1;
volumeSlider.speakerIcon.speaker_mc.gotoAndStop(_loc1);
} // End of the function
function videoCompleted()
{
video_ns.seek(0);
video_ns.pause(loop ? (false) : (true));
playing = loop; // loop
} // End of the function
function togglePlay()
{
playpauseClip.pause_btn._visible = playing;
playpauseClip.play_btn._visible = !playing;
} // End of the function
var scrubbing;
var t;
var totalTime;
var playing = false;
var scrubberLength = movieScrubber.clipTimeline._width;
var scrubRange = scrubberLength - movieScrubber.scrubDot._width;
var volumeRange = volumeSlider.volumeWedge._width -
volumeSlider.volumeDot._width;
var video_nc;
var video_ns;
var oSound;
var soundLevel;
var intID;
var owner = this;
var configURL;
var autoPlay;
var buffer;
var flvURL;
var loop;
var volume;
video_onStatus = function (info)
{
for (var _loc2 in info)
{
trace ("onStatus: " + _loc2 + " = " + info[_loc2]);
} // end of for...in
if (info.code == "NetStream.Play.Stop")
{
video_ns.close();
video_ns.clear();
// videoCompleted();
} // end if
};
video_onMetaData = function (info)
{
for (var _loc2 in info)
{
trace ("onMetaData: " + _loc2 + " = " + info[_loc2]);
} // end of for...in
totalTime = info.duration;
video_ns.pause(autoPlay ? (false) : (true));
playing = true; ///
video_ns.play(clipdir);
};
playpauseClip.pause_btn.onRelease = function ()
{
video_ns.pause();
playing = false;
};
playpauseClip.play_btn.onRelease = function ()
{
video_ns.pause();
playing = true;
};
stop_btn.onRelease = function ()
{
playing = false;
scrubbing = false;
//video_ns.pause(false);
video_ns.close();
//video_ns.clear();
//video_ns.pause();
//playing = true;
};
movieScrubber.scrubDot.onPress = function ()
{
this.startDrag(false, 0, 0, scrubRange, 0);
scrubbing = true;
playing = false;
oSound.setVolume(0);
};
movieScrubber.scrubDot.onRelease = function ()
{
this.stopDrag();
scrubbing = false;
playing = true;
video_ns.pause(false);
setVolume(soundLevel);
};
movieScrubber.onEnterFrame = function ()
{
togglePlay();
if (scrubbing)
{
t = this.scrubDot._x / scrubberLength * totalTime;
video_ns.pause(true);
video_ns.seek(t);
}
else
{
var _loc2 = video_ns.time / totalTime;
this.scrubDot._x = scrubRange * _loc2;
} // end else if
};
volumeSlider.volumeDot.onPress = function ()
{
this.startDrag(false, 0, -4, volumeRange, -4);
volumeSlider.onEnterFrame = function ()
{
var _loc2 = Math.round(this.volumeDot._x / volumeRange * 100);
soundLevel = _loc2;
setVolume(_loc2);
};
};
volumeSlider.volumeDot.onRelease = function ()
{
this.stopDrag();
delete volumeSlider.onEnterFrame;
};
volumeSlider.speakerIcon.onRelease = function ()
{
var _loc1 = oSound.getVolume() == 0;
setVolume(_loc1 ? (soundLevel) : (0));
};
loadPreferences();
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com