Mailing List
Home
Forum Home
Flash Pro
Subjects
Firework Effect
setInterval bug identified and fixed
setInterval bug identified and fixed
ScrollPane component doesn 't auto update
Help: MX 2004 How to script a print button to print the entire sli
Event Dispatcher between classes
memory management removeMovieClip /
MX2004 Dataset itemClassName
Order of events per frame
XML to Object help
Textfield prototype question
Flash and QuickTime VR
Reading and displaying RSS feeds in Flash MX
Flash MX 2004 Sucks
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash Interface with 10mb xml file
Web Service Results
Listener Object 's best practice
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Asfunction and MP3 Player

Asfunction and MP3 Player

2005-11-11       - By Jonathan Berry

 Back
Hello all, I am using the following script to parse an xml file for an
MP3 player. I use asfunction to play the song clicked on, but don't
know how to keep track of the node being played in order that I can use
next and previous song buttons. Is there a way to do this with my
current script?

var group:XML = new XML();
group.ignoreWhite = true;
group.onLoad = function(){
    var doc:String = new String();
    for(i=0; i<group.firstChild.childNodes.length; i++){
         var icon = "<img src=\'" +
group.firstChild.childNodes[i].attributes.iconurl + "\' width=\'50\'
height=\'50\' align=\'right\'>";
         var band = "<span class=\'band\'>" +
group.firstChild.childNodes[i].attributes.name + "</span><br>";
         doc += icon;
         doc += band;
         for(j=0; j<group.firstChild.childNodes[i].childNodes.length; j++){
              var album = "<span class=\'album\'>" +
group.firstChild.childNodes[i].childNodes[j].attributes.name +
"</span><br>";
              doc += "From the album: " + album;
              for(k=0;
k<group.firstChild.childNodes[i].childNodes[j].childNodes.length;
k++){
                   var song = "<a href=\'asfunction:playSong," +
group.firstChild.childNodes[i].childNodes[j].childNodes[k].attributes.url
+ "\'>" + group.firstChild.childNodes[i].childNodes[j].childNodes[k].attributes
.name
+ "</a><br>";
                   doc += song;
              }
         }
         doc += "<br><br>";
    }
    with(output_txt){
         background = false;
         password = false;
         multiline = true;
         wordWrap = true;
         html = true;
         variable = null;
         maxChars = null;
         scroll = 1;
    }
    var myCSS = new TextField.StyleSheet();
    var cssURL = "mp3player.css";
    output_txt.styleSheet = myCSS;
    myCSS.load(cssURL);
    output_txt.htmlText = doc;
}

Thanks for the help in advance.



--
Jonathan Berry, M.A.
IT Consultant
619.306.1712(m)
jcharlesberry@(protected)
www.mindarc.com <http://www.mindarc.com>

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------

This E-mail is covered by the Electronic Communications Privacy Act, 18
U.S.C. ?? 2510-2521 and is legally privileged.
This information is confidential information and is intended only for
the use of the individual or entity named above. If the reader of this
message is not the intended recipient, you are hereby notified that any
dissemination, distribution or copying of this communication is strictly
prohibited.

-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------


[Non-text portions of this message have been removed]



-- ---- ---- ---- ------ Yahoo! Groups Sponsor -- ---- ---- ---- --~-->
Get Bzzzy! (real tools to help you find a job). Welcome to the Sweet Life.
http://us.click.yahoo.com/A77XvD/vlQLAA/TtwFAA/IHFolB/TM
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----~->

=========================
Pro_Flash: Professional Web Developers Using Macromedia Flash
To subscribe: mailto:pro_flash-subscribe@(protected)
To UNSUBSCRIBE: mailto:pro_flash-unsubscribe@(protected)

Yahoo! Groups Links

<*> To visit your group on the web, go to:
   http://groups.yahoo.com/group/pro_flash/

<*> To unsubscribe from this group, send an email to:
   pro_flash-unsubscribe@(protected)

<*> Your use of Yahoo! Groups is subject to:
   http://docs.yahoo.com/info/terms/




Earn $52 per hosting referral at Lunarpages.