LoadVars-using send to pass a variable from flash to php

For the life of me, I've tried everything:
I've researched LoadVars on Adobe forum, used David Powers'
books, googled 'flash to php', LoadVars, etc. and tried
sendAndLoad, send, and using $_POST, $_GET, $_REQUEST.
$HTTP_POSTVARS but I keep getting this same error. any advice
please?
I have a Unix server running Apache/PHP 4 - LoadVars worked
to load name-value pairs into an array -see thread)
My goal with this simple app is to prototype being able to
pass a variable from flash to a variable in php.
Parse error: syntax error, unexpected T_VARIABLE in
flash_to_SQL.php on line 5
Actionscript 2.0 code:
var c :LoadVars = new LoadVars();
c.testing = "123FOUR";
c.send ("
http://127.0.0.1/flash_to_SQL.php","_self","POST");
php code: (I also tried $_POST, $_GET, $_REQUEST.
$HTTP_POSTVARS)
<?php
//mysql 4.1.2, php 4 , NO mysqli
ecbo $_REQUEST ['testing'];
/?>

var formData:LoadVars = new LoadVars();
formData.fname = "Name";
formData.send("
http://www.website.com/flash_php.php",
formData, "POST");
<?php
$name = $_POST['fname'];
echo $name;
?>

Similar Messages

  • Passing a variable from Flash Cs3 (AS2) to C#

    I am working on what I thought would be a simple microsoft windows form application.  In the application I load a .swf file, straight and simple, but when the last frame is reached I need to pass information to the C# program that the last page has been reached - I thought a variable [finished = 1] or a string [end="Finished"] would work best.
    I have google,d binged, and searched through these forums but I cannot find anything that I can understand.  As you can tell I am a very casual flash and C# user (=noob), any help would be greatly appreciated.
    Thank you in advance for any assistance
    Woodtd

    Thank you for your response.
    Do you have a code snippet or other example that shows how to do this?
    Thanks
    Tim

  • Values from Flash to PHP

    I am using AS2 and passing some values from flash to php,  flash files is on page file1.php   values are passing fine , it pass values when user click button
    when button is pressed {  var myVal:LoadVars = new LoadVars(); myVal.flieName = "fileid1 "; myVal.send("file1.php", "_parent", "POST"); }
    Problem: when it pass the values , it refresh the page and Flash File is also refreshed and Flash file start from frame 1 and all the values on flash becomes default  in other words when user click "file1.php" is sumbitted , so the page is refreshed What is the solution , that after passing values the page remains or flash reamins as it is ( not refresh the contents )

    use:
    var receiveLV:LoadVars=new LoadVars();
    receiveLV.onData=function(src){
    var myVal:LoadVars = new LoadVars(); myVal.flieName = "fileid1 "; myVal.sendAndLoad("file1.php", receiveLV,"POST"); }

  • Passing variables from AS3 to PHP

    Hi there
    I am having some trouble in passing variables from AS3 to PHP. I am using flash and php both in the same file [try.php].
    I've stuck with this for two days.. Here's what I have done. Please help!!!
    header.fla [Actionscript in the timeline]
    stop();
    import flash.events.Event;
    import flash.display.Sprite;
    import flash.net.*;
    var url:String = "http://localhost/0000/try.php";
    var req:URLRequest = new URLRequest(url);
    var loader:URLLoader = new URLLoader();
    var variables:URLVariables = new URLVariables();
    send_btn.addEventListener(MouseEvent.CLICK, sendForm);
    function sendForm(evt:MouseEvent):void
        // add the variables to our URLVariables
        variables.asd = "value";
        // send data via post
        req.method = URLRequestMethod.POST;
        req.data = variables;
        loader.dataFormat = URLLoaderDataFormat.TEXT;
        // add listener
        loader.addEventListener(Event.COMPLETE, onLoaded);
        loader.addEventListener(IOErrorEvent.IO_ERROR, ioErrorHandler);
        //send data
        loader.load(req);
    function onLoaded(evt:Event):void
        var result_data:String = String(loader.data);
        if (result_data)
            trace(result_data);
        else if (!result_data)
            trace("error");
    function ioErrorHandler(event:IOErrorEvent):void
        trace("ioErrorHandler: " + event);
    try.php
    <body>
    <object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="563" height="280">
      <param name="movie" value="header.swf" />
      <param name="quality" value="high" />
      <param name="wmode" value="opaque" />
      <param name="swfversion" value="6.0.65.0" />
      <!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
      <param name="expressinstall" value="../Scripts/expressInstall.swf" />
      <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="header.swf" width="563" height="280">
        <!--<![endif]-->
        <param name="quality" value="high" />
        <param name="wmode" value="opaque" />
        <param name="swfversion" value="6.0.65.0" />
        <param name="expressinstall" value="../Scripts/expressInstall.swf" />
        <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
        <div>
          <h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
          <p><a href="http://www.adobe.com/go/getflashplayer"><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></a></p>
        </div>
        <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>
    <?php
    if($_POST['asd'])
    echo "value of var1 is <b>".$_POST['asd']."</b>";
    else
    echo "bad luck";
    ?>
    </body>
    BIG THANKS!!

    the problem is nothing your showed.   did you see a security warning that you ignored?
    to test, if that's the problem go here and adjust your security settings:  http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04a.ht ml
    if that fails, upload your files to a server and confirm everything works.  then start working on your local configuration.

  • How to pass a variable from one class to another class?

    Hi,
    Is it possible to pass a variable from one class to another? For e.g., I need the value of int a for calculation purpose in method doB() but I get an error <identifier> expected. What does the error mean? I know, it's a very, very simple question but once I learn this, I promise to remember it forever. Thank you.
    class A {
      int a;
      int doA() {
          a = a + 1;
          return a;
    class B {
      int b;
      A r = new A();
      r.a;  // error: <identifier> expected. What does that mean ?
      int doB() {
         int c = b/a;  // error: operator / cannot be applied to a
    }Thank you!

    elaine_g wrote:
    I am wondering why does (r.a) give an error outside the method? What's the reason it only works when used inside the (b/r.a) maths function? This is illegal syntax:
    class B {
      int b;
      A r = new A();
      r.a;  //syntax error
    }Why? Class definition restricts what you can define within a class to a few things:
    class X {
        Y y = new Y(); //defining a field -- okay
        public X() { //defining a constructor -- okay
        void f() { //defining a method -- okay
    }... and a few other things, but you can't just write "r.a" there. It also makes no sense -- that expression by itself just accesses a field and does nothing with it -- why bother?
    This is also illegal syntax:
    int doB() {
          A r = new A();
          r.a;  // error: not a statement
    }Again, all "r.a" does on its own is access a field and do nothing with it -- a "noop". Since it has no effect, writing this indicates confusion on the part of the coder, so it classified as a syntax error. There is no reason to write that.

  • Passing a variable from a movie clip to the main timeline

    Hi,
    I'm having trouble passing a variable from a movie clip in my
    flash file to the main timeline.
    I have a movieclip with the instance name IntroNav which
    contains several buttons. Clicking a button sets the variable
    "page" to a specific name, i.e. page = "home"
    However, outside of the movie clip, on the main timeline I am
    unable to call this variable, and "page" seems to have no value.
    Can anyone tell me why this is and how to solve it?
    Thanks

    Umm, yes ... declare your variables correctly.
    var page:String = new String(); //proper complete
    var page:String; //strict typing
    var page:String = "home"; //stirct typing with value
    declaration
    Do not declare the variable in your buttons, you would have
    to do so in every button and be constantly resetting the value.
    Declare it on the main timeline at the lowest level. You do not
    need to use it as a _global, you just need to resolve your path
    issues. You can 'set' the variable value from a button, without any
    problem, but you have to call to the variable correctly.
    You do not 'name' a variable as "_root.page" , the '_root'
    refers to the lowest level of the SWF or the main timeline, as does
    a call to ' _level0' (that's a zero). If the variable is declared
    on the main timeline, and you're calling from the MC/button or
    anywhere you can refer to the variable by calling to it by
    the proper path of '_root.page'
    To set the variable from any of your button/MC instances
    call:
    _root.page = "value"; OR _level0.page = "value";
    But you must have the varibale declared on the main timeline,
    and only once and the playhead should be stopped or it will reset
    the value to the default upon looping.

  • How to pass a variable from HTML to Flash

    I have built my flash ad banner in Flash 9 and now want the
    HTML code to pass the url over to the flash movie that it should
    jump to when clicked.
    The info in the help file seems out of date for the latest
    HTML template as it uses mainly JavaScript to get round IE's
    dreadful embeding issue. So my problem is, how do I pass a variable
    from the HTML to the actionScript specified int he Help file
    (running on a full screen button) as shown below?
    myButton_btn.onRelease = function() {
    if (clickTAG.substr(0, 5) == "http:") {
    getURL(clickTAG);
    via the html code now used by Flash 9 which is like this:
    <!-- saved from url=(0013)about:internet -->
    <html lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>Advert_long</title>
    <script language="javascript"> AC_FL_RunContent = 0;
    </script>
    <script language="javascript"> DetectFlashVer = 0;
    </script>
    <script src="AC_RunActiveContent.js"
    language="javascript"></script>
    <script language="JavaScript" type="text/javascript">
    <!--
    // Globals
    // Major version of Flash required
    var requiredMajorVersion = 9;
    // Minor version of Flash required
    var requiredMinorVersion = 0;
    // Revision of Flash required
    var requiredRevision = 115;
    // -->
    </script>
    </head>
    <body bgcolor="#ffffff">
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <!--
    Coping
    with
    Growing
    Audio
    Series
    Theraputic stories
    for children aged
    4 to 9
    -->
    <script language="JavaScript" type="text/javascript">
    <!--
    if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
    alert("This page requires AC_RunActiveContent.js.");
    } else {
    var hasRightVersion = DetectFlashVer(requiredMajorVersion,
    requiredMinorVersion, requiredRevision);
    if(hasRightVersion) { // if we've detected an acceptable
    version
    // embed the flash movie
    AC_FL_RunContent(
    'codebase', '
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0',
    'width', '120',
    'height', '600',
    'src', 'Advert_long',
    'quality', 'high',
    'pluginspage', '
    http://www.macromedia.com/go/getflashplayer',
    'align', 'middle',
    'play', 'true',
    'loop', 'true',
    'scale', 'showall',
    'wmode', 'window',
    'devicefont', 'false',
    'id', 'Advert_long',
    'bgcolor', '#ffffff',
    'name', 'Advert_long',
    'menu', 'true',
    'allowScriptAccess','sameDomain',
    'allowFullScreen','false',
    'movie', 'Advert_long',
    'salign', ''
    ); //end AC code
    } else { // flash is too old or we can't detect the plugin
    var alternateContent = 'Alternate HTML content should be
    placed here.'
    + 'This content requires the Adobe Flash Player.'
    + '<a href=http://www.macromedia.com/go/getflash/>Get
    Flash</a>';
    document.write(alternateContent); // insert non-flash content
    // -->
    </script>
    <noscript>
    // Provide alternate content for browsers that do not support
    scripting
    // or for those that have scripting disabled.
    Alternate HTML content should be placed here. This content
    requires the Adobe Flash Player.
    <a href="
    http://www.macromedia.com/go/getflash/">Get
    Flash</a>
    </noscript>
    </body>
    </html>

    You should use SWFObject to embed your Flash. Not only does
    it make
    embedding more straightforward, it makes passing query
    parameters very easy.
    Check out:
    http://code.google.com/p/swfobject/
    Dave -
    www.offroadfire.com
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • How to pass a variable from HTML to Flash 9

    I have built my flash ad banner in Flash 9 and now want the
    HTML code to pass the url over to the flash movie that it should
    jump to when clicked.
    The info in the help file seems out of date for the latest
    HTML template as it uses mainly JavaScript to get round IE's
    dreadful embeding issue. So my problem is, how do I pass a variable
    from the HTML to the actionScript specified int he Help file
    (running on a full screen button) as shown below?
    myButton_btn.onRelease = function() {
    if (clickTAG.substr(0, 5) == "http:") {
    getURL(clickTAG);
    via the html code now used by Flash 9 which is like this:
    <!-- saved from url=(0013)about:internet -->
    <html lang="en">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>Advert_long</title>
    <script language="javascript"> AC_FL_RunContent = 0;
    </script>
    <script language="javascript"> DetectFlashVer = 0;
    </script>
    <script src="AC_RunActiveContent.js"
    language="javascript"></script>
    <script language="JavaScript" type="text/javascript">
    <!--
    // Globals
    // Major version of Flash required
    var requiredMajorVersion = 9;
    // Minor version of Flash required
    var requiredMinorVersion = 0;
    // Revision of Flash required
    var requiredRevision = 115;
    // -->
    </script>
    </head>
    <body bgcolor="#ffffff">
    <!--url's used in the movie-->
    <!--text used in the movie-->
    <!--
    Coping
    with
    Growing
    Audio
    Series
    Theraputic stories
    for children aged
    4 to 9
    -->
    <script language="JavaScript" type="text/javascript">
    <!--
    if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
    alert("This page requires AC_RunActiveContent.js.");
    } else {
    var hasRightVersion = DetectFlashVer(requiredMajorVersion,
    requiredMinorVersion, requiredRevision);
    if(hasRightVersion) { // if we've detected an acceptable
    version
    // embed the flash movie
    AC_FL_RunContent(
    'codebase', '
    http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0',
    'width', '120',
    'height', '600',
    'src', 'Advert_long',
    'quality', 'high',
    'pluginspage', '
    http://www.macromedia.com/go/getflashplayer',
    'align', 'middle',
    'play', 'true',
    'loop', 'true',
    'scale', 'showall',
    'wmode', 'window',
    'devicefont', 'false',
    'id', 'Advert_long',
    'bgcolor', '#ffffff',
    'name', 'Advert_long',
    'menu', 'true',
    'allowScriptAccess','sameDomain',
    'allowFullScreen','false',
    'movie', 'Advert_long',
    'salign', ''
    ); //end AC code
    } else { // flash is too old or we can't detect the plugin
    var alternateContent = 'Alternate HTML content should be
    placed here.'
    + 'This content requires the Adobe Flash Player.'
    + '<a href=http://www.macromedia.com/go/getflash/>Get
    Flash</a>';
    document.write(alternateContent); // insert non-flash
    content
    // -->
    </script>
    <noscript>
    // Provide alternate content for browsers that do not
    support scripting
    // or for those that have scripting disabled.
    Alternate HTML content should be placed here. This content
    requires the Adobe Flash Player.
    <a href="
    http://www.macromedia.com/go/getflash/">Get
    Flash</a>
    </noscript>
    </body>
    </html>

    You should use SWFObject to embed your Flash. Not only does
    it make
    embedding more straightforward, it makes passing query
    parameters very easy.
    Check out:
    http://code.google.com/p/swfobject/
    Dave -
    www.offroadfire.com
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • Is it possible to pass a variable from a shell script back to an Automator action?

    Is it possible to pass a variable from a shell script back to an Automator action?
    For instance, if I assign a value of foo to $var1 in my shell script how would I retrieve/pass that value in the next Automator action. I see that there is a variable called "Shell Script" but I can't any information on how to use it. 

    red_menace,
    Thanks but I still don't understand how to pass a single value that was set in the UNIX scipt back to Automator has a variable. Take the example below, I write 4 varables to STDOUT and all 4 are stored in a variable named "storage".  How do I assign 1 of these values to the Automator "storage" variable? For instance if I wanted to assign the value of $var2 to "storage" , how would I do that?

  • Passing a variable from a non DB block to a DB block

    Im getting the error FRM-41003 when I try to pass a variable from a search screen i created to a results screen which is tied to a DB block. Ive searched this error and nothing seemed to match exactly what Im dealing with. Is it possible to do this? Anybody run into this issue?

    This is the code/trigger launched when the search button is clicked from the search screen that is not tied to a DB block.
    IF :NRHR1.NUMBER IS NULL THEN
    Message('Please enter valid search criteria.', NO_ACKNOWLEDGE);
    ELSE
    :Global.BUFFER_VARIABLE := :NRHR1.NUMBER;
    NUM_SEARCH;
    END IF;
    --This is the procedure that is called
    PROCEDURE NUM_SEARCH IS
    BEGIN
    IF :NRHR1.NUMBER IS NOT NULL THEN
         :Global.BUFFER_VARIABLE := :NRHR1.NUMBER;
         ENTER_QUERY;
         :NRHR.NUMBER := :Global.BUFFER_VARIABLE;
         DECLARE
                   blk_id BLOCK;
                   s_old_order_by           VARCHAR(100);
                   s_old_where          VARCHAR(100);
              BEGIN
                   blk_id := FIND_BLOCK( 'NRHR' );
                   s_old_where := GET_BLOCK_PROPERTY(blk_id, DEFAULT_WHERE);
                   SET_BLOCK_PROPERTY( blk_id, DEFAULT_WHERE, 'NRHR.NUMBER = ''' ||:Global.BUFFER_VARIABLE||'''');
                   EXECUTE_QUERY;
                   SHOW_WINDOW('WINDOW1');
                   SET_BLOCK_PROPERTY(blk_id, DEFAULT_WHERE, s_old_where);
              END;
    END IF;
    EXCEPTION
              WHEN NO_DATA_FOUND OR VALUE_ERROR THEN
              MESSAGE('NO RECORDS');
              HIDE_WINDOW('WINDOW1');
              SHOW_WINDOW('SEARCH');
    END;
    I am using forms 10g
    Edited by: user8606340 on Jan 28, 2010 8:17 AM

  • Passing a variable from Captivate 5 to Flash CS5/ActionScript 3

    I don't get it. Why is it so difficult to pass a variable from Captivate 5 to AS3/Flash CS5. I must be making it harder than it really is. I cannot figure it out.  Can anyone help?
    I have a variable (gpDone = 1) defined in Captivate 5 (it's a guided practice) on the last frame which will indicate that the learner has completed the guided practice file.
    Now I want to pass that variable back to Flash/AS3 so I can evaluate whether I should show the Continue button so they can continue. They have to complete the guided practice before they can continue. If it is equal to 1, the Continue button will display. If it is not equal to 1, the Continue button will not display, but a message will display telling them they have to complete the guided practice in order to continue in the course.
    Do I need to edit the Flash html? Or just put code in the Flash timeline or the associated AS file?
    Help would be greatly appreciated. Thanks in advance.
    CAH

    Having the same problem...getting variable values FROM captivate to my inserted .swf (not widgets).
    I can set the value from the .swf to the captivate using Object(parent.parent.parent.parent).captivateVariable but not the other way around.
    Very frustrating.
    I hope someone answers your query.

  • Is it possible to pass a variable from one animation to another?

    I have multiple animations on the same page. I need to pass a variable from one to the other.
    Animation One has this:
    sym.setVariable("myVarOne", 1);
    Animation Two has this:
    var myVarOneInTwo=Edge.getComposition("EDGE-12345678").getVariable("myVarOne");
    Seems like it should work, but kinda hard to tell. I put in:
    console.log("myVarOneInTwo = " + myVarOneInTwo);
    But I get: Javascript error in event handler! Event Type = timeline
    So it seems that it doesn't like getting a variable from another animation.
    Is there a way to pull a variable from one animation into another?

    Sorry also had to fix this:
    var myVarOneInTwo=Edge.getComposition("EDGE-12345678").getVariable("myVar One");
    To this:
    var myVarOneInTwo=Edge.getComposition("EDGE-12345678").getStage().getVariable("myVar One");

  • Passing a variable from text to flash

    How do you pass a variable from a text file to flash?

    Check out Help for loadVariables.
    Dave -
    Head Developer
    http://www.blurredistinction.com
    Adobe Community Expert
    http://www.adobe.com/communities/experts/

  • Is there any way at all of accessing captivate variables from flash?

    Hi,
    I would be grateful for any help on this one.  I have been working in flash and I wanted to know whether there is any way at all of calling/accessing captivate 4 variables from flash (I'm working in flash Cs4 Actionscript 3.0 and I'm trialling Captivate 4, but I just want to know whether there is any way/method of communicating between a flash file and a captivate 4 file, and if so, can this be done with an embedded captivate 4 file/swf).  Surely there must be a way of communicating between the two - they are both Adobe products!
    Thanks for any help, pointers, advice, tips in advance.

    Hi Louon,
    Don't know if this would help you.
    http://blogs.adobe.com/captivate/2009/09/captivate_variables_-_how_to_a.html
    We have many experts here who could give more precise answers.
    Cheers.
    Miguel

  • Instead of using session How to pass the variable from action class to JSP

    Im using Struts1.2 version.Created the Sample application to get the username.Upto action class im getting the username then i have to display the username in the JSP.Is there any options rather than using session variable to display the username.

    did you check the answer in your previous thread
    Passing Variable from Javascript to Controller

Maybe you are looking for

  • Can I access my icloud mail using a PowerPC G4 800hz imac running OS10.4.11?

    I have an old PowerPC G4 800hz imac.  I am running mac OSX 10.4.11 on it.  I have a mac mini and an ipad that I use normally for accessing mail from my icloud account.  This morning I tried to access mail on the Power PC but kept getting error messag

  • I cannot enter text in the iTunes search box

    I'm having a really bizarre problem with iTunes latest version (10.5,0.142). When I click in the search field in the upper right-hand corner of the program, I cannot enter any text--no text cursor appears.  I can click on the little down arrow next t

  • The connection between two Tuxedo machines

    We want to locate our servers(services) onto different machines, we want to know :whether the connection,between two machines, is built up at the first time the servers booted and kept persistently connectted, or just build up the connection when the

  • Must have LabVIEW installed on your computer to call a VI from SignalExpress?

    I am a student trying to finish up a class project, so I'm hoping for a solution that's not too time-consuming, nor expensive. My problem is that I have a device that outputs a 9-pin RS232, and I just learned that I can't really connect it to my DAQ

  • Adjustment Modifications after Patch upgrade?

    Hello, Is it possible that the Modifications Adjustments (done in SPAU and SPDD and occured due to SAP_BASIS and SAP_ABA patches) be carried out after the patches upgrade? To be more clear, instead of Adjusting the Modifications while patch upgrade i