Solved

RemotingFlash Sites

Posted on 2004-10-26
235 Views
Last Modified: 2013-12-16
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
Question by:envizion
    8 Comments
     
    LVL 16

    Expert Comment

    by:vickerleung
    0
     
    LVL 27

    Expert Comment

    by:negatyve
    you mean "addind,deleting and update" a database?
    0
     

    Author Comment

    by:envizion
    to negatyve

    Yes Adding Deletin updatind and retriving also i want answers.
    0
     
    LVL 6

    Expert Comment

    by:nishasrilankan
    search for the Time Entry application at Macromedia site...
    http://www.macromedia.com/devnet/mx/flash/articles/time_entry.html
    0
     
    LVL 27

    Expert Comment

    by:negatyve
    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
     

    Author Comment

    by:envizion
    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
     
    LVL 27

    Accepted Solution

    by:
    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
     
    LVL 9

    Expert Comment

    by:ddlam
    0

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Suggested Solutions

    I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
    I have found that much of my time doing support ends up being a constant repetition of the same steps to different people.  Early on I stated using web pages with Frequently Asked Questions (FAQs) to alleviate most of the burden.  Sometimes this jus…
    The purpose of this video is to demonstrate how to set up basic WordPress SEO. This will be demonstrated using a Windows 8 PC. The plugin used will be WordPress SEO by Yoast. Go to your WordPress login page. This will look like the following: myw…
    The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…

    884 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now