Php to as3

Hi.  So I have a html form and when submit is clicked, my php processes the data.  At the moment its simple, just one field displayed to the screen
Hi <?php echo htmlspecialchars($_POST['name']); ?>.
Instead of doing this, I want to send the variable name to a swf file, and load the swf file with the name.  I will use flashvars to do this.  I have seen examples, and I think this one is used to display the swf onto the webpage, and pass the data to the swf.
<object width="540" height="240" title="sample">
  <param name="movie" value="card.swf" />
  <param name="flashvars" value="var1=here&var2=are&var3=my&var4=flashvars" />
  <embed src="card.swf" flashvars="var1=here&var2=are&var3=my&var4=flashvars" type="application/x-shockwave-flash" width="540" height="240" ></embed>
I am not sure what it is really doing, and what I should change the value to in order for my name variable to be passed.  Any info greatful.
cheers

What is the purpose of that ENTER_FRAME activity you have at the start?  That will continuously be calling myFunction, without end.  If it is only intended to kick things off, then get rid of it and just use what's in the function itself...
myString=someVar;
loadImage(myString);
Then, increment your counter before you go test it....
counter++;
if(counter<myString.length){
       loadImage(myString);
As far as loading into an embedded swf file (swf in an html file), If the two files normally exist in the same folder, normally meaning the files were published that way, then there should be no targeting issues for files that the swf loads.  But if the swf is in a different folder than the html file, then its target of images that it loads needs to be adjusted as if it is in the html file's folder.

Similar Messages

  • Passing variables from PHP to AS3

    I am trying to get variables retrieved from a MySQL database
    by a PHP script into my ActionScript 3.0. script. To test I have
    created a simple instance of dynamic text called date_txt, and put
    the AS3 code below into the actions layer:
    All I want to do now is replace the hardcoded date values
    with variables passed from the PHP script (also shown below).
    Can anyone suggest a VERY simple way of passing the PHP
    variables $tgt_year, $tgt_month and $tgt_day into the AS3 code and
    let me know what modifications I need to make to the PHP to make
    the variables available to Flash?
    Thanks, Will

    Hi dzedward,
    I tried the code you posted at
    http://forums.flashgods.org/viewtopic.php?f=41&t=98
    with a little problem. Why is it that the value from event.data
    after complete loading has the value of the entire script of PHP
    script?
    At first, I have this error:
    The markup in the document following the root element must be
    well-formed.
    I replace the following codes: ########
    XML.ignoreWhitespace = true;
    var theResult:XML = new XML(event.target.data);
    var lastName = theResult.client.lname;
    With this one: ########
    trace(event.target.data);
    and has this output: #########
    <?Php
    echo "<?xml version=\"1.0\"?><clients>";
    echo "<client><lname>test
    sdfsaf</lname></client>"
    echo "</clients>";
    ?>
    instead of this output: #########
    <client><lname>test
    sdfsaf</lname></client>
    Please help me out.
    Thank you

  • Communication from php to as3 in AIR

    Gidday guys
    I have an AIR desktop app that uploads a csv file to the server. Php parses the csv through several different stages (one script containing different parsing processes).
    Php sends back a 'print' status to say if the process succeeds or not.
    What I'm wondering - is it possible to send back print statements throughout the script's processing? So a print statement after process 1, after process 2 etc? Or would I have to split the single script into multiple processes?
    I set up multiple print statements in different sections of the php script, but it sends all them after the entire script has processed.
    Cheers

    Close - there are several for-loops, but rather than a percentage update during the loops, I just want to send a var back after each loop is done.
    I use these listeners to display a progress bar while the file is uploading, and check in AS3 for when event.bytesLoaded == event.bytesTotal, and when it does turn off the progress bar and display a generic animated progress image. I figured I could then fire back vars in between each php loop which I could filter in AS3 using switch to display the appropriate message - Stage 1, Stage 2 etc.
    myFile.addEventListener(DataEvent.UPLOAD_COMPLETE_DATA, completeFunc,false,0,true);
    myFile.addEventListener(IOErrorEvent.IO_ERROR, displayErrorMessage);
    myFile.addEventListener(ProgressEvent.PROGRESS, uploadProgress);

  • Server site php and As3 data

    Hi,
    I am new in php coding. I want to get image data from php and also display in flash.
    I want to know... how to read and display imagejpeg( $imgData ); from php.
    I am able to get php data in flash through below method...
    /* AS3 */------------------
    var src:String = "pic.jpg";
    var width:String = "250";
    var height:String = "250";
    var urlReq:URLRequest = new URLRequest(src);
    var urlLoader:URLLoader = new URLLoader();
    var urlVar:URLVariable = new URLVariable();
    urlVar.src= src;
    urlReq.mehtod = URLRequestMethod.POST;
    urlReq.data = urlVar;
    urlLoader.load ( urlReq );
    urlLoader.addEventListener(Event.Complete, doneProcFnc)
    function doneProcFnc(ev:Event):void{
          trace ( "data access from php done" );
    /* PHP */
    $src = $_POST [ 'src' ];
    $wd = $_POST [ ' width' ];
    $ht = $_POST [ ' height' ];
    /*  this function will create one black color area for croping refence */
    $cropImg = imagecreatetruecolor ( cropImageWd, cropImageHt );
    /* this function will reproduce particular image required width and height without reducing the image quality */
    imagecopyresampled ( cropImage , sourceImage, destX , destY, sourX, sourY, ect... );
    imagejpeg( $imgData ) ;
    Now, here the problem comes. I don't know how to display that imagejpeg data into flash.
    I need help.
    Thanks.

    Thanks.
    No.No.No. I am not loading image from folder.
    step1 : I m sending some image information to php (src , width , height)
    step2 : PHP code will take that information
    step3 : PHP code will crop that particular image (some calcution for quality)
    step4 : PHP code will generate some image data that is /* imagejpeg( $imgData ) */ and return back to flash
    step5 : Now the problem occur, how can i take that image data in flash or what form
    Possibilities :
    ? should i get image data as text format and it needs to be encoded (like jpeg encoder)
    ? i don't know i already try jpegencoder but i did not get anything
    var src:String = "pic.jpg";
    var width:String = "250";
    var height:String = "250";
    var urlReq:URLRequest = new URLRequest(src);
    var urlLoader:URLLoader = new URLLoader();
    var urlVar:URLVariable = new URLVariable();
    urlVar.src= src;
    urlReq.mehtod = URLRequestMethod.POST;
    urlReq.data = urlVar;
    urlLoader.load ( urlReq );
    urlLoader.addEventListener(Event.Complete, doneProcFnc)
    function doneProcFnc(ev:Event):void{
              trace ( "data access from php done" + ev.target );
            // imagejpeg( $imgData )
    /* PHP */
    $src = $_POST [ 'src' ];
    $wd = $_POST [ ' width' ];
    $ht = $_POST [ ' height' ];
    /*  this function will create one black color area for croping refence */
    $cropImg = imagecreatetruecolor ( cropImageWd, cropImageHt );
    /* this function will reproduce particular image required width and height without reducing the image quality */
    imagecopyresampled ( cropImage , sourceImage, destX , destY, sourX, sourY, ect... );
    imagejpeg( $imgData ) ;

  • AIR doesn't communicate with my server - PHP issue

    Hello,
    So I have made an AIR application where the file communicates with a PHP file in order to display data.
    I have WAMP installed on my computer, and the application works when I test locally using WAMP but if I upload the php on an online server(I tried on two of my servers) and run the AIR application it seems that it doesn't communicate with the server so no data are displayed.
    var url:URLRequest = new URLRequest("http://www.test.com/test.php")
    This is how I call for the php on AS3, like shown above.
    Any suggestions?
    The php file gives no errors when I browse it online so, I suppose there something else going on?

    There are no errors, on either the php files stored online neither the flash swf.
    The only file scalled from an online server are the PHP.
    I suppose I don't need to pack these PHP when publishing the air file, since they need to be called from an online server?
    Very tricky since there are no errors, I would appreciate any help since this is an urgent project.
    //EDIT:
    So I just removed the http:// from the urlrequest to the site that the PHP is stored and I get this IO error:
    Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: app:/test.com/test.php
    at my_fla::test_1/setPHP()[my_fla.test_1::frame1:38]
    Notice the app:/ ? why is it there? Could it be the issue? I am not sure, but if you link to a local file, like "test.php" it works, but when adding a URL it doesn't...

  • Question about send/receive data in as3

    hello
    i want to ask : how can i send data from flash to php using as3 and receive data from php using flash .
    and another question : how can i upload files using as3 .
    thank you .

    Look into URLLoader documentation for sending/receiving and FileReference for uploading:
    http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/net/URLLoader.html
    http://www.adobe.com/livedocs/flash/9.0/ActionScriptLangRefV3/flash/net/FileReference.html

  • Class Based SWF will not work in PHP page

    hello everyone,
    i really hope someone out there can help me with an issue i
    have come across with PHP and AS3.
    i basicly have Made a Class called CrossFade, that fades in
    and cross fades to the next image that are loaded Via an XML file.
    now this SWF works fine in a regular HMTL setting on the
    server, so i know the path to everything is correct. But when it
    comes to being embedded into the PHP page, it just won't work.
    the Files are all contained in a Folder called Banner, the
    SWF is linked the the CrossFade.as class, and the images and XML
    are also located within the Banner folder. and again seeing as its
    working in the HTML setting i know everything is fine.
    can you think of anything that PHP would do to cause this to
    not function? i dont know enough about PHP to figure this out, and
    there isn't much support out there in terms of this issue.
    I would love to hear from anyone that can help or weigh in
    with a suggestion.
    thanks for your time.

    http://www.toptable.ca/media_flashtest.php
    this is the test php page, you can see that the flash banner
    is there, but nothing is going on. no request to the server for the
    new images as you would see normaly with teh AS running.
    http://toptable.ca/swf/banner1/index.html
    <--- this is the HTML page that i sent to them for testing. you
    can see that its working and everything is fine.
    they are, in both cases, all housed in the same folder, and
    unless there is something going on in the PHP page that i don;t
    know about, the paths to the XML and the images and the AS files
    should be the same?

  • Load XML file from addon domain without cross-domain Policy file

    Hello.
    Assuming that there are two addon domains on the same server: /public_html/domain1.com       and      /public_html/domain2.com
    I try to load XML file from domain2.com into domain1.com without using cross-domain policy file (since it doesn’t work on xml files in my case).
    So the idea is to use php file in order to load XML and read it back to flash.
    I’ve found an interesting scripts that seems to do the job but unfortunately I can't get it to work. In my opinion there is somewhere problem with AS3 part. Please take a look.
    Here are the AS3/PHP scripts:
    AS3 (.swf in www.domain1.com):
    // location of the xml that you would like to load, full http address
    var xmlLoc:String = "http://www.domain2.com/MyFile.xml";
    // location of the php xml grabber file, in relation to the .swf
    var phpLoc:String = "loadXML.php";
    var xml:XML;
    var loader:URLLoader = new URLLoader();
    var request:URLRequest = new URLRequest(phpLoc+"?location="+escape(xmlLoc) );
    loader.addEventListener(Event.COMPLETE, onXMLLoaded);
    loader.addEventListener(IOErrorEvent.IO_ERROR, onIOErrorHandler);
    loader.load(request);
    function onIOErrorHandler(e:IOErrorEvent):void {
        trace("There was an error with the xml file "+e);
    function onXMLLoaded(e:Event):void {
        trace("the rss feed has been loaded");
        xml = new XML(loader.data);
        // set to string, since it is passed back from php as an object
        xml = XML(xml.toString());
        xml_txt.text = xml;
    PHP (loadXML.php in www.domain1.com):
    <?php
    header("Content-type: text/xml");
    $location = "";
    if(isset($_GET["location"])) {
        $location = $_GET["location"];
        $location = urldecode($location);
    $xml_string = getData($location);
    // pass the url encoded vars back to Flash
    echo $xml_string;
    //cURLs a URL and returns it
    function getData($query) {
        // create curl resource
        $ch = curl_init();
        // cURL url
        curl_setopt($ch, CURLOPT_URL, $query);
        //Set some necessary params for using CURL
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
       //Execute the curl function, and decode the returned JSON data
        $result = curl_exec($ch);
        return $result;
        // close curl resource to free up system resources
        curl_close($ch);
    ?>

    I think you might be right about permissions/settings on the server for php. Unfortunately I'm not allowed to adjust them.
    So I wrote my own script - this time I used file path instead of http address of the XML file.  It works fine in my case.
    Here it is:
    XML file on domain2.com:
    <?xml version="1.0" encoding="UTF-8"?>
    <gallery>
        <image imagePath="galleries/gallery_1/images/1.jpg" thumbPath="galleries/gallery_1/thumbs/1.jpg" file_name= "1"> </image>
        <image imagePath="galleries/gallery_1/images/2.jpg" thumbPath="galleries/gallery_1/thumbs/2.jpg" file_name= "2"> </image>
        <image imagePath="galleries/gallery_1/images/3.jpg" thumbPath="galleries/gallery_1/thumbs/3.jpg" file_name= "3"> </image>
    </gallery>
    swf  on domain1.com:
    var imagesXML:XML;
    var variables:URLVariables = new URLVariables();
    var varURL:URLRequest = new URLRequest("MyPHPfile.php");
    varURL.method = URLRequestMethod.POST;
    varURL.data = variables;
    var MyLoader:URLLoader = new URLLoader;
    MyLoader.dataFormat =URLLoaderDataFormat.VARIABLES;
    MyLoader.addEventListener(Event.COMPLETE, XMLDone);
    MyLoader.load(varURL);
    function XMLDone(event:Event):void {
        var imported_XML:Object = event.target.data.imported_XML;
        imagesXML = new XML(imported_XML);
       MyTextfield_1.text = imagesXML;
       MyTextfield_2.text = imagesXML.image[0].attribute("thumbPath");  // sample reference to attribute "thumbPath" of the first element
    php file on domain1.com:
    <?php
    $xml_file = simplexml_load_file('../../domain2.com/galleries/gallery_1/MyXMLfile.xml');  // directory to XML file on the same server
    $imported_XML = $xml_file->asXML();
    print "imported_XML=" . $imported_XML;
    ?>
    Regards
    PS: for those who read the above discussion: the first and the second script work but you must test which one is better in your situation. The first script will also work between two domains on different servers. No cross domain policy file needed.

  • Function Consolidation Help

    Okay,
    I know there has to be an easier way to write this.
    Can someone please point me in the right direction?
    There has got to be a way to use 1 function and some type of
    variable to make to add the new sprites from an array with a for
    statement. I just don't know how. Any help would be greatly
    appreciated.
    Thanks,
    Wayne

    I have the fla file posted in another forum that I asked help
    for and someone asked me to post it but never replied back after I
    did.
    Here is the link. This will probably answer some of your
    questions better than I can.
    http://www.actionscript.org/forums/attachment.php3?attachmentid=24206&d=1191129053
    The fla file will have my working code in it. I took this
    same file which has my code in it and replaced it with your code.
    Hope that helps.
    Wayne
    I also added some more code as well just in case this
    matters.
    I plan on adding a script in there that detects what webpage
    you are on from FlashVars. I have this working already however it
    is not in that fla file.
    You can see an example here:
    Flash
    Vars Example
    I am using a PHP page to detect the webpage. I am storing
    that into a FlashVar and passing that Flash. I am then using that
    information to see what webpage we are currently on and placing the
    corresponding button into a down position.
    Here is that PHP and AS3 code as well if you need it. (I
    don't know that you will but just in case).

  • Include_once problem.

    Hello,
    On my flash site, I sent vars to a php file call 'controlpanel.php' with will retrieve data from mySql, etc.
    It works fine except in the php code the first line is
    include_once "connect.php";   //it connects to mysql with my username, pass, etc
    So unless the user open up connect.php before controlpanel.php  nothing going to be retrieved.
    I can have code in as3 to open new browser window for connect.php, then have user go back to site to continue.
    But this way sucks it's so unprofessional I don't like it.
    Is there a way I can open connect.php in as3 without opening any new window?
    I tried this code:
    var loader:URLLoader = new URLLoader();
                loader.addEventListener(Event.COMPLETE, processCreate("createprofile"));
                loader.load(new URLRequest("php/connect.php");  // so it should loads connect.php before the next step
    Technically it works but it also give me error "1069: Property sysytemResult not found on String and there is no default value"
    I suppose that mean loader function suppose to pass values to php but there are none in my function.
    But I don't want to pass nothing, all I want is to open connect.php once in the back.
    Any idea? Thanks a lot.

    the weird thing is this destop doesn't have this error it works fine with some minor cliche, only my laptop has the error.
    The minor cliche I refered to is that on second scene where it supposed to show the 'fname' that was input from the previous scene.
    It would only show 'fname' if user's account is in MySql, if not it's new account it won't show anything.
    Please try out my test site:
    http://www.mixacase.com/test/AS3.php
    Try type in something new, then on second page you'll see first line showing your First Name follow by 's account, but second line is empty because second line is suppose to grab the First Name field from MySQl
    now refresh, and input exactly what you just typed, this time on page 2, the second line will show your First Name.
    I called this the 11th wonder..

  • I have a thesis project that must involve Flex

    Hey guys, I'm trying to think of a useful Flex (possibly AIR deployed) application idea for a thesis project I'm doing in school this year. Problem is we have to have and present our idea prior to having any classes on Flex yet which makes it somewhat hard to think of the possibilities. We've had one intro class and I got to play with it and get a nice idea of it during an internship in England over the summer.
    So far I have one decent vague idea and one very very vague ideas and I'm just looking for some insight as to if my ideas are even possible/worth it and any ideas you may have that I could try!
    My first idea is to build an 'image gallery builder'. So an app for someone who has no knowledge or experience in web design and wants say an image gallery on their website.
    For eg: A hardware store owner has a website and would like customers to able to easily navigate the store’s inventory in an image gallery displaying images of products for sale.
    So my app would allow him to use a WYSIWYG interface that allows him to manipulate all the properties of a gallery with some sort of completely dynamic changeable base gallery layout. So with all sorts of visual buttons and such the user can change whatever feature of the gallery they would like. Thumb nail sizes, carousel types, headers, content text, colors, content layout etc. And everything they manipulate they can see a it change on the fly.
    A lot of other gallery builders I see out there are very ugly and have very minimal options if you know what I mean.
    What do you think? Is this something incredibly hard to do? does it make sense? That's as far as I've thought it with my minimal knowledge in Flex as of now.
    My other ideas was do something with Flex and the Google maps SDK/API to create an interactive map to visualize geographically-based data that user can work with sorta thing.....haven't really thought that one much further...
    Do you guys have any neat Flex application ideas I can consider?
    And of course using Flex I have a good amount of knowledge (for a third year student) in XHTML,CSS,JS,PHP,MySQL,AS3.0

    No.  Are you saving the project as a disk image rather than burning directly to disk from iDVD?  If not then that's what I suggest you do.  That will separate the encoding process from the burn process to save time and disks if the encoding is bad.  It also lets you burn a second or third disk without having to encode again.
    OT

  • Extending the proxy class to do this...

    I spend too much time in PHP as my last post states. associative arrays seem really powerful. but one feature of PHP NOT in AS is Magic methods. I have been doing some reading on line and while this doesnt seem like something youd want to do, to do something like this:
    __get($value){
       someGetMethod($value)
    which is from PHP, in AS3 it would be something like:
    dynamic class Example extends Proxy
       flash_proxy overide function get(value:String):String
           try{ someGetMethod(value:String);}
          catch(e:Error){//bla}
    is this remotly correct? or am I missing the whole concept? I was reading the proxy refrence from the API for Actionscript 3.
    here I am trying to redefine the way the get function works like you can in PHP. But I might be misunderstanding something here or in PHP or even in both...

    Yes, for the nose-gear the tires are in deep shadow and are also deflected by the weight of the aircraft. There is some deflection in the in the fuselage gear's tires, but not so prominent. With an Adjustment Layer, just to try and get into those shadows, one could make a good Selection via Paths. Since I was on the laptop, and watching the AT&T/Pebble Beach, I was too lazy to hook up the tablet, or move up to the edit suite for more careful work. At least with a Layer Mask, one can non-destructively enhance things pretty well. A high-rez PSD would have been great too.
    One of the real problems, and maybe something that one would want to fudge on, is the tires' deflection. If one does a knockout, then visually there is no reason for the tires to deflect - maybe trim that off, as though the ship was in the air, but with the gears still down.
    I also did not go into some of the hydraulic lines - Pebble had my attention...
    Now, did you see the airman crouching to the right of the fuselage gear? During the exposure he moved a bit, and was also in the shadows. I assume that the OP would want him gone too, but if not, he could be "painted back in," with alterations to the Layer Mask.
    Considering the ragged edges now, the hydraulic lines, the choice on the tires, etc., I'd guess that it'd take an hour, or two, to clean things up. This was just a start. If someone is learning PS, I think that the extra hours for the cleanup would be a nice drill. They'd get to use Layer Masks, the Pen Tool and Paths to a Selection, QuickMask Mode and painting-in/painting-out on it, Adjustment Layers to peer into the shadows and then judicious use of the Blur Tool on the edges of the Layer Mask. Classroom in a Book, in one image... Well, not quite, but a lot of stuff to play with, none the less.
    Hunt

  • AS3 to PHP to MySQL issue

    I have searched for a solution over many forums and none of the code seems to work. I cannot get AS3 to work with a php script.
    I am trying to create a registration form in AS3
    and then have that information go to mysql database when
    the submit button is pressed. Here is part of the AS3 code: var variables:URLVariables = new URLVariables;
    var varSend:URLRequest = new URLRequest("register.php");
    varSend.method = URLRequestMethod.POST;
    varSend.data = variables;
    var varLoader:URLLoader = new URLLoader;
    varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
    variables.userName = user_txt.text;
    variables.userPass = pass_txt.text;
    variables.userEmail = email_txt.text;
    varLoader.load(varSend); Here is the php script "register.php": <?php $db_host = "localhost";
    $db_username = "root";
    $db_pass = "";
    $db_name = "userregister"; mysql_connect("$db_host","$db_username","$db_pass" ) or die ("could not connect to mysql");
    mysql_select_db("$db_name") or die ("no database"); $senderName = $_POST['userName'];
    $senderPass = $_POST['userPass'];
    $senderEmail = $_POST['userEmail']; $sqlCommand = "INSERT INTO user (username, password, email)
    VALUES('$senderName','$senderPass','$senderEmail') "; $query = mysql_query($sqlCommand) or die (mysql_error()); $my_msg = "Thanks $senderName, all data has been sent."; echo "return_msg=$my_msg"; ?>

    there's no problem with your flash if your textfields are passing the correct values.
    you have a table named user and it's failing to add passed variables?   if yes, use fixed strings (instead of passed variables) in your php and test your php code.

  • How to get this PHP list in Flash AS3?

    Hi,
    I have the following PHP code (downloaded from net) which builds a list of all the files in a "MyPics" folders:
    PS php can build a list of all the files in a folder so you don't have to type them all out like that, plus it makes updating a sinch all you have to do is put a pic in the folder and it will be added to the list.
    PHP Code:
    <CODE>
    <?
    //this function goes through the defined directory and makes a list of all the files
    function parse_dir($dir,$level){
        $dp=opendir($dir); //opens the directory for reading
        while (false!=($file=readdir($dp))){  //runs until no more files
            if ($file!="." && $file!=".." && $file!=".htaccess"){  //so you don't get all the default folders
                $countervar=$countervar+1;  //just a counter for numbering the path names
                if (is_dir($dir."/".$file)) parse_dir  //recurses the subdirectories
    ($dir."/".$file,$level+1);
                else print "&path".$countervar."=".$dir."/".$file;  //pieces together something flash can read
    $start_dir="pathToMyPics";  //put the name of the folder with all the pics here
    $level=1;
    parse_dir($start_dir,$level);
    ?>
    <CODE/>
    The above php will output something like this
    &path1=pathToMyPics/pic1.jpg&path2=pathToMyPics/wowWhatAWierdPicName.jpg
    call the php in flash( loadVariables("fileListPHP.php") ) and viola you get easy to use paths to all you pictures.
    I am not able to understand the code to write on FLASH AS3 frame. Please help.
    Thanks.

    In AS3 you want to use the URLVariables class.  Search Google using "AS3 URLVariables tutorial" and you should find what you need to get going.  Here's one result from that search...
    http://www.metah.ch/blog/2008/01/using-urlvariables/

  • Would PHP or Python work more efficiently to grab from a MSSQL database in AS3?

    Would PHP or Python work more efficiently to grab information from a MSSQL database in AS3? How would it work? Thanks!

    that's not a flash issue. 
    but here's a comparison, http://benchmarksgame.alioth.debian.org/u32/benchmark.php?test=all&lang=python&lang2=php
    which looks like python would be faster at data handling and slow at arithmetic operations.
    you would call both server-side scripts using the urlloader class from flash.

Maybe you are looking for