Flash image switching. Here, three actions are listed separately, and an aa. xml file is used to analyze the xml document and process the image to flash. First, let's look at the code of the three flash actions.
1
Stage. scaleMode = "noScale ";
// Stage. align = "TL ";
Fscommand ("showmenu", false );
System. useCodepage = true;
// Create a new XML object.
Var xmlObj: XML = new XML ();
// Set the ignoreWhite property to true (default value is false ).
XmlObj. ignoreWhite = true;
// After loading is complete, trace the XML object.
XmlObj. onLoad = function (success ){
GotoAndPlay (3 );
};
// Load the XML into the xmlObj object.
// XmlObj. load (picurl );
XmlObj. load ("pic_list.xml ");
Stop ();
_ Quality = "best ";
2
Pic_show1. _ visible = true;
Now = 1;
Function lik_see (){
Var lik0 = new Array ();
For (I = 1; I <n; I ++ ){
Lik0.push ({lik: this ["pic_show" + I], depth: this ["pic_show" + I]. getDepth ()});
}
Lik0.sortOn ("depth", 16)
For (I = 0; I <n; I ++ ){
Lik0 [I]. lik. _ visible = false;
}
Lik0 [N-2]. lik. _ visible = true;
Lik0 [n-3]. lik. _ visible = true;
Lik0 [n-4]. lik. _ visible = true;
Lik0 [N-5]. lik. _ visible = true;
Lik0 [n-6]. lik. _ visible = true;
Jishi. gotoAndPlay (1 );
}
Caidan. caidan. left0.onRelease = function (){
Now --;
If (now <1) now = n-1;
Lik = _ root ["pic_show" + now]
Lik. _ visible = true;
Lik. swapDepths (m );
Lik. gotoAndPlay (1 );
Caidan. caidan. caidantiao. back0. _ x = (now-1) * 50
M ++;
Lik_see ();
Trace (now)
Trace (lik)
Trace (m)
}
Caidan. caidan. right0.onRelease = function (){
Now ++;
If (now = n) now = 1;
Lik = _ root ["pic_show" + now]
Lik. _ visible = true;
Lik. swapDepths (m );
Lik. gotoAndPlay (1 );
Caidan. caidan. caidantiao. back0. _ x = (now-1) * 50
M ++;
Lik_see ();
Trace (now)
Trace (lik)
Trace (m)
}
Stop ();
Well, I have all the flash as posts. Now let's look at the xml format.
<? Xml version = "1.0" encoding = "gb2312"?>
<Forums>
<Forum>
<Pic> 1.jpg</pic>
<Expline> Beauty </expline>
<Url> http://111cn.net </url>
</Forum>
<Forum>
<Pic> 2.jpg</pic>
<Expline> Beauty </expline>
<Url> http://111cn.net </url>
</Forum>
</Forums>
All right, we just need to get the picture path right,