If you are storing references from each MP3 to the appropriate actor in a
database, you can simply create a CFC to retrieve the actor information
(including the file reference) - given you have the files available on the
web somewhere (http://www.actorsite.com/mp3/*).

Here's what your CFC might look like:

<cfcomponent>
        <cfparam name="Request.DSN" default="ActorDB">
        <cffunction name="getActorList" access="remote">
                <cfquery name="selActorList" datasource="#Request.DSN#">
                        SELECT ActorID, ActorFirstName,
                                        ActorLastName, ActorMP3
                        FROM Actor
                        ORDER BY ActorLastName, ActoFirstName
                </cfquery>
                <cfreturn selActorList>
        </cffunction>
</cfcomponent>

And here's what your AS code might look like:

#include "NetServices.as"

var IS_STREAMING = true;
var HOST_NAME = "localhost";
var MP3_PATH = "/mp3";

// Create a UDF to call the CFC method
function getActorList()
{
        // Call the method: Actor.getActorList()
        svc.getActorList();     
}
// Create a UDF to be called back by NetServices
function getActorList_Result(actorList)
{
        // Load in the name and sound of the first actor
        _level0.dspActorName = actorList.getItemAt[0].ActorFirstName;
        _level0.dspActorName += " ";
        _level0.dspActorName += actorList.getItemAt[0].ActorLastName
        var currentSound = "http://"; + HOST_NAME + MP3_PATH 
                                        + "/" +
actorList.getItemAt[0].ActorMP3;
        _level0.loadSound(currentSound,IS_STREAMING);
}

// Given that we are working on localhost and have placed
// Actor.cfc beneath the web root at /com
if (init == null)
{
        gatewayURL = "http://"; + HOST_NAME + "/flashservices/gateway";
        NetServices.setDefaultGatewayUrl(gatewayURL);
        conn = NetServices.createGatewayConnection();
        svcAddr = "com.Actor";
        svc = conn.getService(svcAddr, this);
        init = true;
}

There is much more to do than just this, but hopefully it steers you in the
right direction.

--
Scott Van Vliet
Sempra Energy
555 W. 5th St., 21st Floor
Los Angeles, CA 90013
Tel > 213.244.5205
Email > [EMAIL PROTECTED]

"Hello Stupid, and welcome to your crappy computer."
- Strong Bad, HomestarRunner.com






> -----Original Message-----
> From: Brad Roberts [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 16, 2002 7:55 AM
> To: CF-Talk
> Subject: SOT: Flash: load sounds
> 
> 
> I need a Flash "mp3 player" similar to the sample that comes with MX.
> 
> My app is for a talent agency.  I've already built the admin 
> where they can
> upload a sound clip for each actor.
> 
> Here's what I want to do:
> 
> User clicks on an actor's name.  The actors detail page is 
> displayed, along
> with the Flash "mp3 player".  When the user clicks "play", 
> the actors sound
> clip is played.
> 
> My question is, how do I tell the flash movie which mp3 to play?
> 
> Any suggestions are much appreciated.
> 
> 
______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to