[FlashAussie] Calling mxmlc/fcsh from PHP script

49 views
Skip to first unread message

kanu kukreja

unread,
May 3, 2010, 10:30:58 AM5/3/10
to

Hi,

My question is whether or not Flex's mxmlc can be called from within a PHP script. Here is the background:

I have been created a simple process that creates a simple quiz/tutorial by converting a text file into a .as file and compiling to a .swf file using the mxmlc compiler. This works well from the command line, but I wanted to make the process easier by creating a web-interface to do this.  I have not been able to get the mxmlc compiler to work.

After searching on the Web and on this site, I believe that using fcsh (instead of mxmlc) may be the way to go. Using fcsh would certainly compile the .mxml file faster (after the first run), and I think that fcsh can be launched as a service that might be able to be called from PHP.

On the other hand, maybe I am approaching this the wrong way. Would it be better to write a Flex application that calls fcsh/mxmlc and avoid using PHP?

Thanks

Kanu kukrejA

--
You received this message because you are subscribed to the Google Groups "Flash Aussie" group.
To post to this group, send email to flash...@googlegroups.com.
To unsubscribe from this group, send email to flashaussie...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/flashaussie?hl=en.

Phil Douglas

unread,
May 3, 2010, 5:39:30 PM5/3/10
to flash...@googlegroups.com
You'd have to stick to the php route. Flex/flash runs client side in the browser, so can't call on server side command line code. All it would end up doing is having to call on some sort of webservice written in php anyway.

Luke Schreur

unread,
May 3, 2010, 5:45:56 PM5/3/10
to flash...@googlegroups.com
You can simply call any external program from PHP by using the exec function:

http://php.net/manual/en/function.exec.php

If you're on a unix type system such a OSX or Linux, you do need to make sure that you have all the permissions right. Since the script will be triggered in the scope of the web-server you need to make sure that that scope can execute your calls.

On the other hand, I'm wondering why you're generating .as files. Are you sure you can't solve your particular problem by loading a dataset instead?

Cheers,
Luke


On Tue, May 4, 2010 at 12:30 AM, kanu kukreja <kanuk...@gmail.com> wrote:

Chris Velevitch

unread,
May 3, 2010, 8:22:53 PM5/3/10
to flash...@googlegroups.com
Once you've created the .swf file you need load it into your browser.


Chris
--
Chris Velevitch
Manager - Adobe Platform Users Group, Sydney
m: 0415 469 095
www.apugs.org.au

Adobe Platform Users Group, Sydney
May 2010: TBD
Date: 31st May 6pm for 6:30 start
Details and RSVP coming soon

kanu kukreja

unread,
May 4, 2010, 9:45:11 AM5/4/10
to

Can somebody please reply on this, i got few replies yesterday, but not relevant with the question i asked.

Wanted to run compiler mxmlc/fcsh using php to generate swf file.

Thanks

Chris Velevitch

unread,
May 4, 2010, 9:49:57 AM5/4/10
to flash...@googlegroups.com
Have you tried compiling from the command line?

What's in testing.as?


Chris
--
Chris Velevitch
Manager - Adobe Platform Users Group, Sydney
m: 0415 469 095
www.apugs.org.au

Adobe Platform Users Group, Sydney
May 2010: TBD
Date: 31st May 6pm for 6:30 start
Details and RSVP coming soon

kanu kukreja

unread,
May 4, 2010, 9:51:49 AM5/4/10
to flash...@googlegroups.com
From command line its working fine using both mxmlc and fcsh but otherwise if i try it frfom PHP using exec command then it doesn't work.

Thanks
Kanu Kukreja

Joshua Mostafa

unread,
May 4, 2010, 7:33:32 PM5/4/10
to flash...@googlegroups.com
Can you define "doesn't work", please? What output do you get?
--

Joshua Mostafa
mic...@gmail.com
+61 405563633

kanu kukreja

unread,
May 4, 2010, 10:39:29 PM5/4/10
to flash...@googlegroups.com
Blank
Reply all
Reply to author
Forward
0 new messages