Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / Flash Remoting / November 2003



Tip: Looking for answers? Try searching our database.

Flash2004 ColdfusionMX Remoting

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Xenocide - 06 Nov 2003 04:47 GMT
I am trying to query a database and pull up news info and pictures.. i started with the news first.  I have a text window as wall as a List component names News and News2... i cant seem to get ither one to pull in the info from the DB.. so i am posting my code from Flash first... I am new to this so i know i made some mistakes but i tried to follow  tutorials but am still lost..

*********************************

#include "NetServices.as"
#include "Dataglue.as"
// Remoting functions
if (inited == null) {
    inited = true;
    NetServices.setDefaultGatewayUrl("http://www.gomez.dns4me.com:8080/flashservices/gateway");
    gateway_conn = NetServices.createGatewayConnection();
    GomezWeb = gateway_conn.getService("Insert", this);
    GomezWeb.UserPage();
}

function News() {
    GomezWeb.NewsProvider({NewsID:News.getValue()});
}
function NewsProvider_Result(result) {
    var detailRecord = result.getItemAt(0);
    NewsList.text = detailRecord.News;
    News.text = detailRecord.News;
}
stop();

Now my CFC code
***************************************************

<cfcomponent>

<cffunction name="UserPage" returntype="query" access="remote">
  <CFQUERY NAME="listQuery" DATASOURCE="reg1">
   SELECT *
    FROM reg1
</CFQUERY>
   <CFRETURN listQuery>
 </cffunction>
 
<cffunction name="Newsprovider" returntype="query" access="remote">
   <cfargument name="NewsID" type="any" required="true" default="0">
     <CFQUERY NAME="detailQuery" DATASOURCE="reg1">
      SELECT NewsUpdate.News
      FROM NewsUpdate
      WHERE NewsUpdate.ID = 1
    </CFQUERY>
   <CFreturn detailQuery>
</cffunction>
 
</cfcomponent>
 

**************************

I ran the debugger and i get this... NetServices info 1: UserPage_Result was received from server: [object Object]

and my List component says Undefined.

Please Help!
Xenocide - 20 Nov 2003 17:53 GMT
can someone please help.....i am still lost.

for the last two weeks i have been doing tutorials.. but they are too complicated... i can get them to work.. but what i want is simple.. to dynamically fill a textarea or a combobox, then i will getintodrilldown and dependent.. but i cant get it to work... please help...  basic please i am new to all of this.
Dross.2 - 20 Nov 2003 18:34 GMT
basically, you called one function, but didn't handle it
s result, but wrote handlers for another function that you didn't call. When the init section is run, the command is GomezWeb.UserPage();

Thus, you need a UserPage_Result function to handle whatever is coming back. I also never see that you call the News() function, so unless you have a button that is tied to it, that section will never run.
Xenocide - 20 Nov 2003 18:50 GMT
So your saying i need something like this below?? If so all i get in my Textarea(NewsList) is "undefined"
**********************************

#include "NetServices.as"
#include "Dataglue.as"
// Remoting functions
if (inited == null) {
inited = true;
NetServices.setDefaultGatewayUrl("http://www.gomez.dns4me.com:8080/flashservices/gateway");
gateway_conn = NetServices.createGatewayConnection();
GomezWeb = gateway_conn.getService("Insert", this);
GomezWeb.UserPage();
}

function UserPage() {
GomezWeb.UserPage({UserPage:News.getValue()});
}
function UserPage_Result(result) {
var detailRecord = result.getItemAt(0);
NewsList.text = detailRecord.News;
News.text = detailRecord.News;
}
stop();

***************
<cfcomponent>

<cffunction name="UserPage" returntype="query" access="remote">
<cfargument name="News" type="any" required="true" default="0">
  <CFQUERY NAME="listQuery" DATASOURCE="reg1">
   SELECT *
    FROM reg1
</CFQUERY>
   <CFRETURN listQuery>
 </cffunction>
 
<cffunction name="Newsprovider" returntype="query" access="remote">
   <cfargument name="News" type="any" required="true" default="0">
     <CFQUERY NAME="detailQuery" DATASOURCE="reg1">
      SELECT NewsUpdate.News
      FROM NewsUpdate
      WHERE NewsUpdate.ID = 1
    </CFQUERY>
   <CFreturn detailQuery>
</cffunction>

</cfcomponent>
Xenocide - 20 Nov 2003 19:56 GMT
Ok i played around some more.. and i got a resault with a combobox and datagrid and list but it doesnt work with the text area or the texttool ... is there a different way to bring it up in those?? here is my fla file..
***************
#include "NetServices.as"
if (inited == null) {
inited = true;
NetServices.setDefaultGatewayUrl("http://www.gomez.dns4me.com:8080/flashservices/gateway");
gateway_conn = NetServices.createGatewayConnection();
GomezWeb = gateway_conn.getService("Insert", this);
GomezWeb.Newsprovider();
}
function Newsprovider() {
    GomezWeb.Newsprovider({Newsprovider:News2.getValue()});
}
function Newsprovider_Result(result) {
    News.setDataProvider(result);
}
stop();
Xenocide - 21 Nov 2003 12:17 GMT
i know this is like a whole new problem but i heed the help. My cfc and fla files are listed in the post above and some help as to what i need to do to dynamically fill a textarea ot textbox (made using the texttool) Thanx for all the help so far!
radmo - 26 Nov 2003 23:31 GMT
You might switch over from using text areas to using the scroll pane component in the flash UI components set 2. If you don't have set 2 you can get it at MM website. The scroll pane is perfect for this kind of usage.

Good luck.

Radmo
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.