Learn Flash component Application MP3 production

Source: Internet
Author: User

Animation effect:

Click to download the file

(1) First see an XML format playlist, the file name is "Mp3.xml", the code is as follows:

<?xml version= "1.0"?>
<mp3Files>
<mp3play Mp3url = "Address 1" mp3name = "song name 1"/>
<mp3play Mp3url = "Address 2" Mp3name = "song name 1"/>
<mp3play Mp3url = "Address 3" Mp3name = "song name 3"/>
<mp3play Mp3url = "Address 4" Mp3name = "song name 4"/>
<mp3play Mp3url = "Address 5" Mp3name = "song name 5"/>
<mp3play Mp3url = "Address 6" Mp3name = "song name 6"/>
<mp3play Mp3url = "Address 7" Mp3name = "song name 7"/>
</mp3Files> (2) To open the component panel CTRL+F7, set the component name Onxml,url to Mp3.xml,direction as "receive" as shown


(3) Select Onxml, open the component Inspector Alt+f7 Select "Schema", then select Results:xml, click the Small icon on the right with the mouse, as shown.


(4) Select "Bind", click "Add Binding", choose "Mp3play:array" in the pop-up dialog box, and click OK.


(5) Again set "direction" value is "in", "formatter" value is "rearrange Fields", "Formatte ..." for "Label=mpsname;data=mp3url"
Click Bound to, as shown in the figure, to select the gray area. Click Confirm

(6) In the component tray, drag a mediaplayback to the stage, the component name is MP3 set as shown.


(7) Drag out a list to the stage, build the Name list, select the binding in the Build checker, click Add Binding, and select Dataprovider:array in the pop-up basket
As shown in the figure, click Confirm.
(8) The setting of the list value is the same as (5)
(9) Finally add as code, select the first frame, as follows:

Onxml.trigger ();
Mymp3=new Object ();
Mymp3.chang=function () {
Mp3.stop ();
Mp3.setmedia (List.selectedItem.data, "MP3");
Mp3.play ();
Title.text= "Play Song:" +list.selecteditem.label;
};
List.addeventlistener ("Change", "Mymp3"); <?xml version= "1.0"?>
<mp3Files>
<mp3play Mp3url = "Http://www.dreammates.com.cn/...022020446.mp3" mp3name = "no such life-Chen Xiaochun-Superstar"/>
<mp3play Mp3url = "http://www.webx.cn/mp3/mouse loves rice. mp3" Mp3name = "Andy Lau-Not enough to love you"/>
<mp3play Mp3url = "Http://y620.vicp.net/...20051014151018376.mp3" mp3name = "Next Dare-Andy Lau Dong Mengchi margin theme song"/>
<mp3play Mp3url = "Http://song.luzhou.net/music4/5234tg/12.mp3" mp3name = "The Heavenly Kingdom of Love, the wedding dress cyndi"/>
<mp3play Mp3url = "Address 4" Mp3name = "song name 4"/>
<mp3play Mp3url = "Address 5" Mp3name = "song name 5"/>
<mp3play Mp3url = "Address 6" Mp3name = "song name 6"/>
<mp3play Mp3url = "Address 7" Mp3name = "song name 7"/>
</mp3Files>

Saved in XML format, in the same folder as the SWF



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.