How to use AMFPHP objects in Flex

Hello

I managed to get amfphp to return PHP objects, the question is now how can I make Flex abreast of objects?

I invoke a remote object and the objects are returned as a result. Can be used directly or do I have to use XML?

Hmm, your code seems a bit complicated. Here's what I do:

The RemoteObject:

Comments:

1 yourAMFPHPClassName is the name of the folder in amfphp\services that contains the PHP classes.

2 ThePHPFile is the class PHP (without the extension) file in the yourAMFPHPClassName folder.

3. you need the to define the function in the PHP class you want to call. The theFunctionYouWantToCall must be the exact name of the function in the PHP class (case sensitive).

The part of the ActionScript:

THE EXAMPLE BELOW will ONLY WORK IF THE PHP FUNCTION RETURNS a UNIQUE VALUE

This means that the PHP function has a return like this statement: return $value; or return "Test";

private void myFunctionResultHandler(event:ResultEvent):void

{

var PHPResult:String = String (event.result);

Alert.Show (PHPResult); will indicate that the returned PHP class

}

The EXAMPLE below SHOWS HOW to PASS MULTIPLE Flex DATA

This means that the PHP function has a return like this statement:

$returnValue = array ();

$returnValue ['name'] = "George";

$returnValue ["age"] = $age;

Return $returnValue;

private void myFunctionResultHandler(event:ResultEvent):void

{

Alert.Show ("Name:" + event.result.name);

Alert.Show ("Age:" + event.result.age);

}

ERROR handler

private void myFunctionFaultHandler(event:FaultEvent):void

{

Alert.Show ("data not can be acquired.");

}

Tags: Flex

