Adobe
Products
Acrobat
Creative Cloud
Creative Suite
Digital Marketing Suite
Digital Publishing Suite
Elements
Photoshop
Touch Apps
Student and Teacher Editions
More products
Solutions
Digital marketing
Digital media
Education
Financial services
Government
Web Experience Management
More solutions
Learning Help Downloads Company
Buy
Home use for personal and home office
Education for students, educators, and staff
Business for small and medium businesses
Licensing programs for businesses, schools, and government
Special offers
Search
 
Info Sign in
Welcome,
My cart
My orders My Adobe
My Adobe
My orders
My information
My preferences
My products and services
Sign out
Why sign in? Sign in to manage your account and access trial downloads, product extensions, community areas, and more.
Adobe
Products Sections Buy   Search  
Solutions Company
Help Learning
Sign in Sign out My orders My Adobe
Preorder Estimated Availability Date. Your credit card will not be charged until the product is shipped. Estimated availability date is subject to change. Preorder Estimated Availability Date. Your credit card will not be charged until the product is ready to download. Estimated availability date is subject to change.
Qty:
Purchase requires verification of academic eligibility
Subtotal
Review and Checkout
Adobe Developer Connection / Flex Developer Center /

Why choose Flex and PHP

by Mihai Corlan

Mihai Corlan
  • corlan.org

Content

  • What is Flex?
  • Why Flex?
  • Flex and AJAX
  • Flex and PHP waltz

Created

22 March 2010

Page tools

Share on Facebook
Share on Twitter
Share on LinkedIn
Bookmark
Print
Flex RIA

Requirements

User level

All

Note: This article was written using Flex 4 and/or Flash Builder 4, however, the information described here is still valid for Flex 4.5 SDK and/or Flash Builder 4.5 though some minor changes might be necessary.

As a fellow European said: "This is the question!". We have a question and you expect an answer. Right! I’m afraid you’ll have to wait a little bit. And not because I want to tease you, it is just there are so many things one can say about Flex, PHP, or about Flex and PHP integration.

What is Flex?

Enough digressions! Let’s start from the beginning: what is actually Flex (I assume by now everyone knows what PHP is)?

The simplest answer is: Flex is just another way of creating an application authored in Adobe Flash Professional on Adobe Flash Player. A Flex application gets compiled into a SWF file, which is played inside of the browser by Flash Player. Why did we need another way of creating applications authored in Adobe Flash Professional on Adobe Flash Player? Traditionally those applications were created using the Flash Professional authoring tool. If you take a look at this tool, you’ll notice that it is oriented primarily for designers. There is a stage, a timeline, drawing tools, and so on.

When you are developing applications and you care about productivity, you want components, you want to be able to streamline development as much as possible by reusing code, and not last but not least, you want a modern IDE.

Thus a revised answer could be: Flex is an open source framework that helps developers to quickly create Rich Internet Applications (RIAs) that run inside Flash Player or Adobe AIR (see Figure 1 for a list of built-in UI components). The framework was shaped pretty much as it is today with the arrival of Flex 2, Flash Player 9, and ActionScript 3. The current version is Flex 4.

Built-in UI Flex components
Figure 1. Built-in UI Flex components

Why Flex?

So using Flex you can create applications for Flash Player (web apps) or Adobe AIR (desktop apps). But what is so cool about building applications for Flash Player or Adobe AIR?

Well, at least there are two reasons: RIA and Contextual Applications.

If you compare the web applications with the desktop ones you can draw these points:

  • Web applications are cool because you can use them wherever you have a browser and an Internet connection. They have lower costs for distribution and maintenance because all you have to do is to update the server with the new version and all the clients are updated.
  • Desktop applications are cool because they offer great UI experience and at the same time are very responsive to the user actions.

Each of these two categories has its own strengths. Wouldn’t be cool to have a third category that combines the reachness and availability of web apps with the richness and responsivness of desktop apps? Actually this category already exists (since 2002 when Macromedia used for the first time this term) and it’s called Rich Internet Applications. With Flex you can build RIAs easily.

From its inception in 2002, RIA came a long way. The first use cases were public facing applications. In the last couple of years we’ve seen an increasing usage of RIAs behind the firewall, in the enterprise world. Using the RIA approach in enterprise means bigger ROI. In Figure 2 and Figure 3 you can see how a simple form for gathering data about car crashes can be implemented using RIAs. Instead of having a bunch of text areas that force the user to type in a lot of information, you can create a user interface that lets the user pick up the car, describe the damages, and "draw" the accident scene.

