Cairngorm Login (HTTPService example with PHP)
I wanted to address some of the Cairngorm-related issues people are writing to me about – they mainly involve the Service class and how to retrieve data from a WebService or HTTPService.
Here is a quick working example of the Cairngorm Login sample application which uses HTTPService with a very simple PHP script.
Right-click for the source code. I’ve commented it and included the php (don’t overlook the readme.txt in the same folder which tells you where to put the php).
When looking at the Flex code pay special attention to the LoginDelegate.mxml and Service.as classes.
Edit: I don’t seem to be able to get this working nicely with the “KLM FlashEmbed” WordPress plugin I’m using – even if I use a hard-coded url to the php (yes, I’ve changed it from localhost ;) ).
You can still right-click the application above to get the source.
If you want to see a working example of the application, go here (but you can’t right-click it for source).
If anyone has resolved this issue before please let me know – cheers
7 comments
7 Comments so far
Leave a reply
Hi,
loving your blog. Great stuff.
However, I was wonderig if you could expand on this a little. This is exactly what I am after, however, I am trying to use amfphp1.9
I am not sure where defining my, for example..
/>
And how it all works in with your examples.
Could you please point me in the right direction?
THanks,
James
The code appears to have been ripped out..
I was mentioning where I have
mx:RemoteObject id=”loginRO” destination=”empService” source=”Myservice” fault=”faultHandler(event)” showBusyCursor=”true”
mx:method name=”LoginService” result=”resultHandler(event)”/
/mx:RemoteObject
Taken out character I feel did not work in the initial post.
Thanks,
James
This is a great simple example. The comments in your code were especially helpful. Thanks.
Viewing source and clicking on php results in 500 error
http://nwebb.co.uk/nwebb_example_code/cairngorm_login_php_example/srcview/source/php/login.php.txt
Is it available for viewing?
Hi Alonzo, yes you just need to download the zip file (see bottom of the left-hand pane in srcview – http://nwebb.co.uk/nwebb_example_code/cairngorm_login_php_example/srcview/)
Ah too obvious. Thanks muchly.
thanks for the post neil…it helped me in my application..
i know it’s a old post but regarding the PHP file not accessing using KIMILI flashembed pligin, i didn’t have any problem…i’ve created a sample post here if you want to check:
http://ravimarella.com/getriaed/?p=3
thanks for the post again..
cheers,
ravi