Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ASP + Flash + User-activated loading?

Status
Not open for further replies.

FuzzyLogistics

IS-IT--Management
Dec 14, 2006
4
US
I am building an encyclopedia, and I want to be able to have a small sound file associated with each entry, which, WHEN CLICKED, will load a .mp3 out of a directory and play the sound. I can't have it load the .mp3 until it is clicked, because loading 500 .mp3s on a page is no fun at all.

I hate to ask such a generalized example, but could someone point me to a fairly specific example/tutorial?

Thanks,

- The Fuzz
 

500 mp3s = 500 buttons I assume and you dont want to have to write 500 onRelease events so

place all mp3s in a folder (music ?)

add to actionscript

Button.prototype.onRelease = function() {
delete mysound;
mysound = new Sound();
mysound.loadSound("music/"+this._name+".mp3", true);
mysound.start();
};

Now make sure all button instance names are the same as the mp3s eagles.mp3 has a button with instance name eagles to play this sound.

The code will apply to all buttons in the movie that dont have any onRelease code assigned to them
 
Wouldn't it be easier if I could just pass an ASP variable into flash instead of naming the instance the same? This way, I could use a single .swf, but make it call a different name.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top