I have a flash file that i have just written. The file needs to connect to a
webserver to do a database query, then return the results of the query to the
flash for display.
I based the code on some flash MX 2004 code. My co-worker has flash mx 2004
installed and it works just fine on his machine. I have just installed flash 8
pro and downloaded and installed the flash remoting components and it doesn't
work at all.
First of all it throws an error when it tries to include the Netservices.as
file; so i comment that out and then the remoting does not work at all. Is
there alternative code to the #include netservices.as for flash 8?
Here's the code i'm calling to connect to the website:
myObj =
NetServices.createGatewayConnection("http://www.mywebsite.com/flashservices/gate
way");
when i trace myObj i get undefined; when my colleague traces it he gets object
(which is what you'd expect).
Does anyone have any pointers - this is obviously an installation issue but
WHY? i installed the flash remoting components
(http://www.macromedia.com/software/flashremoting/downloads/components/). I
can't find anywhere on macromedia's website that specifies other installations
needed.
Please, if anyone can help me i would really appreciate it.
doug777 - 17 Feb 2006 01:47 GMT
Take a look at the code at
http://www.asfusion.com/blog/entry/introduction-to-flash-remoting
If you try it, can you post to say if it worked or not?
I have a similar problem to you, but with other issues and I am finding
it very difficult to locate the problem.
Doug
funkygirlAUCA - 17 Feb 2006 15:07 GMT
Thanks for the info Doug.
Actually, i ended up installing Flash MX 2004 - i knew the code worked there
and i couldn't afford any more time messing around with 8.
If i get a chance at some point in the future, i'll check out the code you
sent and see if i can get it working.
thanks again and good luck sorting out your issues...
kimberly5353 - 17 Feb 2006 20:15 GMT
I'm having a similar problem. I went to Macromedia support and was able to
load an .exe file which loaded the remoting files needed to work with DATAGLUE.
I'm importing them in and for some reason I'm getting a syntax error which is
wierd.
I've tried:
import FP8.remoting.DataGlue.as;
import remoting.*;
...nothing works. Just this stupid syntax error. I've compared it to other
imports I've done in MX and can't figure out whats wrong.
Any suggestions??? This is my first time using remoting and its a little bit
of a frustrating start.
:brokenheart;
doug777 - 18 Feb 2006 01:04 GMT
You should be using import mx.remoting.* and you can see (some of) the
classes imported in this package at
http://livedocs.macromedia.com/flashremoting/mx2004/actionscript_api_reference/f
rameset.html
But the package has been extended in Flash 8 and I cannot find any
documentation for this anywhere on the Macromedia site. Using remoting
in Flash 8 is significantly different than in MX2004, but Macromedia has
provided close to zero information on it. Hence the number of cries for
help on this forum.
In a typical solution you will need:
import mx.controls.*;
import mx.remoting.*;
import mx.rpc.*;
Good luck, (though I'm not having much of that myself).
Doug
kimberly5353 - 18 Feb 2006 14:57 GMT
Hmmmm.. thats a bummer. (Re: Flash remoting on 8). Is there an easier
approach to setting up an online questionnaire entered from various locations
via Flash? I've read that DataGlue is pretty efficient but if it requires this
much hairpulling, is there a better, albeit less efficient method? Can I just
use LoadVars and PhP and a MySql database? Kim
doug777 - 19 Feb 2006 04:20 GMT
I have finally got the whole thing working. If you're using flash forms,
the basic structure seems to be this (you don't need to import anything):
function myFunc():Void {
<cfoutput>
var connection:mx.remoting.Connection =
mx.remoting.NetServices.createGatewayConnection("http://#cgi.HTTP_HOST#/flashservices/gateway/");
var componentPath =
"Path_From_wwwroot.NameOfCFC";//e.g."mySite.myCFC" (don't add .cfc)
</cfoutput>
var myService:mx.remoting.NetServiceProxy;
var responseHandler:Object = {};
responseHandler.onResult = function(results:datatype):Void {//where
datatype is the ActionScript datatype for whatever the CFC returns
//code to handle the result of the CFC call
}
responseHandler.onStatus = function(stat:Object):Void {
alert("Error: " + stat.description);
}
myService = connection.getService(componentPath, responseHandler);
myService.myMethod();//where myMethod is the function name in the CFC
}
Hope this helps.
When you finally get it working it does look pretty slick so maybe it's
worth the effort ???
Doug
kimberly5353 - 20 Feb 2006 18:49 GMT
I'm going to give it a try. I'll be in touch hopefully with a positive reply. :) Kim:D
Niemo - 07 Mar 2006 19:46 GMT
This worked. Thanks.
Another key to getting the net connection debuger to work is to include this
statement just under your import statements:
mx.remoting.debug.NetDebug.initialize();
Then go to Windows/Common Libraries/Remoting and drag them into the Library of
your .fla.