Jump to content
An Old School Catholic Message Board

Flash audio players


ninjakyle

Recommended Posts

ryanmeyersmusic

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)

Link to comment
Share on other sites

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

Link to comment
Share on other sites

ryanmeyersmusic

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]

Link to comment
Share on other sites

ryanmeyersmusic

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!

Link to comment
Share on other sites

[quote name='ryanmeyersmusic' date='Aug 14 2005, 11:09 AM']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!
[right][snapback]684792[/snapback][/right]
[/quote]


i did that, but for some reason its not recognizing the file...

Link to comment
Share on other sites

ryanmeyersmusic

it shouldn't take that long to follow that little tutorial. or shoot me an e-mail and i can try e-mailing the source FLA to you...

Link to comment
Share on other sites

oh snap
it works now

Ryan, you are officially "the man"

I think you should change your name to Ryan "the man" Meyers

I think I am going to see if I can add a button so it would then be
play, pause, forward, reverse and "denis"

thanks for the help, I will say a special prayer for you today

Link to comment
Share on other sites

[quote name='ryanmeyersmusic' date='Aug 14 2005, 02:31 PM']FlashMXProfessional (2004, version 7.2)
[right][snapback]684923[/snapback][/right]
[/quote]


ah ok im using flash 5....

Link to comment
Share on other sites

ryanmeyersmusic

spread some love, maybe buy a cd, and enjoy ;)

Sorry, Just, it uses a lot of ActionScript 2.0 which started with MX. You could download the 30-day trial just to build the player from. I think you ought to be able to make it happen in that 30-day window...

Link to comment
Share on other sites

[quote name='ryanmeyersmusic' date='Aug 14 2005, 04:38 PM']spread some love, maybe buy a cd, and enjoy ;)

Sorry, Just, it uses a lot of ActionScript 2.0 which started with MX.  You could download the 30-day trial just to build the player from.  I think you ought to be able to make it happen in that 30-day window...
[right][snapback]684962[/snapback][/right]
[/quote]


cool! thanks i'll do that...

Link to comment
Share on other sites

worked like a chizarm for me

going to upload it on my site sizoon

Vote for Ryan everyone. I think he would make a good one!

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...