Basically, on the CFMX side, you might have this in a .cfc file:

<cfcomponent displayname="Data Access for SQL Tool of Justice"
hint="Retrieves data in support of the flash SQL tool.  This CFC is
presented for Flash Remoting use only">
                <cffunction name="sqlExecute" displayname="Execute query"
returntype="query" access="remote">
                <cfargument name="dsn" required="true" hint="Datasource
Name"  type="string">
                <cfargument name="sql" required="true" hint="The SQL
expression to execute against the datasource" type="string">
                <cfset var qresult = "">
                <cfquery name="qresult" datasource="#arguments.dsn#">
                        #arguments.sql#
                </cfquery>
                <cfreturn qresult>
        </cffunction>
</cfcomponent>


Then, on the Flash side, you might have something like this:

/***********************************************
included ActionScript files
***********************************************/
#include "NetServices.as"
#include "NetDebug.as"
#include "DataGlue.as"

/* various routines to call services, perform population of flash components
*/
execsql_pb.execSql = function() {
        
dsnDataService.sqlExecute(dsn_lb.getSelectedItem().label,sql_txt.text);
}
sqlresults_dg.populate = function(qobj) {
        sqlresults_dg.setDataProvider(qobj);
}

function sqlExecute_result(result) {
        sqlresults_dg.populate(result); 
}

/* flash remoting declarations */
var cpath = "http://localhost:8500/flashservices/gateway";;
var net_conn = NetServices.createGatewayConnection(cpath);
var dsnDataService = net_conn.getService("sqltoolflash.cfc.sqltool",this);

/* interface initialization */
execsql_pb.setClickHandler("execSql",execsql_pb);


-----------------------------

Note: sqlresults_dg represents a datagrid instance


Regards,
Steve Drucker
CEO
Fig Leaf Software
w. www.figleaf.com
p. (877) FIG-LEAF


> -----Original Message-----
> From: Mike Chambers [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, December 04, 2002 10:37 AM
> To: CF-Talk
> Subject: RE: Flash MX with CFMX - is this possible?
> 
> also, i suggest transforming the data into a Query. That way, when you
> pass it to flash you can just load it directly into the datagrid
> component to display it.
> 
> datagrid.setDataProvider(rs);
> 
> datagrid component is on drk 1
> http://www.macromedia.com/software/drk/
> 
> btw devmx.com has a very good list on flash / cf integration.
> 
> mike chambers
> 
> [EMAIL PROTECTED]
> 
> > -----Original Message-----
> > From: webguy [mailto:[EMAIL PROTECTED]]
> > Sent: Wednesday, December 04, 2002 8:37 AM
> > To: CF-Talk
> > Subject: RE: Flash MX with CFMX - is this possible?
> >
> >
> > Rewrite your page that does cfhttp stuff as a cfc. Make it
> > "remote". Then in
> > your flash movie comsume that cfc.
> >
> >
> > so your cfc is something like
> >
> > <cfcomponent>
> >
> >     <cffunction name="getThreads">
> >
> >     does cfhttp etc
> >
> >     </cffunction>
> >
> >     <cffunction name="getThread" access="remote">
> >             <cfargument name="Treadid"      type="number"
> > required="yes" >
> >             does cfhttp etc
> >
> >     </cffunction>
> >
> > <cfcomponet >
> >
> > WG
> >
> > > -----Original Message-----
> > > From: Cathy Taylor [mailto:[EMAIL PROTECTED]]
> > > Sent: 04 December 2002 13:20
> > > To: CF-Talk
> > > Subject: Flash MX with CFMX - is this possible?
> > >
> > >
> > > Is anyone a wiz at Flash MX yet? Particularly Flash remoting and
> > > how it integrates with CFMX? I posted on the Allaire forum under
> > > Flash MX and didn't get any responses, so maybe I'll try here.
> > >
> > > I have a CF page that does a cfhttp to pull back bulletin board
> > > threads. It changes the text and link colors and strips off
> > > everything except the list of threads. It also rewrites the
> > > thread links so that they point to a second cf page that does the
> > > same thing, only for the thread text and all replies. The object
> > > is to make the page look more business-like and also limit client
> > > browser hits to the actual bulletin board site (I haven't figured
> > > out how to do session cookies with logins to the site yet so that
> > > people can actually post from it).
> > >
> > > I would like to create a Flash MX movie that displays the
> > > threads, if possible, so that I can have most of the
> > > communication going through that and processing on the remote
> > > server instead of the client. I've looked through tutorials and
> > > haven't been able to figure out if it's possible to hand off the
> > > filecontent to the Flash MX movie, plus add the navigation
> > capability.
> > >
> > > So before my brain explodes, I wanted to put out feelers and see
> > > if this is even feasible? If so, has anyone found a good site
> > > that explains how to write the action script to handle cfoutput?
> > >
> > > Thanks!
> > >
> > > Cathy
> > >
> >
> 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.

Reply via email to