A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Generic CFC to work with flash remoting

  1. #1
    Junior Member
    Join Date
    Jun 2002
    Posts
    13
    I am starting to build a lot of data-aware movies that will connect to coldfusion mx. Instead of jumping back and forth between the CFC and the FLA, I was thinking of building a generic CFC which would accept a string (which would be a well formed SQL statement) and return the query result. This way, I would use flash to create the SQL query string, always send it to the same CFC and then handle the result (by storing it in a global var or something like that).

    Does this approach have any pitfalls that I am not considering (yes, I know the sql will have to be optimized each time and will not be quite as fast as a stored proc).

    Thanks

  2. #2
    Senior Member
    Join Date
    Jul 2000
    Posts
    419
    this is actually super easy to implement! I use it all the time for small projects because it's so easy

    Code:
    < cfcomponent >
    	< cffunction 
    	name="runSQL" 
    	hint="RUN SQL" 
    	description="runs a SQL query" 
    	access="remote">
    		< cfquery name="runSQL" datasource="#flash.params[1]#" >
    			#flash.params[2]#
    		< /cfquery >
    		< cfreturn runSQL >
    	< /cffunction >
    < /cfcomponent >

    you wouls call the component in flash with
    Code:
    Service.runSQL("dsnname", "sqlstatement");

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center