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
   

PHP ARTICLES

- 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...
- PHP: Building Concrete Validators
- Sanitizing Input with PHP
- Executing Shell Commands with PHP
- Handling File Data with PHP
- File Security and Resources with PHP
- ArrayObject PHP Class Examples
- ArrayObject PHP Class: An Introduction
- Getting File System Data with PHP
- PHP Tools for Working with the File and Oper...
- Working with the File and Operating System w...
- PHP Proxy Patterns: Completing a Blog


© 2003-2012 by Developer Shed. All rights reserved. DS Cluster 3 - Follow our Sitemap

Dev Shed Tutorial Topics: