Load an external Php variable in Actionscript in flex.

Hello

I have be trying to load an external variable from a php file in an actionscript variable.i know how to bind the php mysql data to datagrid but not what I'm looking for, example say a php variable has a value = 5, this value will be passed to a variable limit actionscript, so now limit will have the value 5.

I use flex 3 and I have tried many examples listed on google, I went through all the tutorials, codes, etc... all of them were made using cs3 or cs4. And when I ran get them I have strength any output at all. Either I myself am thatproperty charger was not defined or nothing in my textarea.

If possible please guide me on the next or even want to give a small sample that works on flex3.i am also unsure of what I shud write in my php file.

I added the code to my mxml file for what does not work and shows me a blank text box.

Any help would be appreciated... Thanks in advance

<? XML version = "1.0" encoding = "utf-8"? >
< mx:Application xmlns:mx = "httw://www.adobe.com/2006/mxml" xmlns:custom = "" test.external. * "layout ="absolute"initialize =" load() ">"
< mx:Script >
<! [CDATA]

private function load(): void {}
var loader: URLLoader = new URLLoader();
loader.addEventListener (Event.COMPLETE, onComplete);
Loader.Load (new URLRequest (https://localhost/external.php));
}

private void onComplete(e:Event):void {}
Ext. Text = URLLoader (e.target) .data;
}



[]] >
< / mx:Script >
< mx:TextArea id = "ext" x = "296" y = "199" >


< / mx:TextArea >
< mx:Button click = "load()" x = "343,5" y = "274" > "

< / mx:Button >
< / mx:Application >


Your service works when she is called in the browser?

C

Tags: Flex

