mp3 player with 3 listboxes and category/subcategory

This is a discussion on "mp3 player with 3 listboxes and category/subcategory" within the Flash & Multimedia Forum section. This forum, and the thread "mp3 player with 3 listboxes and category/subcategory are both part of the Design Your Website category.


 Subscribe in a reader

Go Back   Webforumz.com > Main Forums > Design Your Website > Flash & Multimedia Forum

Notices




Reply
 
LinkBack Thread Tools
  #1  
Old Jun 26th, 2007, 20:36
New Member
Join Date: Dec 2006
Location: UK
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
mp3 player with 3 listboxes and category/subcategory

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.com/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..

Code: Select all
 
//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.setEnabled(false);
playB.setEnabled(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.prototype.addLabel = function(name, value) {
this.lab.push(name);
this.dat.push(value);
};
Labels.prototype.change = function(obj) {
var i;
obj.removeAll();
for (i=0; i<this.dat.length; i++) {
obj.addItem(this.lab[i], this.dat[i]);
}
obj.setScrollPosition(0);
};
FlistBoxClass.prototype.changeLabels = function() {
this.getValue().change(this.sub);
};
FlistBoxClass.prototype.setSubMenu = function(sub, label, x, y) {
label.change(this);
this.sub = sub;
this.setChangeHandler("changeLabels", this);
this.setSubIndex(x, y);
};
FlistBoxClass.prototype.setSubIndex = function(x, y) {
this.setSelectedIndex(x);
this.sub.setSelectedIndex(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.addLabel("Sultans of Swing", 1);
submenu.addLabel("Money for Nothing", 2);
submenu.addLabel("Romeo and Juliet", 3);
submenu.addLabel("Telegraph Road", 4);
submenu.addLabel("I Want my MTV", 4);
menu.addLabel("Eagles", submenu=new Labels());
submenu.addLabel("Desperado", 1);
submenu.addLabel("Hotel California - Unplugged", 2);
submenu.addLabel("Lying Eyes", 3);
submenu.addLabel("New Kid In Town", 4);
submenu.addLabel("On the Border - Already Gone", 5);
submenu.addLabel("Take It To The Limit", 6);
submenu.addLabel("Peaceful, Easy Feeling", 7);
submenu.addLabel("Take it Easy", 8);
submenu.addLabel("Tequila Sunrise", 9);
menu.addLabel("The Beatles", submenu=new Labels());
submenu.addLabel("Come Together", 1);
submenu.addLabel("Here Comes the Sun", 2);
submenu.addLabel("Hey Jude", 3);
submenu.addLabel("Lady Madonna", 4);
submenu.addLabel("Lucy In the Sky With Diamonds", 5);
submenu.addLabel("Maxwell's Silver Hammer", 6);
submenu.addLabel("Octopus's Garden", 7);
submenu.addLabel("Revolution 1", 8);
submenu.addLabel("While My Guitar Gently Weeps", 9);
menu.addLabel("Bob Marley", submenu=new Labels());
submenu.addLabel("No Woman No Cry", 1);
submenu.addLabel("Jammin", 2);
submenu.addLabel("Exodus", 3);
menu.addLabel("Bob Dylan", submenu=new Labels());
submenu.addLabel("Like A Rolling Stone", 1);
submenu.addLabel("Mr Tamborine Man", 2);
menu.addLabel("Rolling Stones", submenu=new Labels());
submenu.addLabel("Wild Horses", 2);
menu2 = new Labels();
menu2.addLabel("Dire Straits", submenu=new Labels());
submenu.addLabel("Sultans of Swing", 1);
submenu.addLabel("Money for Nothing", 2);
submenu.addLabel("Romeo and Juliet", 3);
//formatting buttons and listboxes....change to suit
aformat = new FStyleFormat();
aformat.textSize = 12;
aformat.textColor = 0xffff00;
aformat.textBold = false;
aformat.textUnderline = false;
aformat.textFont = "Arial";
aformat.face = 0x000000;
aformat.arrow = 0xffffff;
aformat.highlight = 0x0000ff;
aformat.highlight3D = 0x0000ff;
aformat.darkshadow = 0x0000ff;
aformat.shadow = 0x0000ff;
aformat.background = 0x123456;
aformat.selection = 0xffffff;
aformat.selectionUnfocused = 0xff0000;
aformat.textSelected = 0x0000ff;
aformat.applyChanges();
aformat.addListener(playB, pause, loadB, loadBB, artists, titles);
//titles list box handler
titles.setChangeHandler("playsongs");
function playsongs() {
s.stop();
delete s;
playB.setEnabled(true);
playB.setLabel("Play");
pause.setLabel("Pause");
pause.setEnabled(false);
loadB.setEnabled(true);
loadB2.setEnabled(true);
loaded = true;
paused = false;
}
//code for buttons
loadB.onRelease = function() {
artists.setSubMenu(titles, menu, 0, 0);
};
loadBB.onRelease = function() {
artists.setSubMenu(titles, menu2, 0, 0);
};
playB.onRelease = function() {
if (loaded) {
theSong = path+titles.getSelectedItem().label+".mp3";
s = new Sound(this);
s.loadSound(theSong, true);
s.setVolume(volSlide._x - 230);
s.start(0,1);
playB.setLabel("Stop");
pause.setEnabled(true);
} else {
s.stop();
pause.setEnabled(false);
playB.setLabel("Start Again");
}
loaded = !loaded;
};
pause.onRelease = function() {
if (!paused) {
s.stop();
playB.setEnabled(false);
stopped = s.position/1000;
this.setLabel("Continue");
} else {
this.setLabel("Pause");
s.start(stopped,1);
playB.setEnabled(true);
}
paused = !paused;
};
volSlide.onPress = function() {
volSlide.startDrag(true, 242, 274, 342, 274);
volSlide.onEnterFrame = function() {
s.setVolume(volslide._x - 242);
};
};
volSlide.onRollOut = volslide.onRelease = volslide.onReleaseOutside = function() {
stopDrag();
};
panSlide.onPress = function() {
panSlide.startDrag(true, 431, 274, 531, 274);
panSlide.onEnterFrame = function() {
s.setPan(panslide._x - 431);
};
};
panSlide.onRollOut = panslide.onRelease = panslide.onReleaseOutside = function() {
stopDrag();
};

Last edited by Sgaspar11; Jun 27th, 2007 at 15:29. Reason: formatting
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote

  #2  
Old Jun 26th, 2007, 20:54
Multimedia Specialist
Join Date: Apr 2007
Location: Arizona
Age: 25
Posts: 666
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: mp3 player with 3 listboxes and category/subcategory

Whoops, just a second.

I think I am going to need to see the flash file to be any help at all though, but you should just be able to copy the code that creates and fills the text boxes as many times as you want.
Last Blog Entry: Yay!? (Oct 8th, 2007)

Last edited by Sgaspar11; Jun 26th, 2007 at 20:57. Reason: mis-read post!
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #3  
Old Jun 27th, 2007, 06:14
New Member
Join Date: Dec 2006
Location: UK
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Re: mp3 player with 3 listboxes and category/subcategory

Hm I tried that.
However my actionscripting is not all that great |)
The fla is here
yanwhite.com/staging/GetGoodMusic/mp3player.zip though the only extra thing I could see in there was instance names of listboxes and buttons.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
  #4  
Old Jun 27th, 2007, 15:28
Multimedia Specialist
Join Date: Apr 2007
Location: Arizona
Age: 25
Posts: 666
Blog Entries: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Re: mp3 player with 3 listboxes and category/subcategory

Yeah it looks like the dynamic test fields with instance names are probably: Menu, Menu2 right?

I see that right there in the AS.

Create another one called Menu3 (and a dynamic text field or MC with an instance name of Menu3) and use the AS just like it does for the others...leave the content the same just to test it out to see if it prefils, then change the content as needed.

Cheers,

Scott
Last Blog Entry: Yay!? (Oct 8th, 2007)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Spurl this Post!Reddit! Wong this Post!
Reply With Quote
Reply

Tags
subcategory, player, mp3, listboxes, category

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
ColdFusion - Using listboxes - Need Help! Keeldog Other Programming Languages 1 Apr 18th, 2008 05:27
Category/Tutorial System Help Aaron1988 PHP Forum 9 Jan 26th, 2008 14:29
help needed for Moving elements across multiple listboxes smkannan JavaScript Forum 0 Nov 13th, 2007 06:53
new category? alexgeek Webforumz Suggestions and Feedback 3 Sep 26th, 2007 17:28
Nightmare product/Category structure D3mon Databases 2 May 5th, 2005 16:39


All times are GMT. The time now is 03:34.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42