Similar Questions

  • How to use the object Handle for Image cropping and rotation

    I downloaded the handle of the rogue 2,008 object that I need to know how to use it for cropp and rotate the Image.

    Contact the vendor of this product for more information on its use.

  • How to use smart objects to make models?

    Hey guys,.

    I was download a few models to use in my wallet and I want to start making my own for some I can not find on the web. I managed to do an asset realistic looking for what I want, but I don't know how to add text and other things. Usually, when I open a downloaded PSD mockup I double-click on the smart object, edit the content, press on save and BOOM it is perspective for whatever I change.

    However, I made dynamic object and I am trying to edit the content, so when I double click it just opens the new and all purpose that I created ad, but it does not save the prospect. If that makes sense... (see the screenshots)

    So my question is,

    How to make a dynamic object to change the content (text, images, logo, etc. etc.) on a plain PSB and PSD so it registers in the corner or point of view I want? Is there something different that I do. Can we make a step by step guide?

    It's my design until I double click on the smart layer

    Screen Shot 2013-10-11 at 3.13.12 PM.png

    Here is the image when I double click on the active layer (not exactly what I want).

    Screen Shot 2013-10-11 at 3.13.21 PM.png

    Here's a mockup I downloaded when I double click on the next show pictures of what I want.

    Screen Shot 2013-10-11 at 3.13.50 PM.png

    That's what I want to do in my design of the original, but how do I get the text to do it with a smart object? I want to change the text in my design and apply (not necessarily this design, but my own) to my dynamic object (first image), I created in photoshop. How can I do this?

    Screen Shot 2013-10-11 at 3.14.11 PM.png

    Make the text of the same size or larger and put it into a smart object: filter > convert to smart object.  Without it, you can turn the text, but you do not have as many transform options.  Once you have the text in the dynamic object, select Edition > transform > warp.  Then you can drag the corner of the text points to fit the shape of the card.

  • How to use the funds application Flex with java

    Hello

    I've seen a lot of tutorials on using web application with java flex but you will not see even a tutorial for the application Office Flex with java. If anyone have pls send the link.

    is it possible to create java application and desktop application without using application server?

    Thank you.

    Hello

    Please see the link below.

    http://forums.Adobe.com/thread/601342?decorator=print&displayFullThread=true

    It could anser your query.

    Anser another is "Merapi project" - This allows you to connect to the local application of Java of the AIR application.

  • How to use the data object 'DatastoreHostMount '.

    I train to iterate on the grouping value in vCenter and for each data store found, determine whether a host has mounted data store or if it is visible to the host. I am using data object 'DatastoreHostMount' , but I don't know exactly how to use the object to retrieve the name of host configuration.

    Here's the perl code snippet and I get an error for:

    #get all hosts within cluster and check the connectionState and compare with all datastores found
    #is there a more efficient way to combine this section with the next section?
    
            my $hosts = Vim::get_views (mo_ref_array => $cluster->host);
    
            foreach my $host (@$hosts) {
                    if ($host->runtime->connectionState->val eq 'connected') {
                            my $datastores = Vim::get_views (mo_ref_array => $cluster->datastore);
                            foreach my $datastore (@$datastores) {
                                      print "  Datastore ", $datastore->host->summary->config->name,"\n"
                            }
                    }
                    elsif ($host->runtime->connectionState->val eq 'disconnected') {
                            print "\t|", $host->summary->config->name, "|Disconnected|\n"
                    }
                    elsif ($host->runtime->connectionState->val eq 'notResponding') {
                            print "\t|", $host->summary->config->name, "|Not Responding|\n"
                    }
            }
    

    Cannot call method 'Summary' on some wrapping 71 de./listCluster.pl.

    Disconnection of the end

    =========================================================================

    -William

    Scripts for VMware ESX/ESXi and resources at: http://engineering.ucsb.edu/~duonglt/vmware/

    OK, I remembered how it works. Sorry for the noise:

    |

    My $datacenter = Opts::get_option ('Center');

    My $datacenter_view = Vim::find_entity_view (view_type = > 'Data center',)

    filter = > {name = > $datacenter});

    If (! $datacenter_view) {}

    Die "data center" "» $datacenter. "" not found\n ";

    }

    My $cluster_views = Vim::find_entity_views (view_type = > 'ClusterComputeResource',)

    begin_entity = > $datacenter_view);

    My $counter = 1;

    Print "Clusters found: \n";

    {foreach (@$cluster_views)}

    Print "$counter:". "." $_-> name. "\n";

    My $datastores = Vim::get_views (mo_ref_array = > $_-> data store);

    foreach my {$datastore (@$datastores)}

    my $instances = @{$datastore-> host};

    my $instance = 0;

    while($instance < $instances) {}

    My $x = Vim::get_view (mo_ref = > $datastore-> Home-> \[$instance\]-> key);

    print $datastore--> summary-> name, "Datastore", $x-> name, "\n";

    $instance ++;

    }

    }

    $counter ++;

    }

  • How to use this class

    The following code is a class I want to use (Arc.as), but it doesn't have a constructor function (i.e. public void Arc()). How to use this class in Flex? I also placed the code I thought I could use.

    Yes, in the example of the arc, in the change of loop(e:Event):
    removeChild (sp);
    TO:
    container.removeChild (sp);

  • I'm new to flex, and I would like to create a simple login + password using amfphp

    Hi all

    I try to make a simple connection using amfphp and mysql password, I have a small question, I don't ' know how to recover my answer of php. Thanks in advance if anyone could help me.

    Best regards

    I want to say to the tag < mx:Label x = "380" y = "10" id = "lResponse" / > php response

    I just want to take over the response of php.

    Here's my mxml:

    <? XML version = "1.0" encoding = "utf-8"? >
    " < = xmlns:fx s:Application ' http://ns.Adobe.com/MXML/2009 "
    xmlns:s = "library://ns.adobe.com/flex/spark".
    xmlns:MX = "library://ns.adobe.com/flex/halo" minWidth = "1024" minHeight = "768" >
    < fx:Script >
    <! [CDATA]
    Import mx.controls.dataGridClasses.DataGridColumn;
    import flash.net.Responder;
    Import mx.events.DataGridEvent;
    Import org.corlan.VOAuthor;

    private void checkpassword (): void {}
    var newauthor:VOAuthor = new VOAuthor();
    NewAuthor.lname_aut = nom.text;
    NewAuthor.fname_aut = prenom.text;
    myRemote.validate (newauthor);

    }
    private function checkInput (): void
    {
    If (nom.text == "" |) first name. Text == "")
    {
    lResponse.text = ' Please fill all the fields;
    }
    on the other
    {
    lResponse.text = "connect";
    CheckPassword();
    checkLogin ("login. Verify.Validate", [name. Text, first name. Text]);
    }
    }
    []] >
    < / fx:Script >
    < fx:Declarations >
    <! - Place non-visual elements (e.g., services, items of value) here - >
    < mx:RemoteObject id = "myRemote" destination = "MyService" source = "MyService".
                             endpoint=" http://localhost/AMFPHP/gateway.php "showBusyCursor ="true"/ > "
    < / fx:Declarations >

    < s:Panel = "334" x = "168" width = "245" height = "135" title = "Log" textAlign = "center" >
    < s:TextInput = "102" x = "10" textAlign = "left" id = "name" / >
    < s:TextInput = "102" x = "40" textAlign = "left" id = "FirstName" / >
    < s:RichText x = "50" y = "6" text = "" Login: "height ="22"width ="56"textAlign ="left"verticalAlign ="bottom"/ >"
    < s:RichText = "27" x = "46" text = "" password: "height ="20"/ >"
    < s:Button = "125" x = "70" label = "Connect" width = "105" click = "checkInput ()" / >
    < mx:Label x = "380" y = "10" id = "lResponse" / >
    < / s:Panel >
    < / s:Application >

    Here is my php code:

    <? PHP
    session_start();

    require_once ('. / vo/org/corlan/VOAuthor.php');

    Conection info
    define ("DATABASE_SERVER", "127.0.0.1");
    define ('DATABASE_USERNAME', 'root');
    define ("DATABASE_PASSWORD", "xxxx");
    define ('database_name', 'flex360');

    class MyService {}

    function validate ($author) {}

    $mysql = mysql_connect (DATABASE_SERVER, DATABASE_USERNAME, DATABASE_PASSWORD);
    @mysql_select_db (database_name);

    $user = $author [0];
    $pass = $author [1];

    $query = "SELECT DISTINCT * from authors_aut WHERE fname_aut = '$user' AND lname_aut = '$pass" ";
    $rs = mysql_query ($query);

    $var = mysql_fetch_assoc ($rs);
    $u = $var ["fname_aut"];
    $p = $var ["lname_aut"];

    If ($pass! = $p) {}
    $response [0] = 'INVALID ';
    $response [1] = 'invalid username or password ";
    } else {}
    $response [0] = "VALID";
    $response [1] = 'welcome $u. '
    }
    Return $response;
    }

    }

    ? >

    Try here:

    http://www.vipercreations.com/tutorials/Adobe%20Flex/28.html

  • How to use unicode in flex?

    Hi all


    I use flash builder 4.

    now I design a virtual keyboard in hindi...

    I don't know how to use unicode to the program...

    If someone is aware of this response to please me.


    Thanks in advance...



    Kind regards

    Saran r

    You don't have to do anything special to use Unicode in Flex. It is managed by the Flash Player.

    If you use an embedded font, however, you can reduce the range of Unicode characters embedded in order to save a few kilobytes.

  • How to use the virtual keyboard in flex application

    Hello..

    I use flash builder 4.

    How to use the virtual keyboard in flex?

    If one aware of this pls answer me...

    --

    Saran r

    Hello

    You can declare the event directly click handler MXML online, you don't need the initfunc() on creationComplete:

    You need not switch in handleEvent, a line will do everything:

    TextBox.Text += button .label (event.currentTarget);

    The only advantage I see declaring all these components button in MXML, you can visually position the keys by using Design view in Flex Builder.

  • How to use Flex with EJB3?

    Anyone know how to integrate Flex with Java?

    I have a project EJB3 with JPA etc...

    Must use Eclipse with the Flex plugin or can I only use Flex Builder and Eclipse for java classes? (preferring the second option)

    I'm going crazy, this need for my college work, as quickly as possible.

    Please an explanation or a sample.

    Thank you all.

    1. I need to write any Servlet to use the HTTP protocol to connect with Flex, then create the wsdl for my EJB3.

    There are many free tools that helps you to convert a Java application to webservice.  Other tools

    2 - this wsdl will create client side of my application, so I create my Flex normally using Blaze DS HTTP interface?

    I never used to Blaze DS, but it is based on Java.

  • How to use the variable in the path of the source of an image in flex

    Hello
    I just want to know that how to use the variable in the path of the source of an image in flex

    Hello
    I just want to know that how to use the variable in the path of the source of an image in flex

  • How to use the Gumbo RTL support in Flex Builder 3

    Hi all

    I want to use the new sdk Flex with FLEX builder 3. I have already installed the SDK software and it works, but what components should I use for the right to left support?

    Lior

    Gordon Smith

    Adobe Flex SDK team

  • How to use the same services-config for servers the and remote.

    My flex project works very well using the bottom but when I download my flash on the server I do not work, all the files and related paths are the same execpt remote is a linux server.

    <? XML version = "1.0" encoding = "UTF-8"? >
    <>services-config
    < services >
    < id = 'amfphp-flashremoting-service' service
    Class = "Flex.Messaging.services.RemotingService"
    messageTypes = "flex.messaging.messages.RemotingMessage' >"

    < destination id = "amfphp" >
    <>channels
    < Ref channel = "my-amfphp" / >
    < / channels >
    Properties of <>
    < source > * < / source >
    < / properties >
    < / destination >
    < / service >
    < / services >
    <>channels
    < channel-definition id = "my-amfphp" class = "mx.messaging.channels.AMFChannel" >
    " < endpoint uri = ' http://localhost/domainn.org/AMFPHP/gateway.php "class="flex.messaging.endpoints.AMFEndpoint"/ > "
    < / channel-definition >
    < / channels >
    < / services-config >

    I think the problem is the line


    " < endpoint uri = ' http://localhost/domainn.org/AMFPHP/gateway.php "class="flex.messaging.endpoints.AMFEndpoint"/ > "

    but I don't know how to use the same services-config for servers the and remote.

    I'll back up a bit.

    Breakpoint URLS are defined as follows in the services - config.xml:

    https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure

    The meaning of each of the tokens is clearer when we see them as part of a complete url. If your context root is set to http://localhost , then I have no idea how your application runs in any environment.

    If you leave the server.name and server.port chips in your configuration file, then they will be replaced when executing according to the location from which your application is served. However, the context.root token is replaced at the time of the compilation based on the value that you specify in Flex Builder or when calling mxmlc.

    In order to reuse your file services - config.xml, you must use the same context-root on your development environment and to your deployment environment.

  • Communication between objects separate flex

    Hello

    I want to have an invisible flex object as part of the menu of my website and have a certain page, shown in the other context, in which there will be an another flex control with all the necessary controls to control the object invisible flex. Is this possbile and how do I go about this?

    Thank you.

    Yes! It is possible, that you can use the ExternallInterface class and some javascript functions to communicate with each other.

  • How to make an object image 2d to 3d

    Hi all

    I have this image of a robot - gross

    I would like to put this in another image (the plan) and move according to the movements of the robot. I think that the best way to do this is in fact a 3-d object and placing the texture on it.

    However, I am having difficulty to modify the examples on the site or (Community area) to achieve this. This also includes set up the camera to effectively eliminate the 3rd dimension, but still show the entire map (which is an image of void 512 by 512 pixels. The image of the robot is 40 x 40 pixels.

    An example in LabVIEW 8.6 (open-able) would be really useful in helping me to learn how to use these powerful 3d photo controls.

    Kind regards

    James

    Hi James,

    I'm not experienced with 3d image controls, but since - if I understand - you want only to view flat (2d) I think that a plain image (2d) control will do the job.

    Draw the image store in a shift register, and then draw the robot to the required position. To move the robot just, take the SR background image and draw the robot to the new position.

    There are several interesting discussions on image controls in this forum, for example the nugget Darren here.

    Hope this helps,

    Daniel

Maybe you are looking for

  • Import of CSV with loop value FOR

    Good afternoon I'm new to LabView and trying to write a VI that will eventually run a set of calculations on a set of data with millions of data points. I want the VI to count the number of data imported points of the. As they are written to a CSV fi

  • HP Envy 15 notebook PC C8P47AV: black screen on laptop and also when I connect to monitor

    When I turn on my laptop I can see only a black screen.  I don't quite see the HP logo.  The hard drive seems to be spinninge I can hear the fan and the lights on the wireless and the caps lock are functional; believe so everything works well except

  • Have had a reliable networking until recently. Today, I can not connect at all. LAN is not seen at all.

    original title: network connectivity Have had a reliable networking until recently.  Today, I can not connect at all. Wired and wireless connections are not available. This position is limited to wired connectivity. 1. network and sharing shows disab

  • box arround editfield

    is it possible to have arround textfield boxes, how? thaks advances

  • Order depending on weight

    I need a smart solution...Imagine this exampleSelect A, B from the order of the table of 1,2;TABLE---------1 92 83 74 6Imagine I need "order by clause" according to the General TMP_ORDER of the table containing Weight FIELDA           5B 10I want to