Determine when a php script has run, then continue in actionscript

I  want to run a php script before continuing to processs any more a.s. because the php script creates an xml file on which the a.s. depends. In addition, I need to send a variable to the php script that tells it what kind of xml script it will create.
(i suppose I could just add the rest of the a.s. into a later frame but that sounds like a method when all else fails)
Here's how it works in detail:
1. someone clicks on the "oil" button which means they want to view all the images in the "oil" gallery.
2. A php script creates an xml that includes only the oil images (that''s the variable it must receive from Flash "oil").
3. The php script finishes its job before a.s. script continues
Here's how I started but I'm not even sure what type of "event" is used to listen for a finished php script or where to put the variable parameter:
oil_btn.addEventListener(MouseEvent.CLICK,xmlGenesis);
function xmlGenesis
(evt:MouseEvent):void{
    var urlRequest:URLRequest= new URLRequest
    ('xmlGenesis.php');
    navigateToURL (urlRequest);
thank you for your assistance
chop

Well, after a few hours of looking around the Internet and in reference books and at the example you indicated, I finally managed to nail the pieces together to get something that works... just before I decided to start drinking again. whew! It works!
var myVariables:URLVariables = new URLVariables();
myVariables.gallery = "nature";
var myURLRequest:URLRequest = new URLRequest("xmlGenesis.php");
myURLRequest.data = myVariables;
var ulLoader:URLLoader= new URLLoader();
ulLoader.addEventListener(Event.COMPLETE,xmlComplete);
ulLoader.load(myURLRequest);
function xmlComplete (ev:Event):void{ // finished creating xml file
do everything else
thank you
That which doesn't kill us makes us stronger.
Friedrich Nietzsche

Similar Messages

  • Uploading a file using a php script while running application with LCDS

    Hi! I developping an application under Flex 2 / Java -
    running on LCDS / JRun server.
    I'm trying to add uploading capabilities. I'm using a php
    script for the upload part.
    First, I just try to put script on the app directory. Doesn't
    work.
    After that I set up an apache server from where I put a small
    web site with my script. It's telling me that my file is
    succesfully uploaded, but I can't find the file. The apache log
    give me no error.
    Someone can help me?

    Originally, I had problems w/ the file being placed in
    C:/whatever.ext b/c I wasn't using relative paths.
    This is the code I use:
    $MAXIMUM_FILESIZE = 1024 * 1024 * 2; // 2MB
    $newFileLoc = "./wherever/file.jpg"
    if ($_FILES['Filedata']['size'] <= $MAXIMUM_FILESIZE) {
    move_uploaded_file($_FILES['Filedata']['tmp_name'],
    "./temporary/".$_FILES['Filedata']['name']);
    rename( "./temporary/".$_FILES['Filedata']['name'],
    $newFileLoc );
    chmod( $newFileLoc, 0777 );
    Modified from this article by Adobe:
    http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Live Docs_Book_Parts&file=17_Networking_and_communications_173_6.html

  • Determine when Counter Pulse Generation has been digitally triggered to start

    A counter task has been configured for continuous pulse generation with a digital edge start.  How in LabVIEW can I determine when an external digital trigger has been received and the counter started ?  It seems that a timed loop with DAQmx Create Timing Source wired to its source could be made to work but I cannot figure out how or the most appropriate instance to use.  I would simply stop the timed loop once the counter start had been detected.
    Steve

    Querying the output state and looking for a change would probably work for many typical square-like pulsetrains.  If you have an extreme duty cycle like 1% or something though, your queries are likely to keep finding the counter in the same output state long after pulses have started.
    Some other ideas of a similar nature may work better, though I'm not near a LV machine to test them.  I can vouch for idea #1 from past usage though.
    1. Query the counter's 'count' property and look for a change.  You're pretty unlikely to query the same count value several times in a row during pulse generation.
    2. You could try querying the DAQmx property for "TotalSamplesGenerated" and look for a non-zero value.  I'm not sure if this gets updated for counter outputs though.
    3. Counters also have a property called "TC reached?" where TC means terminal count.  When you query and get a True, It automatically resets itself back to False until reaching TC again.  Again, while I know this works for counter input tasks, I'm not sure if it gets updated for counter outputs.
    -Kevin P.

  • Determine when a QT video has finished playing w/ javascript

    I need to determine when a video clip is finished playing so that I can trigger a function to perform other actions. I can find functions on how to monitor loading & that sort of stuff. But, I can't find a way to monitor when it's finished playing.
    The video clip will be loaded 100% first, then played without any controls (forced to play through), and then hopefully have a function to play it.
    I could always try to determine that if it's a 30 second clip that 30 seconds after it's loaded 100% to perform the action, but I'd rather just have something monitor when it's finished.
    Any suggestions?
    Thank you,
    scott

    Hi Tracy thanks for your reply!
    Yep sorry I know swfloader cant play video but what I have is
    actually a music video swf.
    Would you be able to give me a small example of how i can
    listen for that event please because I have tried listening for a
    'complete' event but it never gets fired?
    Many thanks
    Flexchief

  • Determine when a signal changes state and then evaluate second channel

    Ok, I need some help from you math geniuses (or those that remember calculus).
    I am recording two signals to a TDMS file, one is a pressure measurement and the other is a trigger monitor channel (basically it records a voltage change when the device is triggered).
    So what I want to do is when the device has been triggered (voltage changes from around 1 V to around 0 volts), I want to evaluate my pressure channel to see how quickly it gets above a certain threshold.
    I am thinking I need to integrate the trigger channel and somehow correlate that to the pressure channel, but I could be wrong.
    I attached a sample dataset.
    Thanks for the help.
    Kenny
    Attachments:
    sample data.txt ‏64 KB

    Could you not find PSI when on/off first reaches about 0 in your table, then grab the corresponding time, then find your PSI threshold, grab the time and subtract the two to get the elapsed time?  Or maybe I am missing something - I'm no math genius. 
    Edit:
    Oh, maybe you are evaluating them in real time and not from the table?
    Bill
    (Mid-Level minion.)
    My support system ensures that I don't look totally incompetent.
    Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.

  • Disable keystrokes while script is running

    Is there a way using javascript to disable keystrokes while the script is running, then enable them once the script is done?
    99% of the errors reported with my scripts occur because someone presses a key while it is running
    Thank you

    There is a definite link between hitting a key while the script is running and causing an errror.  I just did it to get this screen shot:
    Here's one example:
    I have a script that refines a selection in a certain way, and afterward a user may choose to hit CTR-C to cut.  However if they hit CTR-C before the script is done it gives a GENERAL PHOTOSHOP ERROR and spits up a piece of code (see attached image).  This is happening hundreds of times a day because production is so fast, and I need a way to fix this.
    Any ideas?

  • I have an Iphone 6 with 16gbs, so I'm running out of room. When I go to settings, general, then about, it says I have 97 photos and 23 videos, but I have nothing in my video app and in the photos app only has 12 pictures and 1 video. Any clue what w

    I have an Iphone 6 with 16gbs, so I'm running out of room. When I go to settings, general, then about, it says I have 97 photos and 23 videos, but I have nothing in my video app and in the photos app only has 12 pictures and 1 video. Any clue what would be causing this?

    I have an Iphone 6 with 16gbs, so I'm running out of room. When I go to settings, general, then about, it says I have 97 photos and 23 videos, but I have nothing in my video app and in the photos app only has 12 pictures and 1 video. Any clue what would be causing this?

  • RUNNING PHP SCRIPT WITH ZEND FRMWRK IN WINDOWS TASK SCHEDULER

    I have a PHP script which includes the Zend framework Mail.php for sending mails.
    I am running a WAMP server and i used DW to create it.
    I want to run my script in every 5 mins, How i can schedule it in Windows task scheduler.
    I tried running a bat which contains the php.exe path and arguments as php file but it gives an error that zend/mail.php not found.
    Please help its really urgent.

    Thanks for your response.
    bat file has:
    path of the php.exe -f path of php file.
    But when it runs it gives an error that the zend framework file not found.
    I have a seperate PHP includes folder under which zend FW is stored.
    That folder is marked in includes_paths in php.ini.

  • Need to run php script before the Flash component kicks in

    I have a slide show component in Flash which uses an xml file to load images. The xml file, however, is created dynamically when the user selects which slide show they want to see. How do I run the php script BEFORE the slide show component has a chance to look for it? Usually it begins as soon as the .swf is run.
    thanks,
    chop

    thank you for responding.
    I'm still new at as3 so forgive me for needing details.
    I searched adobe for help and came up with the following to import the component. However, it seemed too easy to be true and so it was. I received errors when I ran it. The component is a commercial one called SlideshowBox and is in my library with that exact name.
    //add a component to the stage
    import fl.controls.SlideshowBox;
    var aSlideshowBox:Button = new Button();
    addChild(aSlideshowBox);
    errors:
    Scene 1, Layer 'Actions', Frame 1, Line 3    1172: Definition fl.controls:SlideshowBox could not be found.
    Scene 1, Layer 'Actions', Frame 1, Line 3    1172: Definition fl.controls:SlideshowBox could not be found.
    Scene 1, Layer 'Actions', Frame 1, Line 4    1180: Call to a possibly undefined method Button.
    thank you, k

  • Run PHP script

    Hello, everybody. I'm wondering if it's possible to run a HTML PHP script in a report region which type is HTML format? Something like:
    <?php
    echo phpinfo();
    ?>
    As I can imagine, this code could not be handled to PHP compiler although as I know, the ORACLE appication server has been compiled together with PHP 5. So is there any tricks to make this work, or does APEX have some plan to make similar things work in the later version?
    Thanks!

    I have a PHP application that opens up a template (MS
    Word) invoice file, inserts some information in the
    file (eg. today's date, customer name) and then saves
    it as a new Word file. My questions are as follows.
    1- How can I call this script from my Java
    application. Please note that I want to be able to
    pass parameters (eg. custome name read from a DB) from
    my Java app. to this script.You would have to call the PHP interpreter through Runtime.exec(), I believe. I haven't done anything with it, but you would have to build the command that would normally be typed on the command line as a string and pass it to Runtime.exec().
    2- Is it possible to print already saved MS Word
    documents from Java? If so, how?Try looking at the Jakarta POI project.
    3- Is it possible to do what my PHP script is doing in
    pure Java? I couldn't find a simple way of doing this,
    that's why I used PHP but I would like to do this in
    Java if I can.Same as 2.

  • Error on running a PHP script

    I just migrated my web server over to Leopard and I am having an annoying issue with some PHP scripts. When I call a certain subroutine library (specifically Graph->Stroke from the JpGraph PHP library, http://www.aditus.nu/jpgraph/), the PHP code crashes with the following errors recorded in the /var/log/apache2/error_log:
    The process has forked and you cannot use this CoreFoundation functionality safely. You MUST exec().
    Break on _THE_PROCESS_HAS_FORKED_AND_YOU_CANNOT_USE_THIS_COREFOUNDATION_FUNCTIONALITY___Y OU_MUST_EXEC_() to debug.
    Now, I did a bit of poking around and discovered that Leopard did make a change (for security?) where a process that is forked is no longer allowed to call CoreFoundation routines (see http://developer.apple.com/technotes/tn2005/tn2083.html#SECDAEMONVSFRAMEWORKS). I have a vague idea of CoreFoundation (I am not a MacOS programmer), and I am guessing that the specpfic JpGraph command I am executing is triggering CoreFoundation to do some file handling. I am not sure about this because my own PHP routines that create files work just fine, but this JpGraph package chokes.
    Does anyone have any idea if there are some PHP tweaks I could make (via editing the php.ini file) that might prevent "forking" or of any other techniques that might avoid this problem.

    Hi if you are unable to go to this page after doing some personalizations ,
    then you need to do the following :
    ACTION PLAN
    ===========
    1. Login to application
    2. Select Responsibility Functional Administrator
    3. Click Personalization Tab ( Upper Right)
    4. For Application , Enter the following: Self-Service Web Applications
    5. Click on the Personalized Checkbox
    6. Click Go
    7. Remove or De-activate your personalization that is causing the issue
    8 Re-test your login.
    Thanks ,
    Raj.

  • Launchd not running php script in background

    Hi there,
    I am trying to run a php script repeatedly after every 2 minutes using launchd. I am using mac 10.9.2.
    Here is my plist file-->
    com.mycompanyname.mydepartment.mytaskname.plist
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
        <key>Label</key>
        <string>com.mycompanyname.mydepartment.mytaskname</string>
        <key>ProgramArguments</key>
        <array>
              <string>/Applications/XAMPP/xamppfiles/htdocs/oauth/job.php</string>
        </array>
        <key>StartInterval</key>
        <integer>50</integer>
    </dict>
    </plist>
    /Applications/XAMPP/xamppfiles/htdocs/oauth/job.php --->
    #!/usr/bin/php
    <?php 
    $File = "YourFile.txt"; 
    $Handle = fopen($File, 'a');
    $Data = "Jane Doe\n"; 
    fwrite($Handle, $Data); 
    $Data = "Bilbo Jones\n"; 
    fwrite($Handle, $Data); 
    print "Data Added"; 
    fclose($Handle); 
    ?>
    My command line for your reference-->
    studio-film1:oauth MetricFilm$ sudo chmod a+x job.php
    studio-film1:oauth MetricFilm$ sudo cp com.mycompanyname.mydepartment.mytaskname.plist /Library/LaunchDaemons
    studio-film1:oauth MetricFilm$ sudo launchctl load -w /Library/LaunchDaemons/com.mycompanyname.mydepartment.mytaskname.plist
    studio-film1:oauth MetricFilm$ sudo launchctl load -w /Library/LaunchDaemons/com.mycompanyname.mydepartment.mytaskname.plist
    com.mycompanyname.mydepartment.mytaskname: Already loaded
    When i drag and drop my job.php script on terminal, it shows its path and when i enter.... It is not giving me any error & it is running on command line too & creating "YourFile.txt" if it does not exists & if it exists then it writes two lines into it.
    Problem is---->
    "YourFile.txt"  is not getting generated neither if it is there is getting written by php script. Which means it is not running into memory even a once.
    What should i do to make launchd run this script repeatedly.
    Thanking you

    Thanks dear,
    Should i change relative path mentioned into PLIST file
    <string>/Applications/XAMPP/xamppfiles/htdocs/oauth/job.php</string>
    to Absolute...?
    And is there any other command to start a plist task running after we have loaded it with launchctl??
    Thank you

  • Firefox is taking a long time to open. When it does open, I get a pop up box with "Script not running". Bookmarks on my tool bar don't load. Scrolling is unreliable--it will stop in the middle of a page

    What is causing the "script not running"? Why so long to open? Etc.

    Hi Donekes,
    First off I need a little more information to help with troubleshooting.  You say that an error occurs when you "try to re-open the same problem app before the old session completely exits".  Does the error have an error code or dialog display?  It may also be possible to receive an error log.  Here is a knowledge base that explains how to retrieve error logs.
    http://digital.ni.com/public.nsf/websearch/54E361E3FF477EC186256C320068184F?OpenDocument
    If you are able to get that information then please post.  Have a good day.
    Brian K.

  • When I open bookmarks I get an error message that a script has stopped or is busy

    When I try and access my bookmarks I get an error message that a script has either stopped running or is busy. My choices are continue or stop script. The only way I can get to the bookmarks is to stop the script. Is there a fix for this?

    Do you have that problem when running in the Firefox SafeMode? <br />
    [http://support.mozilla.com/en-US/kb/Safe+Mode] <br />
    ''Don't select anything right now, just use "Continue in SafeMode."''
    If not, see this: <br />
    [http://support.mozilla.com/en-US/kb/troubleshooting+extensions+and+themes]

  • Flex application works locally, fails when online (connecting to PHP script to insert row into DB)

    Hi everyone,
    I've got a Flex application that works wonderfully when I test it on my machine locally. It uploads files and send variables to a PHP script (that inserts them into a DB) with no errors when I run it locally. As soon as I put it online, the upload continues to work but something between my Flex application and the PHP script fails because no data is committed to the DB. I know the PHP script works fine - not only does it work when I run the Flex application locally but when I go directly to the PHP file online, a new empty line is added to the DB.
    I initially thought that this was a cross domain issue so I added the following to the root of my hosted account:
    <cross-domain-policy>
    <site-control permitted-cross-domain-policies="all"/>
    <allow-access-from domain="*.MYURL"/>
    <allow-http-request-headers-from domain="*.MYURL" headers="*" secure="false"/>
    </cross-domain-policy>
    I based this off of what I found online which seems to have done nothing for me. I'd also be happy to provide an error message but I don't get one when I debug.
    Any thoughts would be greatly appreciated.

    Use a network monitor to see if the Flex app is truly requesting the right URL.
    -Alex

Maybe you are looking for

  • XML Publisher Issue - Please help.

    I am getting the following error when running the XML Report . The program is completing in warning message. “Beginning post-processing of request 235281769 on node RMOHSDCGR02 at 19-OCT-2010 10:27:33. Post-processing of request 235281769 failed at 1

  • TNS: No Listener on Oracle 10g Express Edition

    I have installed oracle database 10g Express Edition but get a ORA-12541:TNS:no listener exception when I try to connect to the database. I can connect using SQL plus. My listener.ora file looks like this: SID_LIST_LISTENER = (SID_LIST = (SID_DESC =

  • Adding my card from Address book

    Does anyone know how to add My Card from Address book to my signature everytime you send an email from mail? I'm migrating from Windows and outlook.

  • Multiple toggle buttons to the same destination causes conflicts

    I'm trying to set up multiple toggle buttons so that a user can click on a button at any time and set the state of the dashboard. Each toggle button has a unique value (and each one has the same static value for both on and off) and I've mapped all t

  • Does the Clone repair tool have an Aligned option like PhotoShop?

    PhotoShop's clone stamp has an option that is called "Aligned" under CS3 (not sure of its name in prior versions.) When clicked, there is a fixed spatial relationship between the source and destination pixels, even if you complete one clone operation