Hi,
I am trying to hack this mp3 player so that it displays 3 levels of hierarchy instead of 2. Check out the current player here http://www.yanwhite.co m/staging/GetGoodMusic/music.htm
Currently it has kind of 3 levels, but using 2 buttons for the top level.
I want all 3 as list boxes. So that listbox1 has main categories, listbox2 displays subcategories and listbox3 displays the tracks.
Here is the actionscript..
//setting it up
//change path to your own
path = "http://billwatson2.no-ip.info/public/flash/music/";
loadBB.setLabel ("By Mood");
loadB.setLabel( "By Genre");
pause.setLabel( "Pause");
playB.setLabel( "Play");
pause.setEnable d(false);
playB.setEnable d(false);
//constucting menu system
//next few functions just allow 1 listbox to chat to the other
function Labels() {
this.lab = new Array(0);
this.dat = new Array(0);
}
Labels.prototyp e.addLabel = function(name, value) {
this.lab.push(n ame);
this.dat.push(v alue);
};
Labels.prototyp e.change = function(obj) {
var i;
obj.removeAll() ;
for (i=0; i<this.dat.leng th; i++) {
obj.addItem(thi s.lab[i], this.dat[i]);
}
obj.setScrollPo sition(0);
};
FlistBoxClass.p rototype.change Labels = function() {
this.getValue() .change(this.su b);
};
FlistBoxClass.p rototype.setSub Menu = function(sub, label, x, y) {
label.change(th is);
this.sub = sub;
this.setChangeH andler("changeL abels", this);
this.setSubInde x(x, y);
};
FlistBoxClass.p rototype.setSub Index = function(x, y) {
this.setSelecte dIndex(x);
this.sub.setSel ectedIndex(y);
};
//change what you like here to add your own artists and songs
//just make sure the title of the song is the same as the name of the mp3
//eg for myGreatSong.mp3 add the title as myGreatSong
//the data being added to the listbox is for demonstration only as no use is made of it
menu = new Labels();
menu.addLabel(" Dire Straits", submenu=new Labels());
submenu.addLabe l("Sultans of Swing", 1);
submenu.addLabe l("Money for Nothing", 2);
submenu.addLabe l("Romeo and Juliet", 3);
submenu.addLabe l("Telegraph Road", 4);
submenu.addLabe l("I Want my MTV", 4);
menu.addLabel(" Eagles", submenu=new Labels());
submenu.addLabe l("Desperado" , 1);
submenu.addLabe l("Hotel California - Unplugged", 2);
submenu.addLabe l("Lying Eyes", 3);
submenu.addLabe l("New Kid In Town", 4);
submenu.addLabe l("On the Border - Already Gone", 5);
submenu.addLabe l("Take It To The Limit", 6);
submenu.addLabe l("Peaceful, Easy Feeling", 7);
submenu.addLabe l("Take it Easy", 8);
submenu.addLabe l("Tequila Sunrise", 9);
menu.addLabel(" The Beatles", submenu=new Labels());
submenu.addLabe l("Come Together", 1);
submenu.addLabe l("Here Comes the Sun", 2);
submenu.addLabe l("Hey Jude", 3);
submenu.addLabe l("Lady Madonna", 4);
submenu.addLabe l("Lucy In the Sky With Diamonds", 5);
submenu.addLabe l("Maxwell's Silver Hammer", 6);
submenu.addLabe l("Octopus's Garden", 7);
submenu.addLabe l("Revolution 1", 8);
submenu.addLabe l("While My Guitar Gently Weeps", 9);
menu.addLabel(" Bob Marley", submenu=new Labels());
submenu.addLabe l("No Woman No Cry", 1);
submenu.addLabe l("Jammin", 2);
submenu.addLabe l("Exodus", 3);
menu.addLabel(" Bob Dylan", submenu=new Labels());
submenu.addLabe l("Like A Rolling Stone", 1);
submenu.addLabe l("Mr Tamborine Man", 2);
menu.addLabel(" Rolling Stones", submenu=new Labels());
submenu.addLabe l("Wild Horses", 2);
menu2 = new Labels();
menu2.addLabel( "Dire Straits", submenu=new Labels());
submenu.addLabe l("Sultans of Swing", 1);
submenu.addLabe l("Money for Nothing", 2);
submenu.addLabe l("Romeo and Juliet", 3);
//formatting buttons and listboxes....ch ange to suit
aformat = new FStyleFormat();
aformat.textSiz e = 12;
aformat.textCol or = 0xffff00;
aformat.textBol d = false;
aformat.textUnd erline = false;
aformat.textFon t = "Arial";
aformat.face = 0x000000;
aformat.arrow = 0xffffff;
aformat.highlig ht = 0x0000ff;
aformat.highlig ht3D = 0x0000ff;
aformat.darksha dow = 0x0000ff;
aformat.shadow = 0x0000ff;
aformat.backgro und = 0x123456;
aformat.selecti on = 0xffffff;
aformat.selecti onUnfocused = 0xff0000;
aformat.textSel ected = 0x0000ff;
aformat.applyCh anges();
aformat.addList ener(playB, pause, loadB, loadBB, artists, titles);
//titles list box handler
titles.setChang eHandler("plays ongs");
function playsongs() {
s.stop();
delete s;
playB.setEnable d(true);
playB.setLabel( "Play");
pause.setLabel( "Pause");
pause.setEnable d(false);
loadB.setEnable d(true);
loadB2.setEnabl ed(true);
loaded = true;
paused = false;
}
//code for buttons
loadB.onRelease = function() {
artists.setSubM enu(titles, menu, 0, 0);
};
loadBB.onReleas e = function() {
artists.setSubM enu(titles, menu2, 0, 0);
};
playB.onRelease = function() {
if (loaded) {
theSong = path+titles.get SelectedItem(). label+".mp3";
s = new Sound(this);
s.loadSound(the Song, true);
s.setVolume(vol Slide._x - 230);
s.start(0,1);
playB.setLabel( "Stop");
pause.setEnable d(true);
} else {
s.stop();
pause.setEnable d(false);
playB.setLabel( "Start Again");
}
loaded = !loaded;
};
pause.onRelease = function() {
if (!paused) {
s.stop();
playB.setEnable d(false);
stopped = s.position/1000;
this.setLabel(" Continue");
} else {
this.setLabel(" Pause");
s.start(stopped ,1);
playB.setEnable d(true);
}
paused = !paused;
};
volSlide.onPres s = function() {
volSlide.startD rag(true, 242, 274, 342, 274);
volSlide.onEnte rFrame = function() {
s.setVolume(vol slide._x - 242);
};
};
volSlide.onRoll Out = volslide.onRele ase = volslide.onRele aseOutside = function() {
stopDrag();
};
panSlide.onPres s = function() {
panSlide.startD rag(true, 431, 274, 531, 274);
panSlide.onEnte rFrame = function() {
s.setPan(pansli de._x - 431);
};
};
panSlide.onRoll Out = panslide.onRele ase = panslide.onRele aseOutside = function() {
stopDrag();
};
2 1967 kestrel 1,071
Recognized Expert Top Contributor
Im sorry, but i can't solve this problem for you. Do you have any specific problems with a small portion of code?
[quote=waterox]Hi,
I am trying to hack this mp3 player so that it displays 3 levels of hierarchy instead of 2. Check out the current player here http://www.yanwhite.co m/staging/GetGoodMusic/music.htm
Currently it has kind of 3 levels, but using 2 buttons for the top level.
I want all 3 as list boxes. So that listbox1 has main categories, listbox2 displays subcategories and listbox3 displays the tracks.
Oops I forgot to post the right page up.. the player is now there at http://www.yanwhite.co m/staging/GetGoodMusic/music.htm
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Brian Murphy |
last post by:
<?php
/*
I need your help. I'd be very thankfull if write me this script.I
need a script that displays a list of categories and subcategories
like this:
<select name="category">
<option value="1">Main</option>
<option value="2">Main > Computers</option>
<option value="4">Main > Computers > Hardware </option>
|
by: Travis Pupkin |
last post by:
Hey,
I've done a number of product catalogs/galleries with one or two
category levels (Category > Subcategory). The straightforward way to do
this, of course, is to use database fields for Category and Subcategory
and query off of those fields.
I have a client now who is interested in what sounds to me to be an
unnecessarily complex catalog with an as of yet undefined number of
category levels at their disposal.
|
by: Rich Protzel |
last post by:
Hello,
So my table contains say 100,000 records, and I need to group the
categories in fld1 by the highest count of subcategories. Say fld1
contains categories A, B, C, D, E.
All of these categories contain subcategories AA, AB, AC, AD,...AJ, BA,
BB...BJ, CA, CB, CC...CJ, etc in fld2.
I am counting how many subcategories are listed for each category. Like
|
by: shane-dated-1130371478.43db8f |
last post by:
Hello all,
I am working on a website for a bookstore and have run into a bit of a snag.
I am trying to write a form where an admin can set the category for a book.
However, categories can be of an arbitrary depth so I need something which
resembles a windows "tree view." For example:
Primary category Art and Architecture
has subcategory history
has subcategory African etc etc.
|
by: Paul Hendryx |
last post by:
I have the table structure:
CREATE TABLE . (
IDENTITY (1, 1) NOT NULL ,
NOT NULL ,
NULL ,
(50) COLLATE SQL_Latin1_General_CP1_CI_AS
NOT NULL
) ON
GO
| |
by: Luis Esteban Valencia |
last post by:
have a problem and I'm not sure how to handle/fix it.
I have three listboxes on my page. The first listbox has a list of software
products. When you select an item in the Products listbox, then the two
other listboxes fill up with choices, one has related versions of that
product, and the other has related Categories. Pretty typical stuff.
Anyway, when I first designed the page, I used ASP.NET code to fill the
values of the Version and...
|
by: vinayg |
last post by:
how can i search subcategory wise for a particular category,i want to display items.suppose user selected a particular category.I want to display all items in that category + its subcategories.
this is my table structure with 3 tables.
i need a sql query
http://www.ukrate.com/db.jpg
|
by: gcoaster |
last post by:
Hello Everyone!
I have a question regarding "cascading combobox(s) list(s)"
I would like:
ComboBox 2 to show results from ComboBox 1's selection,
then ComboBox 4 to show results from ComboBox 3's choice
For Instance these are the combo boxes
|
by: theS70RM |
last post by:
Hi, I have a table thats laid out something like the following....
cat_id, cat_name, cat_parent
1 furniture null
2 electrical null
3 tvs 2
4 desks 1
5 corner desks 4
6 sony tvs 3
7 wardrobe 1so categories are all stored in one table with sub categories. Then I have another table with lots of items that belong to any one of the categories i.e. "my...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |