Function fadeTPl_1 (co, no)
{
CurrPicObj = co;
NextPicObj = no;
FadingLoop = setInterval (function ()
{
If (nextPicObj. _ alpha >=100 & currentPic. _ alpha <= 0)
{
ClearInterval (fadingLoop );
CurrentPic = nextPic;
IsFading = false;
Return (undefined );
} // End if
CurrPicObj. _ alpha = currPicObj. _ alpha-10;
NextPicObj. _ alpha = nextPicObj. _ alpha + 10;
}, 50 );
} // End of the function
Function getData ()
{
Var xmlObj = new XML ();
XmlObj. load ("xml/xml. xml ");
XmlObj. ignoreWhite = true;
XmlObj. onLoad = function (success)
{
FixData (xmlObj );
};
} // End of the function
Function fixData (o)
{
Var _ l1 = 0;
While (_ l1 <o. firstChild. childNodes. length)
{
PreLoadPic (_ l1, o. firstChild. childNodes [_ l1]. childNodes [2]. firstChild );
ArrUrl. push (o. firstChild. childNodes [_ l1]. childNodes [1]. firstChild );
ArrTitle. push (o. firstChild. childNodes [_ l1]. childNodes [0]. firstChild );
_ L1 ++;
} // End while
Linkbutton. onRelease = function ()
{
GetURL (arrUrl [0], "_ blank ");
};
Btn1_mc.gotoAndStop (2 );
} // End of the function
Function preLoadPic (I, u)
{
I ++;
Eval ("img" + I + "_ mc"). loadMovie (u );
CheckPicLoad (I, eval ("img" + I + "_ mc "));
} // End of the function
Function checkPicLoad (I, o)
{
O. onEnterFrame = function ()
{
If (int (o. getBytesLoaded ()/o. getBytesTotal () * 100)> = 100)
{
Eval ("btn" + I + "_ mc"). _ visible = true;
Delete o ["onEnterFrame"];
} // End if
};
} // End of the function
Function start ()
{
GetData ();
} // End of the function
Function checkFade ()
{
Var I = 1;
While (I <5)
{
If (eval ("btn" + I + "_ mc"). _ visible = false)
{
Return (undefined );
} // End if
I ++;
} // End while
ClearInterval (picLoadLoop );
StartFade ();
} // End of the function
Function startFade ()
{
PlayerPlay ();
} // End of the function
Function picFade ()
{
NextPic = currentPic = 4? (1): (parseInt (currentPic) + 1 );
LoadFadeTpl (eval ("img" + currentPic + "_ mc"), eval ("img" + nextPic + "_ mc "));
} // End of the function
Function loadFadeTpl (co, no)
{
IsFading = true;
Linkbutton. onRelease = function ()
{
GetURL (arrUrl [nextPic-1], "_ blank ");
};
SetButtonColor ();
FadeTPl_1 (co, no );
} // End of the function
Function setButtonColor ()
{
Var I = 1;
While (I <5)
{
Eval ("btn" + I + "_ mc"). gotoAndStop (1 );
I ++;
} // End while
Eval ("btn" + nextPic + "_ mc"). gotoAndStop (2 );
} // End of the function
Function setCurrPic (cp)
{
If (currentPic = cp)
{
Return (undefined );
} // End if
If (isFading = false)
{
PlayerStop ();
NextPic = cp;
LoadFadeTpl (eval ("img" + currentPic + "_ mc"), eval ("img" + nextPic + "_ mc "));
}
Else
{
Trace (isFading );
} // End if
} // End of the function
Function playPrePic ()
{
PlayerStop ();
NextPic = currentPic = 1? (4): (parseInt (currentPic)-1 );
LoadFadeTpl (eval ("img" + currentPic + "_ mc"), eval ("img" + nextPic + "_ mc "));
} // End of the function
Function playNextPic ()
{
PlayerStop ();
PicFade ();
} // End of the function
Function playerStop ()
{
_ Root. player_mc.gotoAndStop (1 );
ClearInterval (fadeLoop );
} // End of the function
Function playerPlay ()
{
_ Root. player_mc.gotoAndStop (2 );
FadeLoop = setinteger (picFade, 4000 );
} // End of the function
Stop ();
Stage. scaleMode = "noScale ";
Stage. showMenu = false;
System. useCodepage = false;
Var picLoadLoop;
Var fadeLoop;
Var currentPic = 1;
Var nextPic;
Var arrUrl = [];
Var arrTitle = [];
Var isFading = false;
Var fadingLoop;
Var currPicObj;
Var nextPicObj;
PicLoadLoop = setInterval (checkFade, 500 );
Start ();