Home arrow PHP arrow Page 3 - Rich Internet Applications: Introduction to Adobe Flex and PHP

Building the Application - PHP

AJAX is popular for the creation of rich Internet applications, but there are good alternatives. This article will introduce you to Flex applications, rich Internet applications that run inside the Adobe Flash player.

TABLE OF CONTENTS:
  1. Rich Internet Applications: Introduction to Adobe Flex and PHP
  2. Integrating Flex and PHP
  3. Building the Application
  4. Explaining the Application
By: Mike Potter
Rating: starstarstarstarstar / 37
April 25, 2006

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

Up until now, everything should seem fairly familiar.  We've got a PHP script and a MySQL database.  Now it's time to start building the interface to our application.

Flex applications are built using a combination of ActionScript (AS) 3.0 and MXML.  ActionScript is based on ECMA Script (same as JavaScript), so it should be familiar to web developers.  MXML is an XML based layout engine for Flex applications.

Essentially, you lay out the UI using XML, and script the UI using ActionScript.  The MXML for our interface is, again, very simple (only 26 lines!).

<?xml version="1.0" encoding="utf-8"?>
    <mx:Application
xmlns:mx="http://www.macromedia.com/2005/mxml" xmlns="*"
layout="absolute" creationComplete="userRequest.send()">
        <mx:HTTPService id="userRequest"
url="http://localhost/flex/php/request.php" useProxy="false"
method="POST">
            <mx:request xmlns="">
        <username>{username.text}</username><emailaddress>
{emailaddress.text}</emailaddress>
    </mx:request>
    </mx:HTTPService>
        <mx:Form x="22" y="10" width="493">
            <mx:HBox>
             <mx:Label text="Username"/>
            <mx:TextInput id="username"/>
        </mx:HBox>
        <mx:HBox>
            <mx:Label text="Email Address"/>
            <mx:TextInput id="emailaddress"/>
        </mx:HBox>
        <mx:Button label="Submit" click="userRequest.send()"/>
    </mx:Form>
    <mx:DataGrid id="dgUserRequest" x="22" y="128" dataProvider="{userRequest.result.users.user}">
        <mx:columns>
            <mx:DataGridColumn headerText="User ID"
columnName="userid"/>
            <mx:DataGridColumn headerText="User Name"
columnName="username"/>
        </mx:columns>
    </mx:DataGrid>
    <mx:TextInput x="22" y="292" id="selectedemailaddress"
text="{dgUserRequest.selectedItem.emailaddress}"/>
</mx:Application>



 
 
>>> More PHP Articles          >>> More By Mike Potter
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PHP ARTICLES

- Hackers Compromise PHP Sites to Launch Attac...
- Red Hat, Zend Form OpenShift PaaS Alliance
- PHP IDE News
- BCD, Zend Extend PHP Partnership
- PHP FAQ Highlight
- PHP Creator Didn't Set Out to Create a Langu...
- PHP Trends Revealed in Zend Study
- PHP: Best Methods for Running Scheduled Jobs
- PHP Array Functions: array_change_key_case
- PHP array_combine Function
- PHP array_chunk Function
- PHP Closures as View Helpers: Lazy-Loading F...
- Using PHP Closures as View Helpers
- PHP File and Operating System Program Execut...
- PHP: Effects of Wrapping Code in Class Const...

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: