Flash image switching

Source: Internet
Author: User

 

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,

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.