ninjakyle Posted August 13, 2005 Posted August 13, 2005 Anyone know a nice template or easy way to set up one of these cute flash players? example: [url="http://www.micahdalton.com/home.html"]http://www.micahdalton.com/home.html[/url]http://www.micahdalton.com/home.html [url="http://www.cliffritcheymusic.com/"]http://www.cliffritcheymusic.com/[/url]http://www.cliffritcheymusic.com/ [url="http://www.nathanimpellizzeri.com/"]http://www.nathanimpellizzeri.com/[/url]http://www.nathanimpellizzeri.com/ the list goes on . . . I can manage my way around dreamweaver and flash but don't know where to start with these thanks for the tips (in advance
ninjakyle Posted August 13, 2005 Author Posted August 13, 2005 maybe i should have done my research first looks like this question comes up often hey mc, i am going to give this one a try [url="http://forum.powweb.com/showthread.php?t=50438"]link here[/url] suggestions still welcome
ninjakyle Posted August 13, 2005 Author Posted August 13, 2005 actually, that stuff is cwap still searching
MC Just Posted August 13, 2005 Posted August 13, 2005 i dont even know where to start with creating a flash audio player, ive tried so many times i just cant get it right...
ryanmeyersmusic Posted August 14, 2005 Posted August 14, 2005 i'd be glad to share the source from the one on my page: [url="http://www.ryanmeyers.com/wordpress/archives/2004/08/10/42/learning-to-dream"]http://www.ryanmeyers.com/wordpress/archiv...arning-to-dream[/url]
MC Just Posted August 14, 2005 Posted August 14, 2005 [quote name='ryanmeyersmusic' date='Aug 13 2005, 07:21 PM']i'd be glad to share the source from the one on my page: [url="http://www.ryanmeyers.com/wordpress/archives/2004/08/10/42/learning-to-dream"]http://www.ryanmeyers.com/wordpress/archiv...arning-to-dream[/url] [right][snapback]684394[/snapback][/right] [/quote] thats a cool radio!!
ryanmeyersmusic Posted August 14, 2005 Posted August 14, 2005 thanks, bro. i spent way too much time writing that code to be the only one using it. i'll post the source fla in a minute
ryanmeyersmusic Posted August 14, 2005 Posted August 14, 2005 [url="http://www.ryanmeyers.com/radio/MP3Player.fla"]http://www.ryanmeyers.com/radio/MP3Player.fla[/url] Find all the comments in the action script, I just commented it in about 3 minutes, so if somtehing's missing, let me know and I'll try to clarify it. Make sure you edit the backwards and forwards actions as well (they're nested in the group, so you'll have to double click the buttons group, then click on the buttons individually to access their actionscript.).
ryanmeyersmusic Posted August 14, 2005 Posted August 14, 2005 now that i think about it, i could probably make it much fewer edits if you give me about 10 minutes...
MC Just Posted August 14, 2005 Posted August 14, 2005 [quote name='ryanmeyersmusic' date='Aug 13 2005, 07:46 PM']now that i think about it, i could probably make it much fewer edits if you give me about 10 minutes... [right][snapback]684410[/snapback][/right] [/quote] cool!!!
ninjakyle Posted August 14, 2005 Author Posted August 14, 2005 that is sweet man i just figured you had someone else do all that jazz it looks good ryan (off topic) where did you record?
ryanmeyersmusic Posted August 14, 2005 Posted August 14, 2005 ok, download the source file now. The first four variables should be all you have to change. let me know if you run into any problems.
ninjakyle Posted August 14, 2005 Author Posted August 14, 2005 for some reason i can't open it in flash says it is an unexpected format . . . perhaps i just caught it off guard. . . maybe if I wait a little bit, give it some advance notice . . . then it will be expected
ryanmeyersmusic Posted August 14, 2005 Posted August 14, 2005 i just re-upped it as a binary file, hopefully that will fix it. i just downloaded it and it worked ok on my pc. it was created in flash mx (2004)
ninjakyle Posted August 14, 2005 Author Posted August 14, 2005 man i still can't open it got mx dont know whats up but thanks for trying if you have any other ideas, i am game for trying
ryanmeyersmusic Posted August 14, 2005 Posted August 14, 2005 i guess i can write a quick step-by-step... gimme a minute...
ryanmeyersmusic Posted August 14, 2005 Posted August 14, 2005 OK, here's how to make a flash player... Layer Setup[list] [*]Create a Layer, label it "Labels" [*]Create a layer, label it "Actions" [*]Create a layer, label it "Components" [*]Create a layer, label it "Sound" [/list] Button Creation[list] [*]Create a button, label it "Pause" [*]Create a button, label it "Play" [*]Create a button, label it "Back" [*]Create a button, label it "Forward" [/list] Setup "Labels" layer[list] [*]Insert a Keyframe on frame 10, label it "Playing" [*]Insert a Keyframe on frame 25 [/list] Setup "Actions" layer[list] [*]Insert a Keyframe on frame 2 [*]Insert a Keyframe on frame 10 [*]Insert a Keyframe on frame 11 [*]Insert a Keyframe on frame 25 [/list] Setup "Components" layer[list] [*]Insert a Keyframe on frame 25 [/list] Setup "Sound" layer[list] [*]Insert a Keyframe on frame 25 [/list] Set up text box[list] [*]Create a text box on frame 1 of "Components" layer [*]In Properties, set Text type to "Dynamic Text" [*]In Properties, set Line type to "Single Line" [*]In Properties, set Variable to "showme" [*]Format with whatever font, color, alignment, etc that you desire [/list] Set up buttons[list] [*]Drag the "Pause", "Play", "Back", and "Forward" buttons onto frame 1 of "Components" layer [*]When they're set up the way you want them, group them together [/list] Assigning Actions[list] [*]On frame 1 of "Actions" layer, copy the following ActionScript: [/list][code] // VARIABLES // number_of_tracks :: the total number of songs for your player // first_song :: the track number of the first song to play, use 0 for random // songs :: a list of the web addresses of each song, in order, seperated by commas // titles :: a list of the titles of each song, in order, seperated by commas number_of_tracks = 11; first_song = 0; songs = ["http://www.yoursite.com/path/to//01.mp3", "http://www.yoursite.com/path/to/02.mp3", "http://www.yoursite.com/path/to/03.mp3", "http://www.yoursite.com/path/to/04.mp3", "http://www.yoursite.com/path/to/05.mp3", "http://www.yoursite.com/path/to/06.mp3", "http://www.yoursite.com/path/to/07.mp3", "http://www.yoursite.com/path/to/08.mp3", "http://www.yoursite.com/path/to/09.mp3", "http://www.yoursite.com/path/to/10.mp3", "http://www.yoursite.com/path/to/11.mp3"]; titles = ["Sometimes in Silence", "Invisible People", "Broken", "This Road", "Walk Away", "This Moment Forever", "Picturebox", "Learning to Dream", "Traveling Song", "Tell Me Tyler", "Lose it All"]; // NO NEED TO EDIT PAST THIS POINT! first_song = first_song + 1; first_song_minus_two = first_song - 2; if(first_song_minus_two == 0) first_song_minus_two = number_of_tracks; if(first_song_minus_two == -1) first_song_minus_two = Math.round(Math.random()*(number_of_tracks-1))+1; if(src eq ''){src=first_song_minus_two;} number_of_tracks_plus_one = number_of_tracks + 1; source = songs[src]; loadherup = 1; stTime = ""; startOffX = 0; isOn._visible = 1; isStop._visible = 1; isOn._alpha = 40; isStop._alpha = 100; shizcnt = 0; title = srcs[srcs.length - 1]; stTime = getTimer(); s = new Sound(this); if (source == "") { source = "No file found"; unloadMovie(this); } // end if [/code] [list] [*]On frame 2 of "Actions" layer, copy the following ActionScript: [/list][code] isOn._visible = 1; isStop._visible = 0; if (loadNot == "") { s.loadSound(source, true); songname = titles[src]; loadNot = "y"; } // end if s.start(startOffX, 1); gotoAndPlay(10); autoStart = "yes"; [/code] [list] [*]On frame 10 of "Actions" layer, copy the following ActionScript: [/list][code] if(_level0.showme == " (LOADING)") { // Action script... s.stop(); stop(); //src = Number(src) + 1; if (src == number_of_tracks) { src = 0; } // end if loadNot = ""; gotoAndPlay(1); } function formatTime(inSecs) { myTtlSeconds = Math.round(inSecs); myTtlMinutes = int(myTtlSeconds / 60); myseconds = "00" + (myTtlSeconds - myTtlMinutes * 60) * 1; rds = myseconds.split(""); myseconds = rds[rds.length - 2] + rds[rds.length - 1]; myminutes = "0" + myTtlMinutes; rds = myminutes.split(""); myminutes = rds[rds.length - 2] + rds[rds.length - 1]; return("" + myminutes + ":" + myseconds); } // End of the function notes = _root.s.getVolume() + " : " + _root.s.getTransform() + " : " + _root.s.getPan(); isOn._visible = 1; isStop._visible = 1; isOn._alpha = 85; isStop._alpha = 0; vol = s.getVolume(); if (stTime == "") { stTime = getTimer(); } // end if duration = (getTimer() - stTime) / 1000; durationX = s.position + ":" + s.duration; trace(s.position + ":" + s.duration); if (sz > 1 && s.position > 1 && s.duration > 1 && s.position >= s.duration) { this_cgi = this._url.split("?")[0].split("MP3Player.swf")[0]; if (refresh) { title = "RELOADING " + this_cgi; getURL(this_cgi + "/index.cgi?lastSrc=" + src, "_self"); } // end if isOn._visible = 1; isStop._visible = 1; isOn._alpha = 0; isStop._alpha = 85; startOffX = 0; s.stop(); stop(); src = Number(src) + 1; if (src == number_of_tracks) { src = 0; } // end if loadNot = ""; gotoAndPlay(1); } // end if durationTtl = Math.round(s.position / 1000); durationX = Math.round(s.duration / 1000); playbar.ttl._width = durationX; playbar.done._width = s.position / 1000; playbar._width = 250; if (seekDrag == "") { at._x = s.position * 250 / s.duration + playbar._x; } // end if sz = durationX; ttlSeconds = Math.round(durationTtl); ttlMinutes = int(ttlSeconds / 60); minutes = ttlMinutes; seconds = ttlSeconds - minutes * 60; seconds = "00" + seconds; rds = seconds.split(""); seconds = rds[rds.length - 2] + rds[rds.length - 1]; minutes = "0" + minutes; rds = minutes.split(""); minutes = rds[rds.length - 2] + rds[rds.length - 1]; duration = "" + minutes + ":" + seconds; if (duration == "00:00") { duration = "LOADING"; loadherup = Number(loadherup) + 1; if (loadherup == 5) { loadherup = 1; } // end if for (counteruno = 1; counteruno > loadherup; counteruno = Number(counteruno) + 1) { duration = duration + "."; } // end of for } // end if display = songname + " (" + duration + ")"; szSecs = formatTime(Math.round(s.duration / 1000)); if (lastLastSecs != lastSecs && szSecs != lastSecs) { if (shizcnt >= 3) { shiz = ". . : ."; shizcnt = "res"; } // end if if (shizcnt == 2) { shiz = ". : . ."; shizcnt++; } // end if if (shizcnt == 1) { shiz = ": . . ."; shizcnt++; } // end if if (shizcnt < 1) { shiz = ". . . ."; shizcnt++; } // end if if (shizcnt == "res") { shizcnt = 0; } // end if title = szSecs + " " + shiz + " " + shiz + " CALCULATING LENGTH "; } else { title = srcs[srcs.length - 1].split(".mp3")[0] + " " + szSecs; } // end if lastLastSecs = lastSecs; lastSecs = szSecs; var showme = songname + " (" + duration + ")"; [/code] [list] [*]On frame 11 of "Actions" layer, copy the following ActionScript: [/list][code] gotoAndPlay(10); [/code] [list] [*]On frame 1 of "Components" layer, double click the buttons group, select the "Pause" button, and copy the following ActionScript: [/list][code] on(release){ isOn._visible = 1; isStop._visible = 1; isOn._alpha = 0; isStop._alpha = 85; startOffX = Math.round(s.position/1000); s.stop(); stop(); } [/code] [list] [*]On frame 1 of "Components" layer, double click the buttons group, select the "Play" button, and copy the following ActionScript: [/list][code] on(release){ if (loadNot eq ""){ s.loadSound(src,true); loadNot = "y"; } s.start(startOffX,1); gotoAndPlay("Playing"); } [/code] [list] [*]On frame 1 of "Components" layer, double click the buttons group, select the "Back" button, and copy the following ActionScript: [/list][code] // Action script... on (release) { s.stop(); stop(); if (src == 0) { src = number_of_tracks; } // end if src = Number(src) - 1; loadNot = ""; gotoAndPlay(1); } [/code] [list] [*]On frame 1 of "Components" layer, double click the buttons group, select the "Forward" button, and copy the following ActionScript: [/list][code] // Action script... on (release) { s.stop(); stop(); src = Number(src) + 1; if (src == number_of_tracks_plus_one) { src = 0; } // end if loadNot = ""; gotoAndPlay(1); } [/code]
ryanmeyersmusic Posted August 14, 2005 Posted August 14, 2005 before you go to all that trouble, make sure you're clicking the link above, and choosing "Save file as..." to save it. Hope that helps!
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now