Remoting, RelayResponder In Function
I am trying to call a function that makes a PendingCall to remoting, but im not getting the RelayResponder to work... whats wrong..?
my code:
function GetNavigation(){ var navObject:PendingCall = myService.GetNavigation(lang) navObject.responder = new RelayResponder(this, "GetNavigation_Result", "errorFunction_Fault"); }
function GetNavigation_Result( re:mx.rpc.ResultEvent ):Void { //Stuff }
/Klas
FlashKit > Flash Help > Flash ActionScript
Posted on: 12-03-2004, 08:27 AM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Remoting For .net And As2.0 RelayResponder Problem
Hello,
I'm using remoting mx for .net and as components for as2.0.
I've set up 2 aspx pages: 1 that returns the string hello world, and 1 that returns the params array passed from flash movie. When i look at the netconnection debugger window, the result contains the expected values. However the result and fault events are not triggerd after the call of the service.
The code i use (in the first frame of my flash movie):
ActionScript Code:
var inited:Boolean = null;
if(inited == null)
{
inited = true;
NetDebug.initialize();
var testService:Service = new Service("http://localhost/projects/testprojects/testFlashRemoting/gateway.aspx", null, "projects.testprojects.testflashremoting", null, null);
var pc:PendingCall = testService.testParams("param1","param2",3,4);
//var pc:PendingCall = testService.helloWorldNet();
pc.responder = new RelayResponder(this, "gotResult", "gotFault");
}
function gotResult(re:ResultEvent):Void {
trace("got result");
}
function gotFault(fa:FaultEvent):Void {
trace("got fault");
}
Anyone has an idea on this one?
Regards,
Bart
RelayResponder Problem
I have some simple code which sends a string from flash through amfphp to my service and then the service returns the string and flash displays that that the string has been returned. This code works fine.
But now I want to change it slightly so that the string is only sent from flash when the user clicks the Ok button of an alert component.
So I moved some of the code into the alert handler function as follows:
Code:
function alertHandler (evt){
if (evt.detail == Alert.OK){
// Call some functions
trace("Initialising connection...");
pc = helpDesk.returnString("Connecting to Server");
pc.responder = new RelayResponder(this, 'handleSimpleReturn', 'handleFault');
}
}
But now the handleSimpleReturn function is no longer getting called.
Can someone please tell me why?
Thanks
Amfphp And RelayResponder
I'm using amfphp to get some arrays into my flash app. from the link:
http://livedocs.adobe.com/flashremot...Responder.html
i learned how to connect to a remote service, basicly its something like this:
Code:
custService = new Service("http://localhost:8300/flashservices/gateway", null, "customerData", null, null);
var pc:PendingCall = custService.getCategories(); // get all categories
pc.responder = new RelayResponder(this, "onCategoryData", "onCategoryFault" );
why use a RelayResponder? I saw in another thread here that it works without. My problem with RelayResponder is that the method refered to in the arguments (here: onCategoryData) is executed much later that the code that follows "pc.responder = new RelayResponder..."
Thanks for any hints!
RelayResponder Not Responding
I'm experiencing a problem using amfphp and flash. See the below code.
I have the RegisterUser function being called by a submit button. The function successfully completes, and I get the expected amf response returned. But I only know I get it returned because I'm using a packet sniffer, as there is no trace from RegisterUser_result. The RegisterUser_result function is not fired, UNLESS I move all the code from the RegisterUser function out of the function and have it fire at runtime. So I can only assume that when RegisterUser_result is called by the RelayResponder, it can't be found. But why not? And why don't I get an error? I can call RegisterUser_result directly from inside the ResultUser function, so the function scope should be fine.
function RegisterUser()
{
trace("in register user");
var register_service:Service = new Service(_global.gateway_url,null,"Register", null,null);
register_service.connection.setCredentials(_global.amfphp_admin, _global.amfphp_pass);
var ru:PendingCall = register_service.RegisterUser(txtEmail.text, txtPassword1.text, txtPassword1.text, listAge.value, listCountry.text);
ru.responder = new RelayResponder(this, "RegisterUser_result", "GenericFault");
}
function RegisterUser_result(re:ResultEvent)
{
trace("in result");
}
Thanks for looking!
Relayresponder Is Not Working Second Time Around
Hello,
I am having some strange problems with my amfphp demo that I am working on. The code is located at these links
php: http://pastebin.ca/672300
as: http://pastebin.ca/672298
When I hit the "view" button it does the call to amf and the result shows up in the netdebugger, but the relayresponder is not calling the function. I have no idea what is wrong here as I am rather new to amfphp.
Any help would be greatly appreciated
-Frank
Remoting, Result Function Not Being Processed.
it calls my service properly it gets the results "NetServices info 1: login_Result was received from server:" But it dosent run my login_Result function. What is the problem? I know its not running the function because if it was I would at least get back "VALID IS" but I dont even get the trace statement returned that are in the function.
Any Ideas?
dc.login(username, password);
trace("Login sent");
function login_Result(result) {
_root.tempLogin = result.items[0].valid;
trace("VALID IS " + _root.tempLogin);
}
this is all that gets returned in the output window.
Login sent
NetServices info 1: login_Result was received from server:
And no errors in the NetConnection debugger
As3 Remoting: Calling Aspx Function.
Hi guys, I've been at this problem all day and I have searched through endless posts and have not been able to get this working. I have just about the simplest test that I simply cannot get to work.
I have a folder in my site defined as an application which has an aspx page with a function I want to call from flash.
The setup on my site is as follows:
Root folder of application: root>folder1>remotingApplication
In here I have a folder called "Web" with my gateway.aspx page
I also have a "remoting" folder with the aspx page that contains the function(called apiTest.aspx).
I connect to the gateway with no problem. But I am not sure how to call the function within the "remoting" folder. I understand that I am supposed to use the call method in flash to call the function using dot notation but I have tried writing the path in everyway possible and it just doesn't seem to work? Can anyone help me in how to target that page? Any help is very appreciated!
ActionScript Code:
_connection = new NetConnection();
_connection.connect("http://www.someSite.com/folder1/remotingApplication/Web/gateway.aspx");
var responder:Responder = new Responder(onResult, onError);
//In my real code im not making all these calls. Just one at a time!
_connection.call("remoting.apiTest.GetEvents", responder);//<--Can't find this. Says "no such service".
_connection.call("folder1.remotingApplication.remoting.apiTest.GetEvents", responder);//<--Can't find this.Says "no such service".
_connection.call("apiTest.GetEvents", responder);//<--Can't find this. Says "no such service".
_connection.call("apiTest", responder);//<--Says "length cannot be less than zero". Seems promising except:
_connection.call("apiTestss", responder);//<--Made up name also tells me "length cannot be less than zero". So it doesn't seem like it really found anything. It says this no matter what.
function onResult(result:Object):void{
trace("done");
}
function onError(error:Object):void{
trace("error");
trace(error.description);
}
If anyone could help I would be most appreciative thanks!
REMOTING 2004..How To Call A Function In A Mc Release
Hi, i am triynd to do a simple call from a functionof my service but don't work in a button trigger.
WHYYY GOD!!!
outside the button works, but inside not even a message of error return
look the code
[php]
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.debug.NetDebug;
import mx.remoting.RecordSet;
//falando qual é o gateway
var myGateway:String = "http://nabucodonosor:90/_amfphp/gateway.php";
//
//
//....... Service for login
// create custService service object
custService = new Service(_root.myGateway, null, "HelloWorld", null, null);
//
//
//------Criando açoes para o Login
loginMC.okButton.onRelease = function() {
pc = _root.custService.sayHello(nomes);
pc.responder = new RelayResponder(this, "recebi", "errado");
//
//as funcoes de resposta de erro
function recebi(dat:ResultEvent) {
trace(dat.result);
}
function errado(fault:FaultEvent):Void {
// notify the user of the problem
//
trace("There was a problem: "+fault.fault.faultstring);
trace("The faultcode is: "+fault.fault.faultcode);
trace("The detail: "+fault.fault.detail);
trace("The error class name is: "+fault.fault.type);
}
};
Remoting Newbie Question (function & Vars)
I'm new to remoting and not a programmer, but I'm a mid level actionscripter.
I'm trying to understand the calling of SS functions and vars.
For example:
If I'm trying to increase a global var by one, what would that look like. Sticking just to the client, it'd be myCount ++; on the onPress say, but I'm not understanding what it would look like if trying to go out to the ss.
I do understand that the connection needs to be made and all that, help me with just this part. (There is a "programmer" doing the connection part.)
thanks
Sorry for being "new", but aren't we all at some point.
Undefined Response From Remoting Function Call
I am making a remoting function call to a ColdFusion CFC method. Using the ServiceCapture application I can see that the CFC method is returning the correct data in the proper datatype. However, when I output the results from the method call I get "undefined" results. For example
myVariable = mocService.helloWorld();
The contents of myVariable (whether I trace the output or dump it into a dynamic text object) are "undefined". Anyone know what I'm doing wrong?
Bug - Need To Reconnect Remoting Gateway, With Each Remote Function Call
This is a server-side script issue, not a Flash player Remoting issue. Although the "NetServices.as" is available for Server MX, and has the same API, i found an issue, which I am not sure is local to my script, my server, or is a well-known bug.
The bug has to do with the following. From Server MX I call some remote .NET functions using the Remoting. I connect the gateway, everything works fine, I call some remote method, it returns fine results, and then... next time I call the same method, i wait infinitely for the results... The solution was to issue a 'connect' call again, reconnecting the gateway, with EACH remote function call. However, no documentation says I should do that, and as far as I understand you only connect to the gateway once, and as I trace my gateway connection object, it is still valid each time prior to issuing a 'call' method, without reconnecting. Flash player clients do not suffer from this issue...
Has anyone experienced this issue ?
Suggest A Good Tutorial For CFMX And Flash Remoting Using Remoting Component Classes?
Does anyone know of a good tutorial that will take me through the v2.0 way of utilizing remoting through the Flash Pro remoting component classes (or the RemotingConnector component - either/or)? It seems like the docs are inconsistent in their variable naming from one section to another so its hard to tell what each object placeholders and properties correlate through out the process in their descriptions and examples.
Im thinking a tutorial is more geared to learning this new style than the docs are at this point . . . .
Unable To Load Remoting Classes After Installing AS2 Remoting Components
hi, I have a problem, after i've installed the AS2 Remoting components, I ran a syntax check on the code below and got these messages =>
**Error** C:Inetpubwwwrootgraciousimageservicescms.as: Line 16: The class 'mx.remoting.Service' could not be loaded.
service = new Service("http://localhost/gi/gateway.php", null, "user", null, new RelayResponder(this, "onLoginResult", "onLoginFault"));
**Error** C:Inetpubwwwrootgraciousimageservicescms.as: Line 19: The class 'mx.rpc.ResultEvent' could not be loaded.
function onLoginResult(res:ResultEvent){
**Error** C:Inetpubwwwrootgraciousimageservicescms.as: Line 22: The class 'mx.rpc.FaultEvent' could not be loaded.
function onLoginFault(fault:FaultEvent){
**Error** C:Inetpubwwwrootgraciousimageservicescms.as: Line 25: The class 'mx.remoting.Service' could not be loaded.
}
**Error** C:Inetpubwwwrootgraciousimageservicescms.as: Line 16: There is no method with the name 'Service'.
service = new Service("http://localhost/gi/gateway.php", null, "user", null, new RelayResponder(this, "onLoginResult", "onLoginFault"));
**Error** C:Inetpubwwwrootgraciousimageservicescms.as: Line 25: The class 'mx.rpc.RelayResponder' could not be loaded.
}
**Error** C:Inetpubwwwrootgraciousimageservicescms.as: Line 16: There is no method with the name 'RelayResponder'.
service = new Service("http://localhost/gi/gateway.php", null, "user", null, new RelayResponder(this, "onLoginResult", "onLoginFault"));
code:
import mx.remoting.Service;
import mx.rpc.RelayResponder;
import mx.rpc.ResultEvent;
import mx.rpc.FaultEvent;
class cms extends GForm{
private var service;
function cms(){
//start debugger
mx.remoting.debug.NetDebug.initialize();
}
function initUI():Void{
childForms.loginForm.addEventListener("login", this);
}
function login(evtObj:Object){
service = new Service("http://localhost/gi/gateway.php", null, "user", null, new RelayResponder(this, "onLoginResult", "onLoginFault"));
service.verifyUser(evtObj.credentials.UID, evtObj.credentials.Password);
}
function onLoginResult(res:ResultEvent){
trace(res.Name+" "+res.accessLevel);
}
function onLoginFault(fault:FaultEvent){
trace(fault.fault.faultString);
}
}
Basically, I cannot import any of the remoting classes, i looked into the First Run/Classes folder and was unable to locate any of the remoting classes except for the Debug package
The remoting functions work fine with Remoting Version1 but I need to use the forms functionality and I have no idea how to include the version1 remoting scripts into the classes
I've uninstalled the Remoting Components as well as Flash and reinstalled them but the problem persists!!
Flash Remoting Weird Issue / I'm New To Remoting
Hello All, I'm new to remoting and I'm having some issues. I started with the Macromedia Tutorial and called HelloWorld.cfc and everything was great. So I started a project and I've got logging in and creating a new user working great but now i'm trying to save some data and i can't get it to work. Basically, if you log in, you are not able to use the 'addscore' function. No errors get returned, but no results get returned either. If you skip the log in, you can add your score just fine. So my question is, do i have to 'reset' something or why won't one function work after a different one has been called?
I know this may be confusing, so as may questions as you need. I really appreciate any help.
[F8 & Remoting] Simple Question Dealing With Remoting
Ok I'll post my code and explain, this is using flash remoting and amfphp
main.fla / main.swf
Code:
// ==============================
// SETUP
// ==============================
var rootId:Number = 0;
var itemArrayCall:itemsClass = new itemsClass();
trace (itemArrayCall.getItemsList(rootId));
stop();
itemsClass.as
Code:
// ==============================
// IMPORTS
// ==============================
import mx.remoting.*;
import mx.rpc.*;
import mx.utils.Delegate;
import mx.remoting.debug.NetDebug;
// ==============================
// CLASS CONSTRUCTOR
// ==============================
class itemsClass {
// Gateway
private var gatewayUrl:String = "http://xfuzion.local/%7Exfuzion/finalproject/flashservices/amfphp/gateway.php";
// Service
private var service:Service;
// == SETUP FUNCTION
function itemsClass() {
NetDebug.initialize();
this.service = new Service(this.gatewayUrl, null, "itemsClass");
}
// == getItemsList FUNCTION
function getItemsList(rootId) {
var pc:PendingCall = service.getItemsList(rootId);
pc.responder = new RelayResponder(this, "handleGetItemsList", "handleRemotingError");
return "It will return these values but will not initialize the net debugger AT all or anything";
}
// == RESULT HANDLER FUNCTION
function handleGetItemsList(re:ResultEvent) {
return "it worked";
}
// == ERROR HANDLER FUNCTION
function handleRemotingError(fault:FaultEvent):Void {
NetDebug.trace({level:"None", message:"Error: "+fault.fault.faultstring});
}
}
My problem is the fact the class works, everything works inside of it EXCEPT the remoting. It wont even initialize or run the NetDebug and it's bugging me because I have no way to debug this because of it.
Any help on why it isn't transfering or whatever would be very useful.
I get NO output errors at all, so all the MX components are on the stage correctly and amfphp is set up perfectly fine ( this whole thing works fine if I use it inline rather than class ).
Thanks!
No Remoting Template After Installing Remoting
I installed Remoting for Flash yesterday and am a Certified Dummy in this area. I have only had ColdFusion installed for a few days now and in study using Ben Forta & Raymond Camden's Macromedia book "ColdFusion MX7 - Web Application Construction Kit, chapter 26 addresses Flash Remoting using Flash MX 2004. I have Flash 8 (and all of Studio 8). I downloaded and installed Flash Remoting and it showed up on my "Add-Remove Software" as a separate program, successfully installed. The book tells me to start Flash and choose File>New from Template and select Remoting. It is not there and I don't know how to generate it. I am sure this is a simple step for many of you.
Would you please help me? I have made it to chapter 26 in this book and made most of the coldfusion pages work so far, but I can't get past this without Flash Remoting.
Thanks ahead of time,
Mike
Remoting
can make right pls help.. i have a dynmic txt
in my movie :
#include "NetServices.as"
#include "NetDebug.as"
_root.info = "remoting.....";
function Result()
{
//receives data returned from the method
this.onResult = function(result)
{
_root.info = result;
}
this.onStatus = function(error)
{
_root.info ="error";
}
}
NetServices.setDefaultGatewayUrl("http://localhost:8500/flashservices/gateway");
var gw = NetServices.createGatewayConnection();
var server = gw.getService("remoting.run", new Result());
server.sample();
my cfc:
<cfcomponent>
<cffunction name="sample" access="remote">
<cfquery name="cool" datasource="casino">
SELECT cPW FROM casino_users where cUN ="test1"
</cfquery>
<cfreturn cool>
</cffunction>
</cfcomponent>
cant seem to pass variable coming from a remote database.
thanks,
cid
Remoting
remoting
can make right pls help.. i have a dynmic txt
in my movie :
#include "NetServices.as"
#include "NetDebug.as"
_root.info = "remoting.....";
function Result()
{
//receives data returned from the method
this.onResult = function(result)
{
_root.info = result;
}
this.onStatus = function(error)
{
_root.info ="error";
}
}
NetServices.setDefaultGatewayUrl("http://localhost:8500/flashservices/gateway");
var gw = NetServices.createGatewayConnection();
var server = gw.getService("remoting.run", new Result());
server.sample();
my cfc:
<cfcomponent>
<cffunction name="sample" access="remote">
<cfquery name="cool" datasource="casino">
SELECT cPW FROM casino_users where cUN ="test1"
</cfquery>
<cfreturn cool>
</cffunction>
</cfcomponent>
cant seem to pass variable coming from a remote database.
thanks,
cid
Remoting
remoting
can make right pls help.. i have a dynmic txt
in my movie :
#include "NetServices.as"
#include "NetDebug.as"
_root.info = "remoting.....";
function Result()
{
//receives data returned from the method
this.onResult = function(result)
{
_root.info = result;
}
this.onStatus = function(error)
{
_root.info ="error";
}
}
NetServices.setDefaultGatewayUrl("http://localhost:8500/flashservices/gateway");
var gw = NetServices.createGatewayConnection();
var server = gw.getService("remoting.run", new Result());
server.sample();
my cfc:
<cfcomponent>
<cffunction name="sample" access="remote">
<cfquery name="cool" datasource="casino">
SELECT cPW FROM casino_users where cUN ="test1"
</cfquery>
<cfreturn cool>
</cffunction>
</cfcomponent>
cant seem to pass variable coming from a remote database.
thanks,
cid
Remoting
when i ever i query a database using remoting the result always return :[ object, object]
whats will i do ?
thanks
Xml Remoting
Hello to all,
I am creating a Full Flash eCommerce site (Flash 8 Pro) and I need a few pointers. I have only used XML for simple tasks like Photo Gallery. Here is what I would like to use for the site....
1. PayPal Merchant Account
2. Flash Xml Remoting v3.1 by Shane McCartney
3. Flash Component PPCC 1.2 by ANYRD&D
...BUT i have no idea how to use the Xml Remoting and the documentation confuses me? Ideally I would like to have the product information i.e. (cost, description, image) in the XML file and then have flash import that. Then use the Flash PPCC component for the eCommerce stuff.
I have installed the Flash Xml Remoting Component and Downloaded the SAMPLE File... all that is on the stage is the component with instance of "xmlComm" when i test the movie i get an empty screen... the Flash Output window displays:
typeName
3
Anyone know how to use the Flash Xml Remoting Component v3.1 created by: Shane McCartney??
The Sample XML file looks like this...
<itemsList>
<items>
<label>The Amazing Description</label>
<value>12.15</value>
</items>
<items>
<label>Again an Amazing Title</label>
<value>22.50</value>
</items>
<items>
<label>Finally an Amazing Title</label>
<value>28.50</value>
</items>
</itemsList>
Here is the ActionScript:
var evtObj:Object = new Object();
evtObj.loaded = function(e:Object) {
trace(e.name);
trace(e.data.itemsList.items.length);
};
evtObj.error = function(e:Object) {
};
//
xmlComm.addListener("loaded", evtObj);
xmlComm.addListener("error", evtObj);
xmlComm.call("sample.xml", "typeName");
What am i missing?
ANY HELP would be greatly appreciated.
Remoting In Cs3 With .net
I did a search here on cs3 remoting and read that it is supported with the netconnection object. Unfortunately I've not done remoting before and I can't seem to find any examples that use .net. So, does anyone know how to set this up in both flash and .net? I have my .net classes compiled to a dll, I'm just not sure how to use the netconnection class to call the dll and how to set up the dll in IIS. Thanks!
As3 Remoting From .net?
Hi guys I was wondering if one of you could help me understand how I write the connection to .net functions using as3? I followed a few tutorials but I'm stuck in how to target the page with the function.
The problem is that say my structure is this:
swf file location:http://www.domainname.com/folder1/fo...er2A/flash.swf
service location: http://www.domainname.com/folder1/fo...B/service.aspx
So when i want to call a function from the service how can I write it so that I go out one folder and then go into the other one??
Code:
connection.call("????",responder)
If anyone could help me I would really appreciate it.
Remoting Help
Hello People,
I have been reading in the Forums for some time now, and I find it very helpful, you guys do a great job here!!!
Now, I decided to post some because I need some help with a remoting result...
I have a flash form with an application form and 3 child forms. One of the child forms is called menus and it uses a custom class called "MenuCode".....
here is the "MenuCode" code:
import mx.remoting.Service;
import mx.services.Log;
import mx.remoting.PendingCall;
import mx.rpc.RelayResponder;
import mx.rpc.ResultEvent;
import mx.rpc.FaultEvent;
import mx.remoting.RecordSet;
import mx.screens.Form;
import mx.remoting.debug.NetDebug;
class MenuCode extends mx.screens.Form
{
private var menuItemHolder_mc:MovieClip;
private var menuItemHolder2_mc:MovieClip;
public var buttonNames:Array;
public var buttonNames2:Array;
private var promotionalProd_btn:Object;
private var awards_btn:Object;
private var Category:Object;
//private var myResponder:RelayResponder;
private var categoryService:Service;
private var subCategoryService:Service;
function MenuCode()
{
this.addEventListener("load", this);
mx.remoting.debug.NetDebug.initialize();
}
private function handleEvent(evtObj:Object):Void
{
switch (evtObj.type)
{
case("load"):
formLoad();
break;
}
}
private function formLoad():Void
{
categoryService = new Service("http://localhost:8500/flashservices/gateway", null, "mcaeiro-store.flash.msite.Categories", null, null);
var pc:PendingCall = categoryService.GetPromoCategories();
pc.responder = new RelayResponder(this, "onPromoCategoryData", "onPromoCategoryDataFault");
var nc:PendingCall = categoryService.GetAwardCategories();
nc.responder = new RelayResponder(this, "onAwardCategoryData", "onAwardCategoryDataFault");
}
// handles the results from the GetPromoCategories() call
function onPromoCategoryData (re:ResultEvent):Void
{
_parent.promotionalProd_btn.onPress = function():Void
{
_root.createEmptyMovieClip("menuItemHolder2", 0);
_root.menuItemHolder2._x = 40;
_root.menuItemHolder2._y = 50;
var loTween_x = new mx.transitions.Tween(_root.menuItemHolder2, "_xscale", mx.transitions.easing.Strong.easeOut, 20, 100, .4, true);
var loTween_y = new mx.transitions.Tween(_root.menuItemHolder2, "_yscale", mx.transitions.easing.Strong.easeOut, 20, 100, .4, true);
var rs:RecordSet = RecordSet(re.result);
var promoCategoryArray:Array = new Array();
for (var i=0; i<rs.getLength(); i++)
{
var record = rs.getItemAt(i);
promoCategoryArray.push({name:record.Nombre, Id:record.Id_Categoria});
_root.menuItemHolder2.attachMovie("menuItem_mc", "mcCategory" + i, i);
var mcNewClip = _root.menuItemHolder2["mcCategory" + i];
mcNewClip._x = 0;
mcNewClip._y = i * 17;
mcNewClip._alpha = 70;
mcNewClip.menuItemName_txt.text = /*record.Id_Categoria + " " + */record.Nombre;
mcNewClip.idCategory = record.Id_Categoria;
mcNewClip.onRollOut = function():Void
{
this._alpha = 70;
this._parent._visible = false;
}
mcNewClip.onRollOver = function():Void
{
this.backgroundColor = 0x003399;
this._alpha = 100;
this._parent._visible = true;
}
mcNewClip.onRelease = function():Void
{
trace(this.idCategory);
var catHold = this.idCategory;
subCategoryService = new Service("http://localhost:8500/flashservices/gateway", null, "mcaeiro-store.flash.msite.SubCategories", null, null);
var pc:PendingCall = subCategoryService.getPromoSubCategories({Id_Categ oria:catHold});
pc.responder = new RelayResponder(_root.application.menus, "onPromoSubCategoryData", "onPromoSubCategoryDataFault");
function onPromoSubCategoryData (rp:ResultEvent):Void
{
trace("got it Pal.");
}
function onPromoSubCategoryDataFault (rp:ResultEvent):Void
{
trace("got the fault response for SubCategories.");
}
}
}
}
}
function onPromoCategoryDataFault (re:ResultEvent):Void
{
trace("got the fault response for Categories.");
}
Now.... I am having trouble with the onPromoSubCategoryData function and I have no idea how to fix it now.
I get the result from the getPromoSubCategories Service but my responder function does not do anything, or maybe I am just blind... anyway 4 eyes are better than 2 so if someone has time and feels like going through my code, and happens to find where the flaw is, that is great....
How Remoting REALLY Looks Like... ;)
Hi all,
Thought of giving away a "disassembly-hour" report of mine (i am sure the gurus already did the same discovery on their own long time ago), which have to do with discovering what lies beneath the 'NetServices.as' library and all its offspring, including the newer AS 2.0 Remoting classes like Service etc, and uncovering the true nature of Flash Remoting..
For those of you who wonder what the Remoting is like on the most basic level, a NATIVE-only level of interpreting, a little tutorial:
ActionScript Code:
var gateway_nc:NetConnection = new NetConnection;
gateway_nc.connect("http://localhost/flashservices/gateway.aspx");
var responder = {};
responder.onResult = function(r)
{
for(var i in r) trace(i + ":" + r[i]);
};
gateway_nc.call("MyService.MyFunction", responder, "someParameter");
What it does is it creates a NetConnection object, which establishes a connection between the client and the Flash Remoting Gateway (essential part of Flash Remoting) be it on a .NET, CFusion or a Java server. You dont have to wait for a successful connection, because, apparently since 'http' is a stateless and non-persistent protocol, the state of the NetConnection object after the 'connect' call allows for immediate calling of service functions. Remember that in case of connecting to a Macromedia Flash Communication Server MX thru the RTMP protocol, which IS persistent keep-alive protocol, you have to actually wait for the connection to be available before doing anything with the NetConnection object. Ok, so back to the script: calling then a service function requires that you specify a responder object which will asynchroniously receive the results of your particular remote function call - so you have to create an object which defines a 'onResult' method - the so-called 'responder' object. Results arrive by the Flash player calling the 'onResult' method with the results returned, be it a single or several parameters, depending on the nature of your remote function. The actual call of the remote function happens by using the NetConnection.prototype.call method (simpler put the 'call' method of your NetConnection object), and here some explanation is required. First, since the connection to the gateway is a general all-purpose multi-service connection, the call of 'call' method needs BOTH the service name and the name of the service function. You do that by supplying a string as the first parameter which identifies the remote function across the whole gateway - service name followed by dot followed by function name (in case for .NET, which I cover here). Second parameter is the 'responder' object which tells where to return the call return values, and starting from the third parameter are the parameters to your actual remote function, which may or may not be present at all (i.e. the 'call' method can have only two parameters - the function string and the responder object). That's it
I know the practical use of doing everything the 'native' way is not so popular, since the Macromedia classes present a more user friendly scripting interface, but in case of small projects or where one simply wants to do Remoting another way, by building his/her own programming interface, this should explain little bit more than the basics.
Comments are welcome, criticism as well
Remoting Help
Any body have simple remoting project with ASP.NET
Explanation:
I just want to enter user id and password in Flash, It will call ASP.NET bussiness logic using flash remoting. then specific user information will be appeared in flash. Anybody can help me.
I am awaiting to your reply.
Regards
Shahzeb
Remoting
I have small doubt in Flash remoting, it is possible to use the Flash 8 As2 remoting component for Action script version 1? I have installed Flash8 As2 components but in my project everthing wrote in action script 1.
any one help me how can i use the flash8 components in Actionscript1?
Im new to flash remoting..i have to convert as1 to as2 for using flash8 components?
thx and regards
thil
Remoting
how does remoting help in multiplayer game.
is it only integrated with cf.
help me with links and tutorials.
Remoting In Cs3 With .net
I did a search on cs3 remoting and read that it is supported with the netconnection object. Unfortunately I've not done remoting before and I can't seem to find any examples that use .net. So, does anyone know how to set this up in both flash and .net? I have my .net classes compiled to a dll, I'm just not sure how to use the netconnection class to call the dll and how to set up the dll in IIS. Thanks!
Remoting In CS3 ?
Well although Remoting in Flash was always easy, it started to get harder in flash8.
Reason: you had to crawl the macromedia website to find the components which were not installed and do the installation manually.
Now, a nice surpirse in Flash CS3: Maybe I am blind, but I just can't find any of the components for AS3.
I did install the components for AS2. But, if I open an old .fla (Flash8) and compile it, it simply doesn't work:
no 'mx.data.types.RecordSet' found in package 'mx.data.types'
Of course, no documentation can be found. So.... should I install flash8 again do edit my projects?
Bad one Adobe...
</marker>
Remoting And CS3
Anyone been able to get a remoting app working (written in AS2, Flash 8) after being compiled with CS3 (Flash 9)? Or has anyone found a working example of a remoting connection written in AS3?
Cheers,
Rob
Edited: 03/02/2008 at 09:47:36 PM by YukonRob
Remoting From FMS
I've been trying to create a NetService object and use that to call and get the reply of my AMFPHP remoting gateway, but for some reason this isn't working.
I've read all the documentation I've found (not much -- apparently most want to do remoting client side, not server side), but it's not really clear how to debug the process...
Any help is greatly appreciated.
The code on the FMS main.asc file is as follows, and I've verified that the gateway does indeed work from another application (non-flash):
quote:
load("NetServices.asc");
application.onConnect = function(newClient, userKey) {
this.acceptConnection(newClient);
newClient.msgFromClient = function(msg) {
msg = '<b>'+userKey+":</b> "+msg+"<br>";
application.history += msg;
application.users_so.send("msgFromSrv", msg);
};
application.users_so.send("msgFromSrv", "rawr");
gc = NetServices.createGatewayConnection("
FMS Remoting
Hi All,
Can anyone please send me an example of FMS Remoting i.e. how to connect to an App Server from FMS.
Thanks
Php Remoting
i installed the AMFPHP Project from adobes website and i'm kinda stuck right now... i can define a variable in the actions panel and trace it as well as loops and stuff, but i can't execute any mysql. i have i feeling i'm seriously missing something, i just don't know what.
here's some code:
$dbconnect=mysql_connect($dbhost,$dbuser,$dbpass);
mysql_select_db("awards", $dbconnect);
$selectaward=mysql_query("SELECT * FROM teacher");
while ($r = mysql_fetch_array($selectaward)){
trace($r['award']);
}
knowledge on the subject will be seriously helpful, greatly appreciated, and i'll e-mail you a pizza.
Xml Remoting V3.1
Hello to all,
I am creating a Full Flash eCommerce site (Flash 8 Pro) and I need a few pointers. I have only used XML for simple tasks like Photo Gallery. Here is what I would like to use for the site....
1. PayPal Merchant Account
2. Flash Xml Remoting v3.1 by Shane McCartney
3. Flash Component PPCC 1.2 by ANYRD&D
...BUT i have no idea how to use the Xml Remoting and the documentation confuses me? Ideally I would like to have the product information i.e. (cost, description, image) in the XML file and then have flash import that. Then use the Flash PPCC component for the eCommerce stuff.
I have installed the Flash Xml Remoting Component and Downloaded the SAMPLE File... all that is on the stage is the component with instance of "xmlComm" when i test the movie i get an empty screen... the Flash Output window displays:
typeName
3
Anyone know how to use the Flash Xml Remoting Component v3.1 created by: Shane McCartney??
The Sample XML file looks like this...
<itemsList>
<items>
<label>The Amazing Description</label>
<value>12.15</value>
</items>
<items>
<label>Again an Amazing Title</label>
<value>22.50</value>
</items>
<items>
<label>Finally an Amazing Title</label>
<value>28.50</value>
</items>
</itemsList>
Here is the ActionScript:
var evtObj:Object = new Object();
evtObj.loaded = function(e:Object) {
trace(e.name);
trace(e.data.itemsList.items.length);
};
evtObj.error = function(e:Object) {
};
//
xmlComm.addListener("loaded", evtObj);
xmlComm.addListener("error", evtObj);
xmlComm.call("sample.xml", "typeName");
What am i missing?
ANY HELP would be greatly appreciated.
Flash Remoting
G'Day all,
Everytihing I read tells me that I need Cold Fusion MX to be able to use web services however I'm not convinced. Does anyone have a real life example of Flash Remoting to a web service that does not use Cold Fusion? and if so can they give me a few pointers?
Flash Remoting & Ado.net
Hi, As Im wanted to learn more about using serverside scripting with flash, and found out about the "flash remoting" and dreamweaver mx, I installed dreamweaver mx. So I opend the tute called "Introduction to Flash Remoting for .NET Tutorial > Creating the ADO.NET data binding", and it all looks very simple and practic. But what I dont understand is the database connection thing. As it appears ,I dont see any database files that the "asp.net" saves the data to. My previos and first attempt in serverside scripting was writing and reading to and from an Acces database trou asp and flash. This is the first time I hear about this "asp.net" thing, so I wonder if anyone can make it clear for me about how it works, and what files are included. Does it make flash store and read data to a singel asp file?
Flash Remoting
Must I upgrade my Coldfusion server to MX before I can use flash remoting? I just bought ColdFusion 5 for one or two months only. Can I integrate with coldfusion 5 instead and how do i do it?
Flash Remoting For .net
I have used flash remoting for coldfusion and it is a really cool tool, but I cannot believe they are charging almost a thousand dollers for the .net version??? and you have to install a dll on the server which sucks!,
I wrote an app that will query a database in flash using asp, and it's not that much slower than using flash remoting for .net. in fact I would much rather take a small speed decrease, than have to install a $1000 DLL????
what is everyone elses thoughts on this?
What Is Flash Remoting MX?
Hello Flash Gurus.
I am evaluating Flash Remoting Technology and I am thoroughly confused about what exactly Macromedia is selling in the package "Flash Remoting MX" which costs nearly $1000.
I download the 'free trial' and I get a 6 meg WAR file (after install) with docs, examples, and Flash Player. Can this really be what comes in that giant box for $1000? No Flash MX included? No JRun? How come I can download 'Flash Remoting Components' totally free? How does that differ from 'Flash Remoting MX'???
I am very confused and would appreciate someone clearing the confusion. Thanks!
-E
Flash Remoting ---HELP
Hi,
Where can i download flashgateway.jar? I know macromedia have package this file on their JRUN 4 product but i only need this file to run my j2ee apps deployed in apache server...anyone have this jar file kindly send it to me.
thanks,
mutant
About Flash Remoting
whats the difference between the flash remoting evaluation and flash remoting full version ?
thanks!
Flash Remoting
Hello, im having a few problems when i try to connect to a database by using flash remoting . This is what my NetConnection Debugger says.
Any ideas are gonna be a help.
MethodName: "/1/onStatus"
ResponseURI: (undefined)
Parameters (object #2)
.....code: "SERVER.PROCESSING"
.....description: "Could not find installable ISAM."
.....details: " at FlashGateway.Delegates.LibraryServiceAdapter.Invok eService(ActionContext action)
at FlashGateway.Delegates.ServiceCommander.InvokeAdap ter(ActionContext flashContext)
at FlashGateway.Delegates.ServiceFilter.preInvoke(Act ionContext flashContext)"
.....level: "error"
.....type: "System.Data.OleDb.OleDbException"
Flash Remoting MX
Where can I download The trial version of Flash Remoting MX other than at Macromedia? I'm trying to sign in at the macromedia site,
without succes. (They use Flash remoting for that ironically)
thxs
MX Remoting Problem
I have successfully used remoting in a number of instances but in this instance I am trying to use a function in a cfc for the first time and I am having no success.
I am to return the results of a query to Flash and populate a list box.
The code I am using is as follows:
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++
FLASH FILE:
++++++++++++++++++++++++++++++++++++++++++++++++++ ++++++++++
#include "NetServices.as"
#include "NetDebug.as"
function myService_Result(result) {
listBox.removeAll();
for (var i = 0; i < result.getLength(); i++) {
var record = result.getItemAt(i);
}
listBox.addItem(record.article_title);
}
if (inited == null) {
// do this code only once
inited = true;
// set the default gateway URL (this is used only in authoring)
NetServices.setDefaultGatewayUrl("http://<mypath>/flashservices/gateway");
// connect to the gateway
gateway_conn = NetServices.createGatewayConnection();
// get a reference to a service "News" is the cfc file
updateService = gateway_conn.getService("com.<mypath>.News", this);
updateService.myService();
}
stop();
++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++
Here is the News.cfc
++++++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++
<cfcomponent displayname="News" hint="Handles all news functions for the site.">
<!-- This function gets news regarding er related topics to supply to the site -->
<cffunction name="myService" access="remote">
<cfquery name="getUpdate" datasource="<mydsn>">
SELECT *
FROM db.news
ORDER BY article_id DESC
</cfquery>
<cfreturn getUpdate>
</cffunction>
</cfcomponent>
So far - no success. I have tested by replacing the query in the cfreturn tag with a simple string and it works fine but I can't get beyond that.
Any and all help appreciated - thanks!
MX Remoting Problem
I have successfully used remoting in a number of instances but in this instance I am trying to use a function in a cfc for the first time and I am having no success.
I am to return the results of a query to Flash and populate a list box.
The code I am using is as follows:
++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++
FLASH FILE:
++++++++++++++++++++++++++++++++++++++++++++++++++
++++++++++
#include "NetServices.as"
#include "NetDebug.as"
function myService_Result(result) {
listBox.removeAll();
for (var i = 0; i < result.getLength(); i++) {
var record = result.getItemAt(i);
}
listBox.addItem(record.article_title);
}
if (inited == null) {
// do this code only once
inited = true;
// set the default gateway URL (this is used only in authoring)
NetServices.setDefaultGatewayUrl("http://<mypath>/flashservices/gateway");
// connect to the gateway
gateway_conn = NetServices.createGatewayConnection();
// get a reference to a service "News" is the cfc file
updateService = gateway_conn.getService("com.<mypath>.News", this);
updateService.myService();
}
stop();
++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++
Here is the News.cfc
++++++++++++++++++++++++++++++++++++++++++++++++++
+++++++++++++
<cfcomponent displayname="News" hint="Handles all news functions for the site.">
<!-- This function gets news regarding er related topics to supply to the site -->
<cffunction name="myService" access="remote">
<cfquery name="getUpdate" datasource="<mydsn>">
SELECT *
FROM db.news
ORDER BY article_id DESC
</cfquery>
<cfreturn getUpdate>
</cffunction>
</cfcomponent>
So far - no success. I have tested by replacing the query in the cfreturn tag with a simple string and it works fine but I can't get beyond that.
Any and all help appreciated - thanks!
Help With Flash Remoting.
Hello,
I'm having trouble with flash remoting. Specifically with integrating flash, php and my SQL. Ok so flash uses php to get data from mysql and it returns the data to flash. Now I can get this to work just fine when all three are called from the same server. But what I want to do is serve the swf document off of my schools website and have it access mysql from my laptop. For the life of me I can't get it to work. I've been trying multible ways and even used different remoting addons. I am able to Run a php page from my school account that access' my laptop but when I add a flash front end to it, no data appears.
Please help
Flash Remoting And .Net
Hi
can anyone tell me about using Flash Remoting with .Net? My boss and I have both been researching Flash Remoting with mind to purchasing a copy, but she seems to think that it is used mainly with .Net (which we haven't upgraded to yet). My impressions from what I've read is that it can be used to integrate flash with a number of web technologies including j2ee, asp and xml based soap services, is the emphasis in integrating it with .Net, or is this a myth?
Also, is it possible to use it to directly intergrate a flash movie with a SQL database using remoting? I read somewhere that this is only possible using the firefly components, is this right?
Thanks
Flash Remoting
I have a website at www.theselfpromoter.com. This website uses coldfusion and flash remoting components. If you go to the contact form and then go to the search database feature (randomizer) data will not be retreived from the database. However if you close the website out then go to the search database feature all the data gets retrieved, but if you send me an e-mail through the contact page I won't recieve it. Any suggestions? By the way, both pages use the #include NetServices.as and #include NetDebugger.as.
|