📄 pssslidepanel.as
字号:
_Panel.SoundPlay = !_Panel.SoundPlay;
this.press_mc._visible = _Panel.SoundPlay;
if (_Panel.SoundPlay) {
PSSSound.loadingSound(_Panel.pathToSound, _Panel);
} else {
PSSSound.stopSound();
_Panel.hideSoundLine();
}
} else {
this.deactiv_mc._visible = true;
}
// from hint class
Hint.killHint();
};
sound_mc.onRollOver = function() {
if (_Panel.SoundPlay) {
var hinttext:String = _global.PSS_UI.lib_soff;
} else {
var hinttext:String = _global.PSS_UI.lib_loads;
}
if (_Panel.SoundEviable) {
// from hint class
Hint.labelText(hinttext);
}
};
sound_mc.onRollOut = function() {
// from hint class
Hint.killHint();
};
//sound bar
SoundBarBut.onPress = function():Void {
this.color_mc._visible = true;
this.startDrag(false, null, 10, null, 85);
this.onMouseMove = function() {
if ((85-this._y)>0) {
if ((85-this._y)>75) {
PSSSound.incVolume(100-(this._y-10));
} else {
PSSSound.incVolume(85-this._y);
}
}
};
};
SoundBarBut.onRelease = SoundBarBut.onReleaseOutside=function ():Void {
this.color_mc._visible = false;
this.stopDrag();
delete this.onMouseMove;
};
//******************************************PLAY MENU EVENT********************************
PlayBut.onRelease = function():Void {
clearInterval(ShowInterval);
if (!LOCK) {
Hint.killHint();
_Panel.PlayShow = !_Panel.PlayShow;
_Panel.PlayMenu.deseblePlayHint();
if (_Panel.PlayShow) {
this.playLabel_mc.gotoAndStop(2);
_Panel.playShow();
} else {
this.playLabel_mc.gotoAndStop(1);
_Panel.pauseShow();
}
}
};
NextBut.onRelease = function():Void {
if (!LOCK) {
Hint.killHint();
_Panel.PlayShow = false;
_Panel.PlayMenu.desebleNextHint();
_Panel.nextPhoto(true);
}
};
PrevBut.onRelease = function():Void {
if (!LOCK) {
Hint.killHint();
_Panel.PlayShow = false;
_Panel.PlayMenu.deseblePrevHint();
_Panel.prevPhoto(true);
}
};
//*******end***************************PLAY MENU EVENT********************************
}
//***************************END ALL EVENTS************************
//********************minimaze panel
private function minimazePanel():Void {
var _Panel:MovieClip = Panel;
PSSSlideShow.lockPanelPlace();
Panel.onEnterFrame = function():Void {
this._y += ((Stage.height+20)-this._y)/3;
if (Math.ceil(this._y) == Math.ceil((Stage.height+20))) {
delete this.onEnterFrame;
}
};
}
private function showPanel():Void {
PSSSlideShow.unlockPanelPlace();
Panel.onEnterFrame = function():Void {
PanelY = Stage.height-(Panel._height+10);
this._y += (this.PanelY-this._y)/2;
if (Math.round(this.PanelY-this._y) == 0) {
delete this.onEnterFrame;
}
};
}
private function MinimazeActiv():Void {
var _Panel:MovieClip = Panel;
var Show:Boolean = true;
_root.onMouseMove = function() {
if (_root._ymouse>Stage.height-(_Panel._height+20) && !Show) {
_Panel.showPanel();
Show = true;
} else if (_root._ymouse<Stage.height-(_Panel._height+20) && Show) {
Show = false;
_Panel.minimazePanel();
}
};
}
//*******************************setNewColor
public function setNewColor():Void {
PlayMenu.setNewColor();
Preloader.setNewColor();
ColorDispatcher.setSimplyColor(Screen.SoundColor_mc, _global.ActivColor);
ColorDispatcher.setSimplyColor(SoundBar.soundBut_mc.color_mc, _global.ActivColor);
}
//*************************sound loader progress**************
public function soundProgress(proc:Number):Void {
if (!isNaN(proc)) {
Screen.SoundColor_mc._width = proc*2;
if (proc == 100) {
Panel.SoundPlay = false;
sound_mc.press_mc._visible = false;
hideSoundLine();
}
}
}
private function hideSoundLine():Void {
Screen.SoundColor_mc.onEnterFrame = function() {
if (this._width>0) {
this._width -= 2;
} else {
this._width = 0;
delete this.onEnterFrame;
}
};
}
//****************************SlideShow ACTION*********************
private function playShow():Void {
PlayBut.playLabel_mc.gotoAndStop(2);
slideShow(false, _global.slidetimer);
}
private function pauseShow():Void {
PlayShow = false;
PlayBut.playLabel_mc.gotoAndStop(1);
slideShow(true, 0);
}
//***************************************************SLIDE SHOW***********************************************************************
private function slideShow(stopShow:Boolean, timer:Number):Void {
var photoIsLoaded:Boolean = false;
var showTimer:Number = timer;
var _EffectClass:Object = EffectClass;
var _Panel:MovieClip = Panel;
var timer100proc:Number = _Panel.timerLinePas._width;
var timerStep:Number = timer100proc/timer;
if (!stopShow) {
photoLoadAction(1);
ShowInterval = setInterval(playShow, 1000);
} else {
clearInterval(ShowInterval);
_Panel.timerLineAct._width = 0;
_Panel.PlayBut.playLabel_mc.gotoAndStop(1);
}
function playShow():Void {
_Panel.PlayBut.playLabel_mc.gotoAndStop(2);
var LineDes:Boolean = false;
_Panel.timerLinePas;
showTimer--;
if (showTimer == 0) {
LineDes = true;
if (_EffectClass.isPhotoLoaded()) {
_Panel.nextPhoto();
_Panel.timerLineAct._width = 0;
showTimer = _global.slidetimer;
} else {
showTimer = 1;
}
} else {
if (!LineDes && _Panel.timerLineAct._width<timer100proc) {
_Panel.timerLineAct._width += timerStep;
}
}
}
}
private function nextPhoto(isPause:Boolean):Void {
if (isPause) {
pauseShow();
loopRandOff();
}
photoLoadAction(1);
}
private function prevPhoto(isPause:Boolean):Void {
if (isPause) {
pauseShow();
loopRandOff();
}
photoLoadAction(-1);
}
private function loopRandOff():Void {
Panel.LoopPlay = false;
loop_mc.gotoAndStop(1);
Panel.RandomPlay = false;
random_mc.gotoAndStop(1);
}
private function photoLoadAction(derection:Number):Boolean {
DerectionPlay = derection;
//partIndex;
//albumIndex;
//photoIndex;
//TempArray;
//PartsArray;
//AlbumsArray;
//PhotosArray;
//AlbumData;
//PartData;
//PhotoData;
var photoCount:Number = PhotosArray.length-1;
var albumsCount:Number = AlbumsArray[partIndex].length-1;
var partsCount:Number = PartsArray.length-1;
if (derection>0) {
if (photoCount>photoIndex) {
photoIndex++;
if (PlayShow && RandomPlay) {
randomShow();
}
PhotoData = PhotosArray[photoIndex];
EffectClass.openPhoto("photoparts/"+PhotoData.p_id+"/"+PhotoData.a_id+"/big/"+PhotoData.file);
} else {
if (PlayShow && RandomPlay) {
RandomArray = new Array();
}
if (!AllAlbumsPlay && PlayShow && !LoopPlay) {
pauseShow();
return true;
} else if (!AllAlbumsPlay && PlayShow && LoopPlay) {
photoIndex = 0;
PhotoData = PhotosArray[photoIndex];
EffectClass.openPhoto("photoparts/"+PhotoData.p_id+"/"+PhotoData.a_id+"/big/"+PhotoData.file);
return true;
}
photoIndex = 0;
if (albumsCount>albumIndex) {
albumIndex++;
AlbumData = AlbumsArray[partIndex][albumIndex];
loadPhotosXML(AlbumData.p_id, AlbumData.id);
checkSound();
} else {
albumIndex = 0;
photoIndex = 0;
PhotoData = PhotosArray[photoIndex];
if (partsCount>partIndex) {
partIndex++;
PartData = PartsArray[partIndex];
AlbumData = AlbumsArray[partIndex][albumIndex];
loadPhotosXML(AlbumData.p_id, AlbumData.id);
checkSound();
} else {
if (!AllAlbumsPlay && PlayShow && !LoopPlay) {
nextPhotoLabel(photoIndex);
return true;
}
partIndex = 0;
albumIndex = 0;
photoIndex = 0;
PhotoData = PhotosArray[photoIndex];
PartData = PartsArray[partIndex];
AlbumData = AlbumsArray[partIndex][albumIndex];
loadPhotosXML(AlbumData.p_id, AlbumData.id);
checkSound();
}
}
}
} else if (derection<0) {
if (photoIndex>0) {
photoIndex--;
PhotoData = PhotosArray[photoIndex];
EffectClass.openPhoto("photoparts/"+PhotoData.p_id+"/"+PhotoData.a_id+"/big/"+PhotoData.file);
} else {
if (albumIndex>0) {
albumIndex--;
AlbumData = AlbumsArray[partIndex][albumIndex];
loadPhotosXML(AlbumData.p_id, AlbumData.id);
} else {
if (partIndex>0) {
partIndex--;
albumIndex = AlbumsArray[partIndex].length-1;
PartData = PartsArray[partIndex];
AlbumData = AlbumsArray[partIndex][albumIndex];
loadPhotosXML(AlbumData.p_id, AlbumData.id);
checkSound();
} else {
partIndex = partsCount;
albumIndex = AlbumsArray[partIndex].length-1;
PartData = PartsArray[partIndex];
AlbumData = AlbumsArray[partIndex][albumIndex];
loadPhotosXML(AlbumData.p_id, AlbumData.id);
checkSound();
}
}
}
}
//nextPhotoLabel(photoIndex);
}
private function randomShow():Void {
RandomIndex = Math.round(Math.random()*(PhotosArray.length-1));
var test:Number = 1;
for (var i = 0; i<RandomArray.length; i++) {
if (RandomIndex == RandomArray[i]) {
test = -1;
}
}
if (test != -1) {
photoIndex = RandomIndex;
RandomArray.push(photoIndex);
if (PhotosArray.length == RandomArray.length) {
photoIndex = PhotosArray.length-1;
}
} else {
randomShow();
}
}
private function checkSound():Void {
if (AlbumData.sounddesc) {
SoundEviable = true;
sound_mc.deactiv_mc._visible = false;
sound_mc.press_mc._visible = false;
soundbar_mc.soundBut_mc._visible = true;
pathToSound = "photoparts/"+PartData.id+"/"+AlbumData.id+"/"+AlbumData.sounddesc;
//PSSSound.incVolume(40);
} else {
SoundEviable = false;
sound_mc.deactiv_mc._visible = true;
sound_mc.press_mc._visible = false;
//soundbar_mc.soundBut_mc._visible = false;
}
}
// *****************load photos xml*************
public function loadPhotosXML(pId:Number, aId:Number):Void {
var _PlayMenu:MovieClip = PlayMenu;
_PlayMenu.block();
var _Panel:MovieClip = Panel;
var _EffectClass:Object = EffectClass;
MenuXMLAssembler.loadPhotosXMLSlide(pId, aId);
//var intervalIndex:Number = setInterval(chechPhotoXML, 50);
MenuXMLAssembler.setCalBackAction(chechPhotoXML, this);
function chechPhotoXML():Void {
if (MenuXMLAssembler.getPhotosIsLoadedSlide()) {
_Panel.PhotosArray = MenuXMLAssembler.getPhotosArraySlide();
if (_Panel.DerectionPlay>0) {
//_Panel.nextPhotoLabel(_Panel.photoIndex);
_Panel.PhotoData = _Panel.PhotosArray[0];
_EffectClass.openPhoto("photoparts/"+_Panel.PhotoData.p_id+"/"+_Panel.PhotoData.a_id+"/big/"+_Panel.PhotoData.file);
} else {
_Panel.photoIndex = _Panel.PhotosArray.length-1;
_Panel.PhotoData = _Panel.PhotosArray[_Panel.photoIndex];
//_Panel.nextPhotoLabel(_Panel.PhotosArray.length-1);
_EffectClass.openPhoto("photoparts/"+_Panel.PhotoData.p_id+"/"+_Panel.PhotoData.a_id+"/big/"+_Panel.PhotoData.file);
}
_PlayMenu.unblock();
//clearInterval(intervalIndex);
}
}
}
//****end********************SlideShow ACTION*********************
public function preloaderDesable():Void {
Preloader.deseble();
}
public function preloaderActivate():Void {
Preloader.activate();
}
public function placePhoto():Void {
EffectClass.placePhoto();
placePreloader();
}
private function placePreloader():Void {
if (preloader) {
preloader._x = (Stage.width-preloader._width)/2;
preloader._y = (Stage.height-preloader._height)/2;
}
}
public function lockPanel():Void {
LOCK = true;
}
public function unlockPanel():Void {
LOCK = false;
}
//*****************end class********************
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -