Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Supporting Technologies > Flash Remoting

Reply
 
Thread Tools Rate Thread Display Modes
Old 12-15-2003, 05:57 PM   #1
MarioV
Registered User
 
Join Date: Apr 2003
Location: Sierra Vista
Posts: 13
Default Flash Remoting Problems

I've trying to figure out why this doesn't work.

I'm using Flash MX 2004 Pro, Flash MX 2004 Components, ColdFusion 6.1. I can't get the lists to poulate with the results from a query in the CFC.

Here's the URL of the same code in action:
http://www.mariovasquez.com/prisontattooart/index2.cfm


Here's the code:

#include "NetServices.as"
#include "NetDebug.as"

if (isGateWayOpen == null) {
initialized = true;
NetServices.setDefaultGatewayUrl("http://localhost:8500/flashservices/gateway");
var my_conn = NetServices.createGatewayConnection();
// Create the service objects
var UIService = my_conn.getService("tattooSite.cfc.tattooInitApp", this);
}


function getCats_Result(result) {
trace(result);
ComboBoxFill(searchList, result.BOOKS,"--Choose a book--");
}

function getCats_Status(status) {
errorHandler(status.description);
}

// Major error handler, usually a connection is bad, so the movie will fail
_global.System.onStatus = function(error) {
errorHandler("There was a connection failure");
}

// General error handler for entire movie
function errorHandler(message){
trace(message);
};


// FILL THE LIST
function ComboBoxFill(cbName, rs, zeroElement){
var fields = rs.getColumnNames();
// if there is a descriptive text to put in the Combo box
// put it in the 0 position of the RecordSet
if(zeroElement != null) {
var temp = {};
rs.addItemAt(0, temp);
rs.setField(0,fields[0], 0);
rs.setField(0,fields[1],zeroElement);
}
trace(rs.getLength());
var idField = "";
var descField = "";
for(var i=0; i<rs.getLength(); i++) {
descField = rs.getItemAt(i)[fields[1]];
idField = rs.getItemAt(i)[fields[0]];
cbName.addItem({label:descField,data:idField});
}
}

// Call the remote service to populate the combo boxes
UIService.getCats();


Any ideas?

Thanks!

Last edited by MarioV; 12-15-2003 at 09:05 PM..
MarioV is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump


All times are GMT. The time now is 01:18 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.