The usage of the MP3 +windows component implemented by Asfunction+media

Source: Internet
Author: User
Window

First look at the effect


source File Download
The following is a title that adds music to the address and music you can import with XML
Music_adress=["Http://www.klstudio.com/media/music07.mp3 "," Http://www.klstudio.com/media/music06.mp3 "," H "target= "_blank" >
Http://www.klstudio.com/media/music07.mp3 "," Http://www.klstudio.com/media/music06.mp3",
"Http://www.klstudio.com/media/music17.mp3 "," Http://www.klstudio.com/media/200492011225.mp3",
"Http://www.klstudio.com/media/Nelly_Dilemma.mp3 "," Http://www.klstudio.com/media/music08.mp 'target= "_blank" >
Http://www.klstudio.com/media/Nelly_Dilemma.mp3 "," Http://www.klstudio.com/media/music08.mp3",
"Http://www.klstudio.com/media/music09.mp3 "," Http://www.klstudio.com/media/music10.mp3 'target= "_blank" >
Http://www.klstudio.com/media/music09.mp3 "," Http://www.klstudio.com/media/music10.mp3",
"Http://www.klstudio.com/media/music11.mp3 "," Http://www.klstudio.com/media/music12.mp3 "," http "target= "_blank" >
Http://www.klstudio.com/media/music11.mp3 "," Http://www.klstudio.com/media/music12.mp3",
"Http://www.klstudio.com/media/music13.mp3 "," Http://www.klstudio.com/media/music01.mp3 "," http "target= "_blank" >
Http://www.klstudio.com/media/music01.mp3 "," Http://www.klstudio.com/media/music02.mp3",
"Http://www.klstudio.com/media/music03.mp3 "," http://w 'target= "_blank" >
Http://www.klstudio.com/media/music03.mp3 "," Http://www.klstudio.com/media/music04.mp3",
"Http://www.klstudio.com/media/music05.mp3 "," http://www 'target= "_blank" >
Http://www.klstudio.com/media/music05.mp3 "," http://www.flashk3.com/2004/music99/workgroups/Rong Wang-I'm not Huang Rong mp3.
,"http://www.flashk3.com/2004/music99/workgroups/Kelly-Hope (great Long Present). mp3 ",
"http://www.flashk3.com/2004/music99/Classic recommendation/Old wolf-you at the same table. mp3 ",
"http://www.flashk3.com/2004/music99/Classic recommendation/Linyilian-When Love has become the past. mp3 "];
music_title=["Shabaoliang-Dark Incense", "Leong-Courage", "Zhou-Dusk", "Yang Xen-Mouse Love Rice", "Nelly-dilemma Ft Kelly Rowland",
"Richarmax-This is for you", "Laussaire-love You in Your Heart", "Kaka-Yesterday reappears", "Eagles-Hotel California",
"Phil Collins-Another Day in Heaven", "pillar of the pillars--when you're alone, who do you think of," Sarah Brightman-Scarborough Fair,
"Tang-Lilac", "Summer spring-the equator and the Arctic", "JJ Lin-Jiangnan", "Faye Wong-Pawn", "Rong Wang-I am not Huang Rong",
"Kelly-Hope (long Present)", "Old Wolf-the same table you", "Linyilian-When Love has become the past"];
First say the use of asfunction;
Asfunction
Availability of
Flash Player 5.

Usage
Asfunction:function, "parameter."

Parameters
The identifier of the function functions.

Parameter the string you want to pass to the function specified in your function parameter.

Return
No.

Description
Protocol; A special protocol for URLs in HTML text fields. In an HTML text field, you can use the HTML A label hyperlink

Text. The HREF attribute of a label contains URLs that can be used for standard protocols such as HTTP, HTTPS, or FTP. Asfunction protocol

is a Flash-specific additional protocol that enables links to invoke action script functions.

Example
In this example, the MyFunc () function is defined in the first three lines of the code. TextField object MyTextField with HTML text fields

Associated. Text "Click me!" is a hyperlink in the Text field. When the user clicks the hyperlink, the MyFunc () function is called:

function MyFunc (ARG) {
Trace ("You clicked me! Argument was "+arg);
}
Mytextfield.htmltext = "<a href=\" asfunction:myfunc,foo \ ">click me!</a>";

After you click the hyperlink, the following results are displayed in the output panel:
You clicked me! Parameter was Foo