Similar Questions

  • is it possible to load and send php variables at the same time?

    Hello, with this line:
    Request.Method = URLRequestMethod.GET; You can get php variables.
    and with request.method = URLRequestMethod.POST you can send variables.

    But is it possible to do this at the same time?


    they send and receive data in order. IE, data are sent (if there are any) and then the data is received (if there is).

  • PHP variable loads on _root TEXT, need to put on a MC

    Hello!

    Is perhaps a silly question but I can't find the way... I get a PHP variable like: "MyMessage." But I need to put this textfield on a MC, could you tell me what I need to do to drive this variable in the MC? (In an object graph works ok but I need MC to control its X, Y)

    Thank you!

    If your movieclip instance name instance name tf a textfield and mc, you can use:

    MC. TF. Text = yourvariable;

  • load an external xml in an external .swf responsible

    Hello...

    I have a problem of hail (more than 100 hours of thinkwork so far!), that I can't solve:

    I want to load an external swf loaded with a dynamically loaded xml (load from my file config.xml) wire.

    < bgColor = "000000" bgHover menuItem = "Fred" fontColor = "cccccc" fontHover = "ffffff" >
    Home < title > < /title >
    < btntitle > <! [CDATA [home]] > < / btntitle >
    external SWF < linktype > < / linktype >
    ./content/SWF/home.swf < url1 > < / url1 > < - loads the external swf in the main swf - >
    ./content/XML/home.XML < url2 > < / url2 > < loads the external xml file thet is necessary in the external swf loaded in the line of top - >

    < / menuItem >

    How can I get the external xml in the external swf file as a variable for the ActionScript in the loaded swf external (so I just put the path to the script in my external swf...).

    Can someone help me out here because I'm really stuck for now...

    Thanks in advance!

    Welcome William

    the path to the xml file is relative to the html file that includes your main swf.  No matter where the swf file loaded (except for the path that you will use in your loadMovie() method etc.).

  • Load an external application.

    Hi all!

    How can I load an external application when the user clicks on a button using action script 2?

    I don't know what your situation or context, but Flash (or whatever it is in a sandbox as a Web page) cannot load executable files on the file system. If you run it in a projector, you can use the fscommand exec function, see here for more details:

    Flash CS4 Professional ActionScript 2.0

  • reception and display of php variables

    Hello

    trying to get php variables and arrange them in a list of the best scores, but I can't see the items.

    all the elements that I display in a text box, but I want to separate them into ten

    I have text fields nickname (user name) 1, 2, 3, 4, 5, etc.

    and mark fields of text (username) 1, 2, 3, 4, 5, etc.

    Here is my code... When I trace

    var currentPseudo:String = "highScoresPage.pseudo" + p;

    or

    var currentScore:String = "highScoresPage.score" + p;

    I get the correct output but when I try to add [currentPseudo] or [currentScore] into the equation, it doesn't seem to let me and if I remove the full stop after each text appendText is bluer and the function will fail? I thought it was the correct syntax for this sort of thing (without the full stop)?

    This isn't my code which is no doubt why it's confusing to me... Help, please!

    function modeComplet() {}
    trace ("loaded variables");

    highScoresPage.pseudo1.text = "";
    highScoresPage.score1.text = "";


    for (var p:uint = 1; p < = 10; p ++) {}

    var currentPseudo:String = "highScoresPage.pseudo" + p;
    var currentScore:String = "highScoresPage.score" + p;
    trace (currentPseudo);

    If (URLload.data ["Nick' + p]) {}
    [currentPseudo] .appendText (URLload.data ["nickname" + p]);
    If (URLload.data ["score" + p]) {}
    [currentScore] .appendText (["score" + p] URLload.data + "\n");
    } else {}
    [currentPseudo] .appendText ("\n");
    [currentScore] .appendText ("\n");
    }
    }

    }

    Hello

    You don't have to use the point to access the properties and methods of the object. The problem with your code, it's that you are not referencing the object whose children you are trying to access with the hooks. Try to add all of your references to hook with the object containing the text fields.

    For example, instead of:

    [currentPseudo] .appendText (URLload.data ["nickname" + p]);

    use

    This [currentPseudo]. AppendText (URLload.Data ["Nickname" + p]);

    I guess the text fields are in the same place where is the code. If it isn't, you ave to use the full object reference (for example, this.container [...]).

    I hope this helps.

    Rui

  • How can I load an external SWF into a clip that is inside another video clip?

    Hello.

    I create my first flash (actionscript 3.0) Web site, but I'm stuck with a visual effect, I want to create.
    I have a window on my website called contentWindow. Whenever you click on a button, this window is supposed to leave the scene, loading the requested content and back on the scene.
    The sliding window is a clip with 83 frames, 21 to enter the stadium, 21 to leave the scene once again, 20 for anything (it's just to simulate the load time) and 21 to the back on the scene.

    Now, my goal is, when the user clicks a navigation button, the window leaves the scene, loading an external SWF with the content and then returned to the scene.

    I have the clip of 'window' with an instance name of "contentWindow". Inside there is an another film clip with an instance name of "contentLoader. The content that the user has requested must appear inside the 'contentLoader.

    Now, when the contentWindow leaves the scene, I get this error message:

    Quote:
    TypeError: Error #1009: cannot access a property or method of a null object reference.
    at rwd_fla::MainTimeline/trigger()
  • Calling an external javascript variable in captivate

    I need captivate to reference an external JavaScript variable to check if its value is 1 or 0. If the value is '1' I need to display a button, if the '0' button is hidden.

    The reason why I need external is I want the customer to be able to change the value of the variable without having to republish files.

    I know not if I add a JavaScript file and folder to "program Adobe Captivate 9 x64\HTML\assets", it will be always published whenever captivate publishes, the question is how Captivate to refer to the variable in the JavaScript file?

    I use the latest version of Captivate 9.0.2 publish HTML5

    Thank you

    Gary

    Thanks for your suggestions of Peter!

    I managed to make it work last night using a different method.

    First set the variable 'SP_Assess_Included' in Captivate with a default value of 0.

    Then, I went in the folder "C:\Program Files\Adobe\Adobe Captivate 9 x64\HTML" and changed "index.html".

    Then I added the following line in the

  • Store the Javascript variable in a PHP variable

    Hello

    I get comments in a dialog box (using javascript).

    I want the data to be stored in a php variable, so that I can use this php variable in a query update.

    I don't know how to do it.

    Kindly help me.

    <? PHP

    If (isset($_GET['comp_no']))

    {

    $complaint_no = $_GET ['comp_no'];

    ECHO '.

    < script >

    Function myFunction() {}

    person var prompt = (\"Enter your name\",-"John Smith\" "); ».

    $prog_name = "nobody." ;} < /script > ';

    $query2 = "update sys_complaints the checked value = 'Yes', Programmer ="$prog_name" , when sno = '$complaint_no'"; "

    $run_query2 = mysql_query ($query2);

    If ($run_query2)

    {

    echo "< script > alert (" complaint is busy!' ");" < /script > ';

    Header("Location:view_complaints.php");

    }

    on the other

    {

    echo "request failed." mysql_error();

    }

    }

    ? >

    Thanks in advance.

    Use ajax to store a var js in a var to php there is a lot of info online if you are ready to search.

    best,

    Shocker

  • 'ERROR 01' as I have only 66 MB of free space on my MacBook Air: (how to load the external Creative cloud on a hard drive software?

    I bought the full package, but I couldn't get it to load on my laptop.

    So my question is:

    How to load the external Creative cloud on a hard drive software?

    Or do you spend, how the "Installer Creative Cloud' to load it on an external hard drive?

    Thanking you in anticipation.

    : )

    you have the cc office application installed on your computer?

    If not, install the - apps Download Adobe Creative Cloud | CC free trial Adobe

  • load an external swf on a mc that is on the screen

    This seems like a basic question, but if I have a swf file in the same directory as the fla and wants her to be on a mc, is there an easy way? so I make a movieclip on the screen and you want it to load. someone at - it a small example?

    Use the loader class to load an external swf.

    var loader: Loader = new Loader();

    Loader.Load (new URLRequest ("yourexternalswf.swf"));

    addChild (loader);  Adds the charger to the current timeline

    If you want to add the loader to a movieclip, the method addChild to this movieclip, for example:

    yourmovieclip.addChild (loader);

  • Load an external SWF file without overwriting my container SWF (AS2) file

    Hello world

    I want to load an external SWF with AS2, but file without overwriting my container file. How can I achieve this? What is the correct code?

    Here is the code I use :

    loadMovieNum ("external.swf", 0);

    countdown = function() {}

    trace ("OK");

    }

    countdownIt = setInterval (countdown, 1000);


    It works well, but as I said, it overwrites my container SWF file. If I load into level 1, my container file works but not the one I try to load... .



    Can someone help me with this, please?

    Try to use the loadMovie method... meaning container.loadMovie.  See below for an explanation: Load external in another SWF SWF

    If the loaded file does not work when you load it, it is probably because you have references to _root in there who do not find the expected _root.  You must set the file loaded _lockroot property to be true.

  • How to load an external mp4 video

    Hello

    How to load an external mp4 video in as2?

    This code is perfect, but I want video mp4 in there.

    Please help me!

    Mx.video import. *;

    my_video.contentPath = ' clips / maharashtra.mp4 ";

    my_video. Seek (4.7);

    my_video. Play();

    var listenerObject:Object = new Object();

    listenerObject.complete = function(eventObject:Object):Void

    {

    movieComplete();

    };

    my_video.addEventListener ("complete", listenerObject);

    //

    movieComplete = function() {}

    gotoAndPlay (1);

    };

    Stop();

    Then, the only problems with your code are that 4.7 seconds of video probably does not load at the time wherever you run your seek() and you have a superfluous code:

    Mx.video import. *;

    my_video.contentPath = ' clips / maharashtra.mp4 ";

    my_video. Seek (4.7);  //<- this="" probably="" won't="" work="">

    my_video. Play();

    var listenerObject:Object = new Object();

    listenerObject.complete = function(eventObject:Object):Void

    {

    gotoAndPlay (1);

    };

    my_video.addEventListener ("complete", listenerObject);

    Stop();

  • Load directly from php as a DataProvider to a datagrid

    Hello

    The normal method to load data from php in one datgrid is pushing in and Board first...:

    for (var i: uint = 0; i < event.target.data.dgRows; i ++)

    {

    dgArr.push

    ({

    ID:event.target.data ["ID" + i],

    dateLogged:event.target.data ["dateLogged" + i],

    quoteNumber:event.target.data ["quoteNumber" + i],

    clientPoNum:event.target.data ["clientPoNum" + i],

    compName:event.target.data ["compName" + i],

    exclusive: Event.Target.Data ["exclusive" + i]

    Tax:event.target.data ["Tax" + i],

    inclusive: Event.Target.Data ["Inclusive" + i]

    });

    }

    DG1. DataProvider = new DataProvider (dgArr);

    What I want to know is if it is possible to "event.target.data" directly as a dataprovider, tried but failed for obvious reasons: DG1.dataProvider = new DataProvider (event.target.data);

    Basically I want the code that does not change for each php file and reduce the amount of lines of coding, for example. I want to "dynamic": eliminate\change

    "for (var i: uint = 0;". I < event.target.data.dgRows;. i ++) {dgArr.push (...); »

    Something like that would be great...

    (var key: string in the map)

    {

    dgArr.push

    ({

    key : [key] card

    });

    }

    (the above code will add a line for each key that actually represent a column which is totally not what is necessary and is empty because the 'key' must indicate...)

    Help will be appreciated

    You can use the JSON native encoding of functions in PHP to wrap your results into an object that can use the native JSON functions in AS3 decoding turn around in a table that can be used as a dataProvider.

    You can of course also write logic to wrap your results as XML from PHP and use it directly as a dataProvider.

    Just to set the MIME type that is appropriate for what you want to send and use the string normal receive mode. for example return to XML format and myGrid.dataProvider = XML (e.target.data); or return JSON and myGrid.dataProvider = JSON.parse (e.target.data);

    Edit:

    Haha you never kglad of sleep...

  • Direct load in external tables

    Can we use direct load in external tables? or set DIRECTLY in the external table script?

    Thank you.

    polasa wrote:
    Can we use direct load in external tables? or set DIRECTLY in the external table script?

    Thank you.

    N ° why? Because an external table does not load data. It's more like a pointer and an instruction how to read a file.

    The big difference between SQL Loader and an external table, SQL Loader is actually two things.

    (a) it reads a file from the file system
    (b) it inserts these values into a table in the database.

    An external table only one).

    However, you can do a quick insertion of this external table in an actual database table so that is sought.

    insert /*+append */ into myRealTable (colA, ColB, colC)
    select  * from myExternalTable
    

    Append it and perhaps also the parallel indication will be close to a direct path insert.

Maybe you are looking for