The RIA approach
Figure 2. The RIA approach
The RIA approach
Figure 3. The RIA approach

One may think that if you build your application with Flex you’ll have problems with users not being able to consume your application because they don’t have Flash Player installed. This is not true, because for years 98% of all connected computers have Flash Player installed.

And the beauty of it is this: as a Flex developer you don’t have to care about browsers with different implementations of JavaScript and CSS or about differences between the same browser on different operating systems. By targeting Flash Player you leverage its consistency across OSs and browsers.

What about Contextual Applications? Contextual applications "are characterized by their ability to adapt presentation and performance to different application contexts, including multiple operating systems, platforms, and devices; diverse and changing types of networks; and unique user expectations and personalization".

A good example of the contextual applications is Times Reader by The New York Times (See Figures 4 and 5). This is an Adobe AIR application created with Flex, and it can run on desktops, laptops, PCs, tablets, and phones. It has offline support (you can read the news while not connected, because it saves these locally). It has the ability to adapt the content to the screen size (it can increase or decrease the number of columns, and remove pictures and articles from the active screen in order to fit the current size of the screen).

Times Reader running on HP’s slate tablet
Figure 4. Times Reader running on HP’s slate tablet
Times Reader running on my laptop
Figure 5. Times Reader running on my laptop

And finally I want to add to the case I’m building the Mobile world. More and more people have smartphones and use these devices for activities that not so long ago were possible only with laptop or desktop connected to a wire. And this trend is going in only one direction: UP! Soon there will be more people accessing the Internet from mobile devices than from computers. What about building applications for these devices? Well, to put it mildly is a nightmare. And it really isn’t someone’s fault! Having many companies building so many devices it is only natural to have specific ways for each platform (Symbian, Web OS, BlackBerry, Android, Windows Mobile, and iPhone).

2010 is the year when Adobe releases Flash Player 10.1 and Adobe AIR 2 for mobile devices (the first to receive this will be Android and BlackBerry; for iPhone you can use the next version of Flash Professional to package Flash apps as a native app). We are still working to create a Flex framework suited for mobile devices. Once you have this, you will be able to leverage your current Flex experience on mobile world.

Flex and AJAX

Both Flex and AJAX are client-side technologies and both can be used to create RIAs or to "augment" existent web applications. Like in the case of Flex, typically an AJAX application makes a request to server after the initial response was rendered, and injects the response into the existing page once the servers sent the answer to that call.

While Flex is an application framework to build apps for Flash Player or Adobe AIR, AJAX is a term that refers to a collection of technologies and techniques that include JavaScript, HTML, and CSS. Typically when you work with AJAX you use a framework (Ext JS, Dojo, jQuery, Prototype and so on). The reason you are doing this is mainly to cope with the differences between browsers implementations for JavaScript/HTML/CSS.

Having said that, in the end it is really up to you what technology to choose. If you prefer to work with a dynamic, weak-type, prototype-based language, you will probably favor AJAX. If you have experience with JavaScript and you don’t want to learn a new language, again AJAX is the answer for you. If you prefer strong-type, OOP languages, modern IDEs features you’d probably prefer Flex. Arguably Flex (and Flash Player) offers more flexibility and features when compared to what is possible with AJAX (even with the new additions of HTML 5). But again, there is no such thing as one is better than the other. It really depends on the nature of the project you are working on, your experience, etc.

In fact, there are people using both technologies to do things that would be impossible to do with only one of them.

Flex and PHP waltz

Flex is a client side technology; PHP is a server side technology. Both technologies are quite mature: you can find tools, frameworks and libraries, and articles/examples for any task or application type you might think of.

Both technologies are open, and both have the lowest entry point: your time to understand them. Using Flex or Adobe AIR SDK and PHP with vi doesn’t cost a thing, and the same is using the runtimes (Flash Player or Adobe AIR) and using a web server with PHP.

If you are used to code using IDEs you can buy Flash Builder and Zend Studio to create a powerful setup for Flex and PHP projects (both these IDEs are Eclipse based and can be installed together on the same Eclipse instance).

Finally it is about being able to create better applications, being able to use text, video, sound, animations, gestures, multi-touch to create rich user interfaces, being able to create real-time, collaborative applications, being able to use the same technologies and workflows across OSs and devices (computers, smartphones, tablets)…and having fun while doing this.

Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License

