PDA

View Full Version : Flash 8 remoting with Coldfusion MX7


lespaul00
01-05-2008, 02:30 AM
Hello!

I've been going crazy (it seems like many people in these forums do, that's why we're here!!! :p ). I am creating a remote flash file that pulls information from my website server.

I am using:

Dreamweaver 8
Flash 8
Coldfusion MX7

Basically, on website, I have a database called "mydatabase.mdb". I created a page called "flash_data.cfm" within my website directory. Within this page, I have a variable (day) that is a number that corresponds to the day of the year.

So, on January 1: day = 1
On January 23: day = 23
and so on...

I have a .fla file that displays an image. I want a specific image to be displayed for each day. So, I created a query in the flash_data.cfm file as such:

<cfquery name="image" datasource="mydatabase">
SELECT image_id, image_file
FROM TBLIMAGES
WHERE image_id=#day#
</cfquery>

Here is my TBLIMAGES table:

IMAGE_ID.......................................... IMAGE_FILE
1..........................http://www.mywebsite.com/images/image_01.jpg
2..........................http://www.mywebsite.com/images/image_02.jpg
3..........................http://www.mywebsite.com/images/image_03.jpg
4..........................http://www.mywebsite.com/images/image_04.jpg
5..........................http://www.mywebsite.com/images/image_05.jpg
6..........................http://www.mywebsite.com/images/image_06.jpg
7..........................http://www.mywebsite.com/images/image_07.jpg

So basically, i'm left with a variable #image.image_file#, which is a url of the image I want to include in my flash file.

My question! How can I set up my .fla file so that it pulls this information (the image url) from my website database, and displays the image (img source can simply be the url)??

Like I mentioned, I've been going crazy about it!!! I even bought a book to try to learn, and I am going around in circles. I hope I explained it well enough.

THANKS!!! ;)

acolyte
01-05-2008, 04:09 PM
hi LesPaul ,

i never used Cold Fusion Remoting i only used amfphp and rubyamf until now but if i type >> Flash Remoting ColdFusion <<
inside the Google Mask there is plenty of Information about it on the Internet
aswell

for example

http://www.sitepoint.com/article/coldfusion-mx-flash-remoting

http://www.adobe.com/devnet/coldfusion/articles/remoting.html

from the distance maybee u forgot to set your Gateway ?
How is your Gateways set up ?

hope this helps

lespaul00
01-05-2008, 06:10 PM
Thanks for the response! I will certainly check out this links you provided.

However, I do believe my problem is simply not knowing how to retrieve information from one of my webpages to use in flash 8.

For instance, I read a bit about using recordsets in flash. I mean, my query, and information that I need for this, lies on one of my webpages. I just simply need to know how to AS 2.0 code to grab this information, but I don't have a clue!!

lespaul00
01-05-2008, 07:36 PM
I guess there are problems with Flash 8 remoting with Coldfusion MX7. I looked at the following post:

http://forums.forta.com/messages.cfm?threadid=B82C0DDE-3048-80A9-EFEC9DF48C6EBBDC

It said to do the following:

Create a .fla:

Layer: "Remoting Actions"

// Import Flash Remoting Classes
import mx.remoting.Service;
import mx.services.Log;
import mx.rpc.RelayResponder;
import mx.rpc.FaultEvent;
import mx.rpc.ResultEvent;
import mx.remoting.PendingCall;
import mx.remoting.RecordSet;
import mx.remoting.DataGlue;

// Connect to the Gateway
// Establish the Service
var myService : Service = new Service(
"http://127.0.0.1:8500/drmixology",
new Log (Log.DEBUG),
"mycfc",
null,
null);

//Test the Connection
function getTestConn(){

//Create a PendingCall object
var testConn_pc:PendingCall = myService.getTestConn();

//Use the responder property to handle the success for failure
testConn_pc.responder = new RelayResponder(this, "getTestConn_Result",
"getTestConn_Fault");
}

//Handle the Success
function getTestConn_Result(re:ResultEvent){
trace(re.result);
}

//Handle the Failure
function getTestConn_Fault(fault:FaultEvent):Void{
trace("error");
}

// Start Application
getTestConn();


Layer: "Remoting classes"

Just import the RemotingClasses component from the Window>Common Libraries> Remoting onto the stage.

In the GetTestConn.cfc:

<cfcomponent displayName="mycfc">

<!-- Establish a Flash Remoting Connection -->
<cffunction name="getTestConn" access="remote" returnType="string" output="true">
<cfreturn "....connection successful" >
</cffunction>
</cfcomponent>




I am SUPPOSED TO get the following:


1/5 13:34:50 [INFO] : Creating Service for mycfc
1/5 13:34:50 [INFO] : Creating gateway connection for http://127.0.0.1:8500/drmixology
1/5 13:34:50 [INFO] : Successfully created Service
1/5 13:34:50 [INFO] : Invoking getTestConn on mycfc...connection successful
3/27 12:54:47 [INFO] : mycfc.getTestConn() returned "...connection successful"




BUT, I am actually getting:

1/5 13:34:50 [INFO] : Creating Service for mycfc
1/5 13:34:50 [INFO] : Creating gateway connection for http://127.0.0.1:8500/drmixology
1/5 13:34:50 [INFO] : Successfully created Service
1/5 13:34:50 [INFO] : Invoking getTestConn on mycfc

Any thoughts?