Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
By delooks on
I would like to develop a flash site with drupal as a backend, so i have installed drupals services and the module afmphp. But how can i call a service with flash. The Tutorial on the services module projekt homepage only shows how it works with flex.
I've used the following Actionscript but flash says: Error opening URL "http://muster.delooks.at/services/amfphp/"
import mx.remoting.*;
import mx.rpc.*;
import mx.remoting.debug.NetDebug;
var gatewayUrl:String = "http://muster.delooks.at/services/amfphp/"
NetDebug.initialize();
var _service:Service = new Service(gatewayUrl, null, 'view', null , null);
var pc:PendingCall = _service.getView("recipes_all", ['title']);
pc.responder = new RelayResponder(this, "handleResult", "handleError");
function handleResult(re:ResultEvent)
{
trace('The result is: ' + re.result);
}
function handleError(fe:FaultEvent)
{
trace('There has been an error');
}
Comments
Did you install all the required?
There is something that needs to be installed together with Macromedia Flash (Actionscript remoting components).
~Kiam
A little question...
From what I understand in your example, you have a view.php file that contains a PHP class named view, which must be in the {servicefolder} (as stated in http://www.amfphp.org/docs/creatingclasses.html). Is that what you really have?
I think AMFPHP doesn't integrate in Drupal, and that you should write some classes to integrate them.
~Kiam
theres a module for amfphp
AMFPHP is integrated in my Drupal installation with the amfphp module. See http://drupal.org/project/amfphp
Then there is under the administer menu in drupal a new menupoint "Services" in which i can modify(API Key Preferences,...) the classes.
Heres the Tutorial for Flex: http://drupal.org/node/118136
And now how can i call in Flash the Class view.getView()
The Flex Method:
Bump
I would love to know the same.
delooks - I've poked around the amfphp browser and see that the new version (not the one they recommend to install) has an option to go between amf0 and amf3 encoding. I'm assuming unless you are using flash cs3, this is never going to work natively with the current AMFPHP version.
I really hope they do remember the as2 world.
Until then I am trying to plug the latest amfphp beta 2 into drupal.
http://www.5etdemi.com/blog/archives/2007/01/amfphp-19-beta-2-ridiculous...
Thanks
Here's a bit of code to help
Here's a bit of code to help you out. As long as you have the AMFPHP and services modules installed correctly, this will work with Flash 8 or Flash CS3. You also have to have the remoting classes installed and then place the remoting components in your .fla library. Once you have them installed you can use the NetConnection Debugger within flash to see the results of all of the calls.
Some other things to check are to make sure that you the services module configured correctly. In Drupal, go to Site Building/Services/Settings and uncheck "use sessid" and "use keys".
You'll have to plug in your own values, but this setup works great for me:
Not working with local webserver?
Hi,
I have the Flash -> amfphp connection working when connecting to a remote install of Drupal.
I can't get it to work on my local machine though, where I'm running a development version of Drupal using XAMMP.
There is always an error returned when trying to connect to a Drupal service from Flash 8:
Error opening URL "http://drupal.development/services/amfphp"
I realise this is to do with Flash's security settings, but I can't find a way to get round it. Anyone know what settings to use?
Thanks.
Hi
Hi
I get the same error...
I have tried this policy crossdomain file but don't work:
i get:
Error opening URL "http://localhost/services/amfphp"
Please help us..
How is your drupal
How is your drupal installation used in this setup? Do you have it in it's own folder within your htdocs directory? If so, you would need to use something like this:
http://localhost/drupal/services/amfphp
Mine seems to be working
Mine seems to be working now. I think it was to do with my Apache setup.
I'm using eclipse for development, and followed the steps here for setting up a drupal development environment:
http://www-128.ibm.com/developerworks/ibm/osource/implement.html
That seemed to do the trick.
Error opening URL "http:// ..." after second call
I got the second call (after the first one) that gives me this error but if I test them separately everything works correctly.
Anybody could help ???
Thank you
Paolo
I'm stuck with the same
I'm stuck with the same problem. Did you find the solution?
Boo boo in code
Think there is a boo boo in your code
var _service:Service = new Service(gatewayUrl, null, 'view', null , null);
Should be
var _service:Service = new Service(gatewayUrl, null, 'views', null , null); // views with an s
right?
Good luck all
David Tinnes
Also, make sure to check
Also, make sure to check "access services" for anonymous users under "access control" within drupal. Otherwise flash will not be able to connect.
not sue if it is a coincidence
but that is the most helpful thing I have seen for a week - do you know of any other as2 friendly implementations/resources?
Boomshanka 'n that
Problem in getting variable from Drupal to Flash AS2
Hope someone here can englightened me..:P
I made this simple service and flash remote connection with AMFPHP/Drupal. The connection is ok, but in flash I can't seem to get variable that was send from the PHP service. I'm using Flash AS2.
I intend to get a game score from user who login on the website.
Here's the PHP service module: (filename is: gamestats.module)
And here's the AS2 code:
In the gamestats table, there is column uid with "1" value, and column score with "1000" value.
When I'm running the Drupal Service Browser, the output can be seen. It's "1000", meaning that PHP service I made was correct.
However when I publish the AS2 file, the output is always null.
Anyone can help me out with this?
Thank You
PITRA