More Like This

  • Using automated tools across the lifecycle to develop higher quality Flex applications
  • Increasing Flex and ActionScript development productivity with Flash Builder 4.5 and SourceMate 3.0
  • Creating a rich buying experience with a data-driven RIA
  • Building a portable RIA with Flex and PDF
  • Flex mobile development tips and tricks – Part 2: Styling your application's tabs and ActionBar
  • What's new in Flex 4.6 SDK and Flash Builder 4.6
  • Flex mobile skins – Part 3: Multiplatform development
  • Flex application testing with RIATest 4
  • Migrating Flex 3 applications to Flex 4 – Part 2: Beginning migration of the Dashboard application to Flex 4
  • Flex mobile skins – Part 1: Optimized skinning basics

Tutorials & Samples

Tutorials

  • Flex mobile performance checklist
  • Flex and Maven with Flexmojos – Part 3: Journeyman
  • Migrating Flex 3 applications to Flex 4.5 – Part 4

Samples

  • Twitter Trends
  • Flex 4.5 reference applications
  • Mobile Trader Flex app on Android Market

Flex User Forum

More
07/25/2011 Flash Player Debug Issues - Safari 5.1 & Chrome 13
04/22/2012 Loader png - wrong color values in BitmapData
04/22/2012 HTTPService and crossdomain.xml doesn't work as expected
04/23/2012 Memory related crashes in Flex application

Flex Cookbook

More
04/06/2012 How to detect screen resize with a SkinnableComponent
02/29/2012 Embed Stage3D content inside Flex application components
02/15/2012 Custom WorkFlow Component
02/09/2012 Using Camera with a MediaContainer instead of VideoDisplay

Products

  • Acrobat
  • Creative Cloud
  • Creative Suite
  • Digital Marketing Suite
  • Digital Publishing Suite
  • Elements
  • Mobile Apps
  • Photoshop
  • Touch Apps
  • Student and Teacher Editions

Solutions

  • Digital marketing
  • Digital media
  • Web Experience Management

Industries

  • Education
  • Financial services
  • Government

Help

  • Product help centers
  • Orders and returns
  • Downloading and installing
  • My Adobe

Learning

  • Adobe Developer Connection
  • Adobe TV
  • Training and certification
  • Forums
  • Design Center

Ways to buy

  • For personal and home office
  • For students, educators, and staff
  • For small and medium businesses
  • For businesses, schools, and government
  • Special offers

Downloads

  • Adobe Reader
  • Adobe Flash Player
  • Adobe AIR
  • Adobe Shockwave Player

Company

  • News room
  • Partner programs
  • Corporate social responsibility
  • Career opportunities
  • Investor Relations
  • Events
  • Legal
  • Security
  • Contact Adobe
Choose your region United States (Change)
Choose your region Close

North America

Europe, Middle East and Africa

Asia Pacific

  • Canada - English
  • Canada - Français
  • Latinoamérica
  • México
  • United States

South America

  • Brasil
  • Africa - English
  • Österreich - Deutsch
  • Belgium - English
  • Belgique - Français
  • België - Nederlands
  • България
  • Hrvatska
  • Česká republika
  • Danmark
  • Eastern Europe - English
  • Eesti
  • Suomi
  • France
  • Deutschland
  • Magyarország
  • Ireland
  • Israel - English
  • ישראל - עברית
  • Italia
  • Latvija
  • Lietuva
  • Luxembourg - Deutsch
  • Luxembourg - English
  • Luxembourg - Français
  • الشرق الأوسط وشمال أفريقيا - اللغة العربية
  • Middle East and North Africa - English
  • Moyen-Orient et Afrique du Nord - Français
  • Nederland
  • Norge
  • Polska
  • Portugal
  • România
  • Россия
  • Srbija
  • Slovensko
  • Slovenija
  • España
  • Sverige
  • Schweiz - Deutsch
  • Suisse - Français
  • Svizzera - Italiano
  • Türkiye
  • Україна
  • United Kingdom
  • Australia
  • 中国
  • 中國香港特別行政區
  • Hong Kong S.A.R. of China
  • India - English
  • 日本
  • 한국
  • New Zealand
  • 台灣

Southeast Asia

  • Includes Indonesia, Malaysia, Philippines, Singapore, Thailand, and Vietnam - English

Copyright © 2012 Adobe Systems Incorporated. All rights reserved.

Terms of Use | Privacy Policy and Cookies (Updated)

Ad Choices

Reviewed by TRUSTe: site privacy statement