Frame 1
function playVideo(videoFile) {
userPlayerPrefs = SharedObject.getLocal("UserPrefsObj");
if (userPlayerPrefs.data.playerVolume eq "undefined") {
prefferedVolume = 30;
log("Nu avem volum");
} else {
log("Avem volum si anum: " + userPlayerPrefs.data.playerVolume);
prefferedVolume = userPlayerPrefs.data.playerVolume;
}
_root.prefferedVolume = prefferedVolume;
VolMC = _root.Controls.Volume.DateVolum;
totalHeight = Math.round(VolMC.VolumeBar.BG._height);
volumePercent = Math.round((prefferedVolume / totalHeight) * 100);
amountHeight = totalHeight - prefferedVolume;
VolMC.VolumeBar.amount._height = volumePercent / 2;
_root.video._alpha = 100;
_root.relatedMC._visible = false;
if (_root.rotateMovie) {
clearInterval(_root.rotateMovie);
}
video.attachVideo(netStream);
video.smoothing = true;
netStream.setBufferTime(5);
netStream.bufferLength;
netStream.play(videoFile);
this.createEmptyMovieClip("snd", 0);
this.snd.attachAudio(this.netStream);
this.audio = new Sound(this.snd);
this.audio.setVolume(prefferedVolume);
_root.Controls.Volume.DateVolum.currentVolume.text = prefferedVolume;
atEnterFrame();
}
function togglePayMovie() {
_root.counting = "true";
log("Play released");
log(_root.MovieStatus);
PauseBtn._visible = true;
PlayBtn._visible = false;
if (_root.MovieStatus == "paused") {
netStream.pause();
log("E pe pause si tre sa faca play");
} else if (_root.MovieStatus == "finished") {
log("e la final si face play");
netStream.seek(0);
_root.relatedMC._visible = false;
_root.video._alpha = 100;
_root.MovieStatus == "running";
if (_root.rotateMovie) {
clearInterval(_root.rotateMovie);
}
} else {
netStream.pause();
log("E pe pause si tre sa faca play");
}
}
function scaleVideo() {
Stage.align = "TL";
videoMC = _root.video;
bgMC = _root.bgPlayer;
Controls = _root.Controls;
relatedMC = _root.relatedMC;
ratio = videoMC._height / videoMC._width;
videoMC._width = (bgMC._width = Stage.width);
videoMC._height = (bgMC._height = videoMC._width * ratio);
videoMC._x = 0;
videoMC._y = 0;
Controls._x = (Stage.width / 2) - Math.round(Controls._width / 2);
Controls._y = Stage.height - 70;
relatedMC._x = Stage.width / 2;
relatedMC._y = Stage.height / 2;
if (Stage.displayState == "normal") {
checkResize();
}
}
function setVolumebarSize(cur, total) {
if (cur < 0) {
cur = 0;
}
if (cur > total) {
cur = total - 2;
}
}
function clearVolumeBar() {
Vol._parent.gotoAndPlay("clearVolume");
}
function checkResize() {
w = _root.videoProps.width;
h = _root.videoProps.height;
if ((w != "352") && (h != "288")) {
Resize(_root.video, 450, 338);
}
}
function Resize(movie, w, h) {
movie._width = w;
movie._height = h;
movie._y = (_root.bgPlayer._height - h) / 2;
movie._x = (_root.bgPlayer._width - w) / 2;
}
function setPlayedTime() {
var _local3 = Math.round((netStream.time / _root.TotalTime) * _root.Controls.Progress.Frames._width);
_root.Controls.Progress.PlayedStatus._width = _local3;
if (_local3 >= 100) {
}
}
function checkBytesLoaded(netStream) {
if (_root.MovieLoadedComplete) {
}
var _local4 = Math.round((netStream.bytesLoaded / netStream.bytesTotal) * _root.Controls.Progress.Frames._width);
_root.Controls.Progress.LoadedStatus._width = _local4;
if (netStream.bytesLoaded == netStream.bytesTotal) {
_root.MovieLoadedComplete = true;
}
if (netStream.bytesTotal == -1) {
}
}
function format_minute_time(t) {
if (t == undefined) {
return("0:00");
}
var _local2 = String(Math.floor(t % 60));
if (_local2.length == 1) {
_local2 = "0" + _local2;
}
var _local1 = String(Math.floor(t / 60));
if (_local1.length == 1) {
_local1 = "0" + _local1;
}
return((_local1 + ":") + _local2);
}
function roundDecimal(num, places) {
places = Math.pow(10, places);
return((Math.round(num * places) / places) / 60);
}
function log(string) {
_root.Console.text = _root.Console.text + (string + newline);
}
function endVideo() {
log("CLOSE");
var relatedItems = new XML();
relatedItems.ignoreWhite = true;
relatedItems.onLoad = function (success) {
log("incarcat");
related = xml2array(relatedItems);
if (_root.rotateMovie) {
clearInterval(_root.rotateMovie);
}
_root.rotateMovie = setInterval(playRelated, _root.switchLimitMiliseconds, related);
playRelated(related);
};
relatedItems.onHTTPStatus = function (status) {
log("HTTP Status: " + status);
};
relatedItems.load(("http://www.220.ro/XML/" + _root.videoid) + ".xml");
}
function xml2array(xml) {
var _local5 = (_root.totalMovies = xml.firstChild.childNodes.length);
var _local3 = new Array();
var _local2 = 0;
while (_local2 < _local5) {
_local3[_local2] = new Array();
_local3[_local2][0] = unescape(xml.firstChild.childNodes[_local2].childNodes[0].childNodes[0]);
_local3[_local2][1] = unescape(xml.firstChild.childNodes[_local2].childNodes[1].childNodes[0]);
_local3[_local2][2] = unescape(xml.firstChild.childNodes[_local2].childNodes[2].childNodes[0]);
_local3[_local2][3] = unescape(xml.firstChild.childNodes[_local2].childNodes[3].childNodes[0]);
_local3[_local2][4] = unescape(xml.firstChild.childNodes[_local2].childNodes[4].childNodes[0]);
_local3[_local2][5] = unescape(xml.firstChild.childNodes[_local2].childNodes[5].childNodes[0]);
_local3[_local2][6] = unescape(xml.firstChild.childNodes[_local2].childNodes[6].childNodes[0]);
_local3[_local2][7] = unescape(xml.firstChild.childNodes[_local2].childNodes[7].childNodes[0]);
_local3[_local2][8] = unescape(xml.firstChild.childNodes[_local2].childNodes[8].childNodes[0]);
_local3[_local2][9] = unescape(xml.firstChild.childNodes[_local2].childNodes[9].childNodes[0]);
_local3[_local2][10] = unescape(xml.firstChild.childNodes[_local2].childNodes[10].childNodes[0]);
_local3[_local2][11] = unescape(xml.firstChild.childNodes[_local2].childNodes[11].childNodes[0]);
_local3[_local2][12] = unescape(xml.firstChild.childNodes[_local2].childNodes[12].childNodes[0]);
_local3[_local2][13] = unescape(xml.firstChild.childNodes[_local2].childNodes[13].childNodes[0]);
_local2++;
}
return(_local3);
}
function playRelated(arr) {
rel = _root.relatedMC;
_root.currentIteNr++;
if (!_root.currentIteNr) {
_root.currentIteNr = 0;
}
if (_root.currentIteNr < 0) {
_root.currentIteNr = _root.totalMovies - 1;
}
if (_root.currentIteNr == arr.length) {
_root.currentIteNr = 0;
}
rel.btn.onRollOver = function () {
rel.bg._alpha = 30;
};
rel.btn.onRollOut = function () {
rel.bg._alpha = 40;
};
rel.btn.onRelease = (rel.btn.onReleaseOutside = function () {
getURL (arr[_root.currentIteNr][5]);
});
rel.current.text = _root.currentIteNr + 1;
rel.totalMovies.text = _root.totalMovies;
rel.titlu.text = arr[_root.currentIteNr][1];
var _local4 = new MovieClipLoader();
var _local3 = new Object();
_local3.onLoadProgress = function (target, bytesLoaded, bytesTotal) {
if (bytesLoaded == bytesTotal) {
log("Img incarcata");
}
};
_local3.onLoadComplete = function (target_mc) {
log("Am incarcat thumbnailul: " + rel.img.width);
};
_local4.addListener(_local3);
_local4.loadClip(arr[_root.currentIteNr][2], rel.img);
rel.summary.text = arr[_root.currentIteNr][3];
rel.stars.gotoAndStop(Math.round(arr[_root.currentIteNr][8]));
rel.duration.text = arr[_root.currentIteNr][4];
rel.author.text = arr[_root.currentIteNr][12];
rel.prevRelated.onRollOver = (rel.prevRelated.onRollOut = (rel.nextRelated.onRollOver = (rel.nextRelated.onRollOut = function () {
this.play();
})));
rel.nextRelated.onRelease = (rel.nextRelated.onRelease = function () {
clearInterval(_root.rotateMovie);
_root.rotateMovie = setInterval(playRelated, _root.switchLimitMiliseconds, related);
playRelated(arr);
});
rel.prevRelated.onRelease = (rel.prevRelated.onRelease = function () {
clearInterval(_root.rotateMovie);
_root.rotateMovie = setInterval(playRelated, _root.switchLimitMiliseconds, related);
_root.currentIteNr--;
_root.currentIteNr--;
playRelated(arr);
});
if (_root.totalMovies > 0) {
_root.video._alpha = 30;
rel._visible = true;
rel.timer.canplay = true;
rel.timer.gotoAndPlay(1);
}
}
Stage.scaleMode = "noScale";
if (_root._url.indexOf("file://") != -1) {
_root.videoFile = "b550.flv";
} else if (_root._url.indexOf("developer.activesoft") != -1) {
log("e pe developer");
} else if (_root._url.indexOf("www.220.ro") != -1) {
log("e online");
}
if (_root._url.indexOf("www.220.ro") == -1) {
home.onRelease = function () {
getURL (_root.relurl, "_blank");
};
} else {
home._visible = false;
}
_root.videoProps = new Object();
if (_root.videoFile eq "undefined") {
err.gotoAndStop(2);
}
if (_root.debug != "true") {
_root.Console._visible = false;
}
_root.relatedMC._visible = false;
log(_root.videoFile);
var netConnection = new NetConnection();
netConnection.connect(null);
var netStream = new NetStream(netConnection);
PauseBtn = _root.Controls.PlayPause.PauseBtn;
PlayBtn = _root.Controls.PlayPause.PlayBtn;
PlayBtn.onRelease = (PlayBtn.onReleaseOutside = function () {
togglePayMovie();
});
PauseBtn.onRelease = (PauseBtn.onReleaseOutside = function () {
trace("Pause released");
_root.counting = "false";
PauseBtn._visible = false;
PlayBtn._visible = true;
netStream.pause();
_root.MovieStatus = "paused";
});
FullScreen = _root.Controls.FullScreen;
FullScreen.onRelease = (FullScreen.onReleaseOutside = function () {
Stage.displayState = ((Stage.displayState == "normal") ? "fullScreen" : "normal");
});
stageListener = new Object();
stageListener.onResize = function () {
scaleVideo();
};
Stage.addListener(stageListener);
Options = _root.Controls.Options;
Options.onRelease = (Options.onReleaseOutside = function () {
trace("Optins Button Pressed");
});
_root.Controls.Progress.Frames.SeekBar.onRelease = function () {
mousePercent = (_root.TotalTime * this._xmouse) / _root.Controls.Progress.Frames._width;
netStream.seek(mousePercent);
};
Vol = _root.Controls.Volume.DateVolum;
Vol.VolumeBar._visible = false;
Vol.VolumeBar.BG.onPress = function () {
clearInterval(_root.clearVolumeBarInterval);
this.onEnterFrame = function () {
Vol.VolumeBar.amount._height = Vol.VolumeBar.BG._height - Vol.VolumeBar.BG._ymouse;
mousePos = Vol.VolumeBar.BG._ymouse;
totalHeight = Math.round(Vol.VolumeBar.BG._height);
volumePercent = Math.round((mousePos / totalHeight) * 100);
amountHeight = totalHeight - mousePos;
if (amountHeight < 0) {
amountHeight = 0;
}
if (amountHeight > totalHeight) {
amountHeight = totalHeight - 2;
}
Vol.VolumeBar.amount._height = amountHeight;
volAmount = 100 - volumePercent;
if (volAmount > 100) {
volAmount = 100;
}
if (volAmount < 0) {
volAmount = 0;
}
Vol.currentVolume.text = volAmount;
_root.audio.setVolume(volAmount);
userPlayerPrefs.data.playerVolume = volAmount;
_root.prefferedVolume = volAmount;
this.onRelease = (this.onReleaseOutside = function () {
log("Volume bar released.");
Vol._parent.Timer.play();
if (Vol._parent.VolBtn._currentframe == 2) {
Vol._parent.VolBtn.onRelease();
}
delete this.onEnterFrame;
});
};
};
Vol._parent.VolBtn.onRollOver = function () {
Vol.VolumeBar._visible = true;
Vol._parent.gotoAndPlay(1);
};
Vol._parent.VolBtn.onRollOut = function () {
};
Vol._parent.VolBtn.onRelease = function () {
Vol._parent.gotoAndPlay(1);
this.play();
};
netStream.onStatus = function (infoObject) {
for (var _local3 in infoObject) {
log((("\t" + _local3) + ":\t") + infoObject[_local3]);
if (infoObject[_local3] == "NetStream.Play.Start") {
_root.Controls.PlayPause.gotoAndStop(2);
}
if (infoObject[_local3] == "NetStream.Play.Pause") {
_root.Controls.PlayPause.gotoAndStop(1);
}
if ((infoObject[_local3] == "NetStream.Play.Stop") || ((_root.Controls.Time.AllTime.text == _root.Controls.Time.PassedTime.text) && (infoObject[_local3] == "NetStream.Buffer.Empty"))) {
PauseBtn._visible = false;
PlayBtn._visible = true;
_root.counting = "false";
_root.MovieStatus = "finished";
if (_root.videoid) {
endVideo();
log("Movie finished: " + infoObject[_local3]);
log("Timp total: " + _root.Controls.Time.PassedTime.text);
log("Timp curent: " + _root.Controls.Time.AllTime.text);
}
}
}
};
Time = _root.Controls.Time;
netStream.onMetaData = function (metaInfo) {
Time.AllTime.text = format_minute_time(metaInfo.duration);
_root.TotalTime = metaInfo.duration;
for (var _local3 in metaInfo) {
_root.videoProps[_local3] = metaInfo[_local3];
}
checkResize();
if (_root.autostart ne "true") {
log("ACUM OPRESC FILMUL");
netStream.seek(0);
netStream.pause();
PauseBtn._visible = false;
PlayBtn._visible = true;
_root.autostart = "true";
}
};
PassedTime = function () {
if (_root.counting != "false") {
Time.PassedTime.text = format_minute_time(netStream.time);
}
};
_root.atEnterFrame = function () {
_root.onEnterFrame = function () {
PassedTime();
setPlayedTime();
checkBytesLoaded(netStream);
};
};
playVideo(_root.videoFile);
_root.switchLimitMiliseconds = 8800;
Symbol 6 MovieClip Frame 1
stop();
Symbol 6 MovieClip Frame 2
stop();
Symbol 17 MovieClip Frame 1
stop();
Symbol 36 MovieClip Frame 1
stop();
Symbol 36 MovieClip Frame 30
_parent.play();
Symbol 41 MovieClip Frame 1
stop();
_root.audio.setVolume(_root.prefferedVolume);
Symbol 41 MovieClip Frame 2
stop();
_root.audio.setVolume(0);
Symbol 51 MovieClip Frame 1
stop();
Symbol 51 MovieClip Frame 2
DateVolum._visible = true;
_root.clearVolumeBarInterval = setInterval(_root.clearVolumeBar, 3000);
Symbol 51 MovieClip Frame 16
stop();
Symbol 51 MovieClip Frame 23
DateVolum._visible = false;
clearInterval(_root.clearVolumeBarInterval);
Symbol 74 MovieClip Frame 1
stop();
Symbol 74 MovieClip Frame 2
stop();
Symbol 74 MovieClip Frame 3
stop();
Symbol 74 MovieClip Frame 4
stop();
Symbol 74 MovieClip Frame 5
stop();
Symbol 87 MovieClip Frame 10
gotoAndStop (1);
Symbol 88 MovieClip Frame 1
stop();
Symbol 88 MovieClip Frame 2
stop();
Symbol 93 MovieClip Frame 1
if (!canplay) {
stop();
}
Symbol 98 MovieClip Frame 1
stop();
Symbol 98 MovieClip Frame 2
stop();
Symbol 98 MovieClip Frame 3
stop();
Symbol 102 MovieClip Frame 15
gotoAndStop (1);
Symbol 103 MovieClip Frame 1
stop();
Symbol 103 MovieClip Frame 2
stop();
Symbol 104 MovieClip Frame 1
mail.onRollOver = (mail.onRollOut = function () {
mail.play();
});
mail.onRelease = (mail.onReleaseOutside = function () {
getURL ((("mailto:?Subject=" + _root.reltitle) + "&body=") + _root.relurl);
});
yahoo.onRollOver = (yahoo.onRollOut = function () {
yahoo.play();
});
yahoo.onRelease = (yahoo.onReleaseOutside = function () {
getURL ("javascript: getCurrentUrl()");
Set(undefined, undefined);
getURL (((("ymsgr:im?+&msg=" + _root.reltitle) + " ") + _root.relurl) + " ");
});
replay.onRollOver = (replay.onRollOut = function () {
replay.play();
});
mail.bg.gotoAndStop(1);
yahoo.bg.gotoAndStop(2);
replay.bg.gotoAndStop(3);
replay.onRelease = (replay.onReleaseOutside = function () {
_root.togglePayMovie();
});