views:

24

answers:

2

How can wirte php script in flex application ? . at the same time this script can be asp.net,javascript ...

A: 

Can you clarify your question?

I normally wouldn't write a PHP script in a Flex application, but rather use PHP [or .NET or Java or ColdFusion] to act as the service layer between Flex and a database.

JavaScript and Flex can work together if you hse the Flex ExternalInterface class to acccess a JavaScript method, however JavaScript serves a very different purpose than a server side language.

www.Flextras.com
+1  A: 

No, you can't do that. PHP runs in the server and Flex runs at the client, the browser. Scripting language for Flex is ActionScript-3.

May be you're confused because you've seen HTML and PHP together in same file. The PHP parser executes the scripts in those files every time a page request comes to generate dynamic HTML/CSS/JavaScript and sends it to the client.

Flex, on the other hand, is compiled from mxml/actionscript source files using the mxmlc compiler into the binary SWF which is stored at the server (it is static as opposed to the dynamic HTML pages generated by PHP etc). The Flash plugin at the client loads and plays this SWF. As you can see, PHP or any server side language doesn't come into the picture here.

Amarghosh