Put it in the first chastity.
Author: Yuheduo
Email:yuheduo@21cn.com
Blog:http://yuheduo.5dblog.com
2005-11-1
var total=music_title.length-1;
var pagenum=5;//number per page
var pages=math.floor (total/pagenum) +1;//pages
var page=0;//the first few pages
_global.music_id;
function MyFunction (ID) {
Trace ("Output:" +id);
var num2=id-page*pagenum+1;
Trace ("num2=" +num2+ "former page=" +page);
if (num2>pagenum) {
page++;
num2-=5;
Intxt (page);
Trace ("Post page=" +page);
}
for (Var i=1;i<=pagenum;i++) {//display color in that one. Add color to show, Haha, there is a bit to improve the ground
Side, you find it, please help me correct, we have made progress together.
if (i!=num2) {
Mcall["MC" +I].TXT.BACKGROUND=FALSE;
}else{
Mcall["MC" +i].txt.background=true;
Mcall["MC" +i].txt.backgroundcolor= "0xff0000";
};
}
_global.music_id=id;
var url=music_adress[id];
With (mycontrol) {
Associatedisplay (Mydisplay);
Activeplaycontrol=false;
Autoplay=true;
Controllerpolicy= "on";
Backgroundstyle = "None";
volume=100;
}
With (Mydisplay) {
Stop ()
Setmedia (URL, "MP3");
Play ();
volume=100;
}
}
var mcall:movieclip=this.createemptymovieclip ("McAll", 10);
mcall._x=45;
mcall._y=40;
adding MC to McAll
for (Var i=1;i<=pagenum+1;i++) {
var T=mcall.attachmovie ("0", "MC" +i,i);
T.txt.selectable=false;
t._x=0;
t._y=i*19;
}
function Intxt (page) {
for (Var i=1;i<=pagenum;i++) {
Mcall["MC" +i].txt.html=true;
Mcall["MC" +i].txt.htmltext= "<a
Href= ' Asfunction:_root.myfunction, +music_adress[(i+page*pagenum-1)]+ "' >" + (i+page*pagenum)
+"." +music_title[(i+page*pagenum-1)]+ "</A>";
Mcall["MC" +i].txt.htmltext= "<a href= ' asfunction:_root.myfunction," +
(i+page*pagenum-1) + "' >" + (i+page*pagenum) + "." +music_title[(i+page*pagenum-1)]+ "</A>";
}
Mcall.mc6.txt.html=true;
mcall.mc6.txt.htmltext= "<a href= ' asfunction:_root.prevpage ' > Prev
</A> "+" ________________________ "+" <a href= ' Asfunction:_root.nextpage ' > Next </A> ";
}
Intxt (page);
function NextPage () {
page++;
Trace ("page=" +page);
if (page> (pages-1)) page=0;
Intxt (page);
}
function PrevPage () {
page--;
Trace ("page=" +page);
if (page<0) page=pages-1;;
Intxt (page);
}
var mydlistener = new Object ()//The last, put down a song
Mydlistener.complete = function () {
Trace ("Put to the Last");
_global.music_id++;
if (_global.music_id>total) {
_global.music_id=0;
page=0;
Intxt (page);
}
MyFunction (_global.music_id);
MyFunction (_global.music_id);
};
Mydisplay.addeventlistener ("complete", Mydlistener);
Use of the window component
Import Mx.containers.Window;
Import Mx.managers.PopUpManager;
Myhelp.html=true;
myhelp.htmltext= "<a href= ' asfunction:w ' > Tutorial </a>";
function W () {
Myw=new Object ();
Myw=popupmanager.createpopup (_root,window,true);
Myw.contentpath= "YHD";
Myw.closebutton=true;
Myw.title= ": Tutorial:";
var comobj=new Object ();
Comobj.complete=function () {//applicable to the size of the imported MC
Myw.setsize (myw.content._width+6,myw.content._height+34);
Myw.move ((stage.width-myw.width)/2, (Stage.height-myw.height)/2);
};
Comobj.click=function () {//Close button Event
Myw.deletepopup ();
}
Myw.addeventlistener ("complete", comobj);
Myw.addeventlistener ("click", Comobj);
}//end of W ();
The following is your own, you can modify into your things ah, haha!!
function Metext () {
GetURL ("http://yuheduo.5dblog.com", "_blank/' target=" _blank ">http://yuheduo.5dblog.com", "_blank");
GetURL ("mailto:yuheduo@21cn.com", "POST");
}
My.html=true;
my.autosize= "center";
My.background=true;
My.selectable=false;
My.backgroundcolor= "0XCCCCC";
My.border=true;
my.htmltext= "<a href= ' asfunction:metext ' > Knife exercises </a>";
Finished the

I feel that the code is too messy, have time to tidy up, haha, I hope netizens can also learn a little things



Related Article

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.