HI all,i need help please..Does anyone have suceeded to call flex application from php-html files?Suppose i got html-php based web,i make a ogin form using html tags.When the user have suceeded login,the login form which was created by using flex will be shown...Please help..Thanks a lot guys...
A:
In Flex:
...
// provide an interface for javascript
if (ExternalInterface.available)
ExternalInterface.addCallback("login", jsLogin);
...
private function jsLogin(name:String, password:String):void
{
...
In Javascript
...
var name = $('#name').text();
var password = $('#password').text();
$('#swfobject').get(0).login(name, password);
Scott Evernden
2009-01-25 15:00:39
+1
A:
I'm not sure what you mean by having the HTML login form reveal a Flex login form, but if what you're trying to do is establish communication between HTML/JavaScript (however rendered, PHP or otherwise) and Flex, then what you'll want to use is flash.external.ExternalInterface.
I recently posted a complete example here that illustrates how to set things up on both ends (HTML/JavaScript and Flex), and how to get them to talk to one another. You should be able to copy-paste both code snippets into a new Flex project to see a working example, and tweak as needed from there. Good luck!
Christian Nunciato
2009-01-25 19:18:12