• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 254
  • Last Modified:

RemotingFlash Sites

Where i can find the scripts of addind,deleting and update scripts of flash remoting with coldfusion. I search but i find only model scripts. But I want Add and Delete like scripts. Tell me hte website addresses or books to find these things.
thanks
0
envizion
Asked:
envizion
1 Solution
 
vickerleungCommented:
0
 
negatyveCommented:
you mean "addind,deleting and update" a database?
0
 
envizionAuthor Commented:
to negatyve

Yes Adding Deletin updatind and retriving also i want answers.
0
[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

 
nishasrilankanCommented:
search for the Time Entry application at Macromedia site...
http://www.macromedia.com/devnet/mx/flash/articles/time_entry.html
0
 
negatyveCommented:
these are examples of coldfusion code to add, update, insert and delete. do you need the flash code too?

      <cffunction access="remote" output="false" returntype="any" name="GetUser">
            <cfargument name="userid" required="true" type="numeric" />
            <cftry>
                  <cfquery datasource="#application.dsn#" name="GetUserQuery">
                        SELECT * FROM Users WHERE userid = #arguments.userid#
                  </cfquery>
                  <cfcatch>
                        <cfreturn "error">
                  </cfcatch>
            </cftry>
            <cfreturn GetUserQuery>
      </cffunction>

      <cffunction access="remote" output="false" returntype="string" name="AddUser">
            <cfargument name="username" required="true" type="string" />
            <cfargument name="password" required="true" type="string" />
            <cftry>
                  <cfquery datasource="#application.dsn#">
                        INSERT INTO Users (username, password)
                        VALUES ('#arguments.username#', '#arguments.password#')
                  </cfquery>
                  <cfcatch>
                        <cfreturn "error">
                  </cfcatch>
            </cftry>
            <cfreturn "done">
      </cffunction>

      <cffunction access="remote" output="false" returntype="string" name="UpdateUser">
            <cfargument name="userid" required="true" type="numeric" />
            <cfargument name="usname" required="true" type="string" />
            <cftry>
                  <cfquery datasource="#application.dsn#">
                        UPDATE Users
                        SET username = '#arguments.usname#'
                        WHERE userid = #arguments.userid#
                  </cfquery>
                  <cfcatch>
                        <cfreturn "error">
                  </cfcatch>
            </cftry>
            <cfreturn "done">
      </cffunction>

      <cffunction access="remote" output="false" returntype="string" name="DeleteUser">
            <cfargument name="userid" required="true" type="numeric" />
            <cftry>
                  <cfquery datasource="#application.dsn#">
                        DELETE FROM Users WHERE userid = #arguments.userid#
                  </cfquery>
                  <cfcatch>
                        <cfreturn "error">
                  </cfcatch>
            </cftry>
            <cfreturn "done">
      </cffunction>
0
 
envizionAuthor Commented:
To Negatyve

Thanks for the code of cold fusion but I need Flash mx 2004 code also for this thing and search also i need. Already I finished update and delete but i need how can i retrive all infomation of particular user or student or any other person. in flash also i need this solutions.

thanks
0
 
negatyveCommented:
This is an example of search method:

<cffunction access="remote" name="SearchUsers" output="false" returntype="any" displayname="SearchUsers">
      <cfargument name="Criteria" type="string" required="true" hint="Search field">
      <cfargument name="KeyWords" type="string" required="true" hint="Search pattern">
      <cftry>
            <cfquery name="SearchResult" datasource="#application.dsn#">
                  SELECT * FROM Users WHERE #arguments.Criteria# LIKE '%#arguments.KeyWords#%'
            </cfquery>
            <cfcatch>
                  <cfreturn "error">
            </cfcatch>
      </cftry>
      <cfreturn SearchResult>
</cffunction>



To use it in flash:

// =================================================
#include "NetServices.as"
NetServices.setDefaultGatewayUrl("http://localhost/flashservices/gateway");
remote_conn = NetServices.createGatewayConnection();
users__conn = remote_conn.getService("path.to.component");

var responder = new Object();
responder.onResult = function(result)
{
      // here you have got result RecordSet
      // from the server
};
// call remote function, passing as parameters the
// object waiting for response, then the remote
// function parameters (for searchUser, the criteria
// field, then the search pattern: here you are searching
// for a user with UserName similar or equal to "Gandalf")
users__conn.SearchUsers(responder, "UserName", "Gandalf");
// =================================================
0

Featured Post

[Webinar] Improve your customer journey

A positive customer journey is important in attracting and retaining business. To improve this experience, you can use Google Maps APIs to increase checkout conversions, boost user engagement, and optimize order fulfillment. Learn how in this webinar presented by Dito.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now