1 / 3
Caption Text
2 / 3
Caption Two
3 / 3
Caption Three margin testing

Showing posts with label Flex. Show all posts
Showing posts with label Flex. Show all posts

Thursday, July 30, 2009

Create a Stunning Website with Flex Applications

Create a Stunning Website with Flex Applications

Published on: July 30th, 2009 12:05am by: netultimate

(OPENPRESS) July 30, 2009 -- Flex is a free, open source framework for building highly interactive web applications that deploy consistently on all major browsers, desktops, and operating systems. Flex creates SWF files that are rendered by Flash Player. Flex applications are delivered on the web via the Flash Player or to the desktop via Adobe AIR.

Apart from this, web developments are quite commonly known in the world of Internet. It is actually the development of various web applications to form a website and includes all the components that are required to precede with the task, like web designing and e-commerce, content development of a website, web server configuration and server-side/client-side coding.

Flex application development is a newly introduced term and may not be known by many. It basically relates to Adobe flex, which is the cross-platform, that is based on the Macromedia flash software, which is a development framework and a comprehensive application advancement tool. It is also a solution for the development and delivery of RIAs (Rich Internet Applications) within the enterprise and also throughout the web to enhance the interactivity for the Internet.

Benefits of using Flex on your website
Here are some reasons for deciding to put a Flex application on your website:

• To have a very robust application that attractively visualizes complex data sets
• To engage your users or visitors and let them feel empowered
• Flex is the technology the future - it shows your organization is modern
• It works on all major platforms and users don't need to install anything
• Audio and video can be integrated, allowing even greater interaction
• Data synchronization allows real-time data push from back-end to application

Developing a Flex application
Free open source Flex software is available but many serious developers like to use Adobe Flex Builder software for quick, professional development and maintenance of applications. If you don't have a Flex development expert in your team, outsourcing to specialist offshore Flex developer may be the solution.

Adobe Flex Builder 3 Professional offers all of the powerful features included Adobe Flex Builder 3 Standard plus powerful memory and performance profiling tools, the new Advanced Data grid, support for automated functional testing, and extensible charting components for rich data visualization.

Thursday, July 23, 2009

Adobe Releases Beta Text Layout Framework

Adobe Releases Beta Text Layout Framework
by Jennifer Farley

logo_flashplayerThis week, Adobe announced the beta release of the Text Layout Framework, an extensible library, built on the new text engine in Adobe Flash Player 10. This will allow developers and designers to use more sophisticated typography layouts in Web applications. The framework is intended for use with Adobe Flash CS4 Professional or Adobe Flex, and is included in the next version of Flex, code named Gumbo.

Layout

The Text Layout Framework delivers multi-lingual, print-quality typography for the web, including support for:

  • Bidirectional text, vertical text and over 30 writing systems including Arabic, Hebrew, Chinese, Japanese, Korean, Thai, Lao, the major writing systems of India, and others
  • Selection, editing and flowing text across multiple columns and linked containers, and around inline images
  • Vertical text, Tate-Chu-Yoko (horizontal within vertical text) and justifier for East Asian typography
  • Rich typographical controls, including kerning, ligatures, typographic case, digit case, digit width and discretionary hyphens
  • Cut, copy, paste, undo and standard keyboard and mouse gestures for editing
  • Rich developer APIs to manipulate text content, layout, markup and create custom text components

While this might be especially of interest to developers (because it looks like there is a bit of hard work behind the scenes to use it), for designers it means that online typography design is coming closer to what can be achieved in print. On the Adobe website you can test out eight examples of how you can manipulate and control text. Examples include working with columns, text effects, linked containers, ligatures and graphics. On first impression, the ability to work with text like this feels a little bit like InDesign "lite," which is very exciting if you love type and are frustrated with current limitations on the web. You can play with the examples here.

LayoutEffects

You can also try out the Text Editor Layout Demo
.
To see Text Layout Framework in action, some sites that are using the technology are the New York Times Reader demo, the Boston Globe Reader and Makebook.

Saturday, June 13, 2009

Introducing Cairngorm

Introducing Cairngorm | Adobe Developer Connection

This document is from the authorized Flex curriculum written by Adobe Customer Training.

In this document, you will learn the basics of building Flex applications using the Cairngorm framework. You will:

  • Understand the basics of Cairngorm
  • See how Cairngorm is used in Flex RIAs
  • Implement the ModelLocator
  • Implement the ServiceLocator
  • Implement Cairngorm events
  • Implement Commands
  • Implement the FrontContoller
  • Implementing Delegates
  • Use the Cairngorm components

This chapter has a PDF document which has content and walkthrough steps. The walkthroughs are hands-on activities that you complete in Flex. These walkthroughs are key to learning and should be done as you encounter them in the text. The files used in the walkthroughs are contained in the ZIP file. Follow the instructions in the document to unzip and install the files. This chapter assumes you have installed Flex Builder 3.

Requirements

In order to make the most of this article, you need the following software and files:

Flex Builder 3

Prerequisites

Moderate experience writing applications in Flex.

Download the lesson file and sample code

Sample files:

Installation instructions

The installation instructions are part of the first walkthrough on Page 8 of the document.

About the author

This document is authored by the Adobe Customer Training/Partner Enablement Group, with major portions of the content written by Thomas Burleson of Universal Mind, the Delegates content written by Leo Shuman of Adobe Customer Training, under the guidance of Matt Boles.

Friday, June 12, 2009

How do I learn Flex?

Sean Moore - Flex Developer, AIR Developer, ActionScript Programmer

The world of Flex development is pretty big and it's expanding all the time. There are many types of applications that can be built with Flex from dashboards to widgets, media playback utilities to Enterprise RIAs and don't forget interactive kiosks and Internet aware desktop applications. One of the most common questions that I get asked is: How/Where do I learn Flex? I think one of the keys to mastery is a successful learning path. I also think that a solid foundation goes a long way. We've all heard the phrase: "crawl, walk, run…"

Here are some resources that helped me learn Flex. They are organized in a somewhat sequential fashion.


Beginner

Lynda.com

O'Reilly Programming Flex 3

Adobe.com

DClick Adobe Flex Coding Guidelines

CFlex, Community Flex

Using ASDoc


Intermeditate

AtTest (practice exam engine for Adobe Flex Developer Certification)

Flex Certification

Flexlib (open source user interface components)

Flex Unit

Subversion

Creating Flex components

Developing Flex RIAs with Cairngorm (Steven Webster, Adobe Consulting)

David Tucker

Mate Framework

Adobe Flex Community Expert program

Papervision / Away3D

MXMLC

Flex and SWC files

Degrafa


Advanced

Livecycle

Flash Media Server

Flex Charting

ILog Charts

Particle Systems

Flint (more particles)

Paul Ortchanian (scripted 3D, particles, bezier)

Flex Modules

Flex Profiler

Flex Ant Tasks

BlazeDS

Misc. Resources:

Mike Chambers blog

Ryan Stewart blog

Kevin Hoyt

Eric Feminella blog

Ted Patrick blog

Lee Brimelow blog

Flex Show

Adobe Developer Connection

Adobe Edge Magazine

Flex.org

Adobe Feeds

Flex Camp

Farata Systems Training

Comtaste (Flex training)

Beyond Flex

Spring

Hibernate

MySQL

Oracle

JPA

Ant

Java

Design Patterns: Elements of Reusable Object-Oriented Software

VTC - Design Patterns videos

Continuous Integration

Agile software development

SCRUM

UML

TDD

Test Driven Development by Example

How To Design A Good API and Why it Matters

Choosing a Flex Architectural Framework

Bill Gloff » Cairngorm
Friday, January 30th, 2009

If you're working on a moderate to complex Flex/Air application I hope you are using some kind of MVC style framework to help with organizing your components and the interactions between them. If you do not use a framework, you will unknowingly be creating your own. This, consequently, makes it harder for others to get up to speed with any maintenance that will need to be completed, and you will be on the hook to create all the related documentation. Also, why re-invent the wheel when pre-existing frameworks, such as Cairngorm, PureMVC, Swiz, or Mate, already implement best practices and are field-tested? All you need to do is set aside a little time to learn them.

I'm currently working on a greenfield project where I have a Flex/AIR front-end talking to RESTful services provided by Groovy on Grails. I'm a few weeks into the project, but my latest challenge has been deciding on what MVC ActionScript/Flex framework to use. Let me attempt to tell you a little about my process thus far, in case you're going through this yourself.

If you've done any Flex at all I'm sure you've heard about the market-leading framework Cairngorm. It's currently the most popular choice for enterprise worthy applications. It took its inspirations from the Sun J2EE Blueprint Catalog and implemented all the Java based patterns in ActionScript (AS). Some of these well-known patterns are the Command, Front Controller, MVC, Singleton, Value Object, and the Delegate. I believe some reasons for the success of Cairngorm is because AS is very similar to Java with a little mix of JavaScript thrown in for good measure. Then, you add the fact that Adobe (and previously Macromedia) likes targeting server-side Java guys (LiveCycle Data Services anyone?), which should make them comfortable with Cairngorm once they get up to speed on Flex and AS. Since it's been around for a long time there's quite a bit of documentation on it (in blogs, as well as books), and even code generators, which attempt to speed up development time. In Flex Builder 4, which will be released later this year, Adobe will be integrating Cairngorm support into Flex Builder out of the box. Very appealing indeed!

I know PureMVC is getting a lot of hype lately as it enforces a strict MVC and has been ported to a lot of different platforms such as Java, AS, and even Objective C and Ruby. I haven't used it, but I read up on it quite a bit. It seems a little awkward to me since it doesn't take advantage of Flex binding. I know this is because it remains a language/platform independent framework that focuses on giving you a way to do MVC. I'm sure PureMVC has its merits though, and I believe I would enjoy it if a project I was working on already had it… same for Cairngorm. The only things I would look to add to each of those would be some good ole Inversion of Control Prana style (now called Spring ActionScript) to spice things up, and simplify some of the code.

The next framework I read up on was Swiz. This seems like a great combination of MVC and IOC, and it's the only framework to use AS3 Metadata to wire up all your components. It is a very innovative approach with the only concern being maturity compared to Cairngorm and PureMVC. I probably would look into this one a bit more if it wasn't for my first choice…

I started my project thinking that I'll go with Cairngorm, but as you probably figured out, I changed my mind. This happened after I saw a demo of a Flex-based framework called Mate. In my opinion, Mate is one of the more lightweight frameworks out there. I say lightweight because it attempts to use native Flex events whereas in Cairngorm you are forced to have your events implement a Cairngorm interface. This is a dependency I do not care much for. Mate's philosophy is to make your views oblivious to what is going on in the backend… from getting some data from your server to injecting those values into your model. You can have all your custom components be free of any references to any Mate related classes, which is a good sign for an MVC oriented framework. Mate has a concept that none of the other frameworks have that I find intriguing… maybe because its different from the J2EE inspired frameworks, and I am digging how it takes advantage of MXML, whereas the others use more ActionScript. Basically, the main concept of Mate is to define an Event Map, which is just a switchboard of what actions to invoke when a specific event is fired. This is where most of your server calls come into play and injecting the values into your Managers which are singleton based models for your views and also take advantage of bindings. This Event Map is all tag based, which I like, but since it's all AS under the covers, you probably can implement your Event Map in a regular class if you prefer.

I've just begun really using Mate and I'm enjoying the process of wiring everything together. It seems well thought out and simple, but also elegant. I'm also enjoying the fact that I'm programming in more of an event-based language, which these frameworks promote, especially Mate. As I get further into my project I'll try to give updates about how my experiences with Mate are transgressing.

To get a better comparison of these frameworks you should read the 5 part article "FrameworkQuest 2008". It's a great read seeing how Tony Hillerson went and developed the same Twitter application using these 4 different frameworks and discusses the benefits and weaknesses of each.

So go and find yourself a framework to use. I'm sure whichever one you pick will work out for the best… if not, well then there's other options as you can see.

Top Ten Flex Tools and Resources

Sean Moore - Flex Developer, AIR Developer, ActionScript Programmer

When developing Flex and/or AIR applications there are a handful of tools that really make the difference between a good project and a great project. They are all very valuable and provide stability and clarity for the RIA development process; or at least they have for me. From Unit Testing to SVN utilities to frameworks and libraries I've found the following ten items to be very useful and helpful. I'd even go so far as to say these are critical for quality Flex RIA development; but as Les says: "It's just a matter of opinion." ;)

Cairngorm
Cairngorm is the lightweight micro-architecture for Rich Internet Applications built in Flex or AIR. A collaboration of recognized design patterns, Cairngorm exemplifies and encourages best-practices for RIA development advocated by Adobe Consulting, encourages best-practice leverage of the underlying Flex framework, while making it easier for medium to large teams of software engineers deliver medium to large scale, mission-critical Rich Internet Applications.
http://opensource.adobe.com/wiki/display/cairngorm/Cairngorm

Download:
http://download.macromedia.com/pub/opensource/cairngorm/cairngorm2_2_1-bin.zip

Flex Unit
FlexUnit is a unit testing framework for Flex and ActionScript 3.0 applications and libraries. It mimics the functionality of JUnit, a Java unit testing framework, and comes with a graphical test runner.
http://opensource.adobe.com/wiki/display/flexunit/FlexUnit

Download:
http://download.macromedia.com/pub/opensource/flexunit/flexunit0_9.zip

Subclipse
Subclipse is an Eclipse Team Provider plug-in providing support for Subversion within the Eclipse IDE. The software is released under the Eclipse Public License (EPL) 1.0 open source license.
http://subclipse.tigris.org/

Eclipse update site URL:
http://subclipse.tigris.org/update_1.6.x

Eclipse
Eclipse is a multi-language software development platform comprising an IDE and a plug-in system to extend it. It is written primarily in Java and is used to develop applications in this language and, by means of the various plug-ins, in other languages as well - C, C++, COBOL, Python, Perl, PHP and more.
http://www.eclipse.org

Download:
http://www.eclipse.org/downloads/

ASDoc
ASDoc is a command-line tool that you can use to create API language reference documentation as HTML pages from the classes in your Adobe® Flex® application. The Adobe Flex team uses the ASDoc tool to generate the Adobe Flex Language Reference.
http://livedocs.adobe.com/flex/3/html/help.html?content=asdoc_1.html

Flex Ant Tasks
The Adobe® Flex® Ant tasks provide a convenient way to build your Flex projects using an industry-standard build management tool. If you are already using Ant projects to build Flex applications, you can use the Flex Ant tasks to replace your exec or java commands that invoke the mxmlc and compc compilers. If you are not yet using Ant to build your Flex applications, you can take advantage of these custom tasks to quickly and easily set up complex build processes for your Flex applications.
http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_1.html

Installation:
http://livedocs.adobe.com/flex/3/html/help.html?content=anttasks_2.html#224215

Degrafa
Degrafa is a declarative graphics framework open source licensed under MIT.
http://www.degrafa.org

Download:
http://www.degrafa.org/code/

as3corelib
The corelib project is an ActionScript 3 Library that contains a number of classes and utilities for working with ActionScript 3. These include classes for MD5 and SHA 1 hashing, Image encoders, and JSON serialization as well as general String, Number and Date APIs.
http://code.google.com/p/as3corelib/

Download:
http://as3corelib.googlecode.com/files/as3corelib-.92.1.zip

Flex SDK coding conventions and best practices
Coding standards for writing open-source Flex framework components in ActionScript 3. Adhering to these standards makes the source code look consistent, well-organized, and professional.
http://opensource.adobe.com/wiki/display/flexsdk/Coding+Conventions

Flex Language Reference
The Flex 3.3 Language Reference provides syntax and usage information for every element in the ActionScript™ language. It documents all elements in Adobe® Flash® Player and Adobe® AIR™ that are officially supported by Adobe.
http://livedocs.adobe.com/flex/3/langref/

Wednesday, June 10, 2009

Using packages for code organization - Flex best practices

Flex best practices – Part 1: Setting up your Flex project | Adobe Developer Connection

Follow the best practices below on using packages for code organization:

checkmarkUse packages to organize and structure your projects codebase.

Packages are the standard for OOP-based applications. Packages represent logical groupings of related ActionScript and MXML files in the form of classes. The use of packages and classes is fundamental to object-oriented programming.

To continue with community standards, use the following practices for naming your packages:

checkmarkUse lowerCamelCase.

For example: com.seantheflexguy.stringUtils

checkmarkBegin the package name with the top-level domain (TLD) of the application's owner:

for example, com, net, us;

then use the application owner's name:

for example: seantheflexguy, adobe;

then the project name:

for example: burrow;

then the logical grouping of related code files:

for example: utils, components, or whatever is appropriate.

Here's an example of a package name using this convention:

com.seantheflexguy.burrow.view

Integrating unit testing - Flex best practices

Flex best practices – Part 2: Development practices | Adobe Developer Connection

Unit testing can ensure the quality of your codebase. Writing test cases can lead to more reliable and better code. Testing your code will help find errors and save debugging time. Here are a few best practices that can be applied when implementing unit testing.

checkmark Test behavior instead of testing methods

Writing code to test private methods is not always needed. This should be evaluated on a case by case basis. Write code to test against an object's public API. Typically private methods are used internally by a class to support its public API.

checkmark Apply the "too simple to break" rule

Don't over test the codebase. If the method is a very simple one line method, like a getter method, don't worry about writing a test case for it.

checkmark Use standard OOP best practices in test cases

Follow the same OO methodology you use to write the rest of your application. Refactor test cases to move common functionality into base classes as appropriate.

checkmark Use clear and concise test method names

Follow the same method naming conventions used elsewhere in the application's codebase. Avoid generic names for test case methods. This helps other developers easily understand the relationship, responsibility, and purpose of the method.

checkmark Write simple test case methods

Keep test cases simple and limit the decisions that are made within them.

checkmark Use static values in the assertion method calls when possible

This reduces the chances for error in your test cases and improves the maintainability and understandability of the test code.

checkmark Document the test code

Add comments that explain what is being tested and why. Also, outline any special circumstances regarding the test.

checkmark Create independent unit tests

Each unit test should execute a single behavior for each method.

checkmark Limit assertions to one per test case

Multiple assertions in a single test case can lead to performance issues. In addition, if one assertion fails the other assertions will not be executed until the first assertion passes.

Application development frameworks - Flex best practices

Flex best practices – Part 2: Development practices | Adobe Developer Connection

Using a framework you will greatly increase your chances of success, especially if your application contains a substantial amount of source code.

checkmark Consider using an application development framework

There is some disagreement about whether or not frameworks should be used when developing Flex applications. For enterprise level applications, as well as in teams of developers, frameworks are more generally recommended. My personal preference and recommendation is to use an application development framework. This enables a common language for the architecture of a codebase and provides direction for application development and scalability.

checkmark Use frameworks for team-based development efforts

Frameworks help teams to work together in a unified effort and can reduce the chances of duplicating development efforts.

checkmark Mate

Mate (pronounced "mah-tay") is a tag-based application development framework created for use with Flex. Mate is an unintrusive framework that allows for a loosely coupled codebase.

checkmark Cairngorm

Cairngorm is the de facto standard for Flex application development. If you don't already know Cairngorm you should definitely consider learning it. For more information on Cairngorm, check out this great Introducing Cairngorm article. Adobe Consulting uses Cairngorm and fully stands behind it for their development efforts.

checkmark PureMVC

This is a pure ActionScript 3.0 Model-View-Controller application development framework. Futurescale, the makers of PureMVC, describe it as follows: "PureMVC is a lightweight framework for creating applications based upon the classic Model-View-Controller design meta-pattern… The PureMVC framework has a very narrow main goal: to help you separate your application's coding concerns into three discrete tiers; Model, View and Controller."

checkmark Other frameworks

There are numerous other application development frameworks that can be used in conjunction with Flex or even just straight AS3 projects.

checkmark Know when NOT to use a framework

There are times when a framework is simply overkill for an application. If you are the sole developer of an application and you will be the only developer of the application for its lifetime, then you may not benefit from a framework. If you're developing something very simple, such as a banner ad, you can also skip the framework. The robust feature set offered by an application development framework is often not needed for very simple applications with limited data manipulation and minimal events. For another perspective, see this classic blog post by Steven Webster on the topic of when and when not to use an application development framework.


Application architecture - Flex best practices

Flex best practices – Part 2: Development practices | Adobe Developer Connection

Flex applications are complex systems that greatly benefit from thoughtful planning. Use proven methodologies to ensure the application being built is structurally sound.

checkmark Create use cases

Generate use cases for each goal or task in the application. Define the use cases from the perspective of an Actor. Typically, an Actor is simply a user of the application you are building. A use case can be created around any interaction that a user performs. Actors can also be the application itself, another application, or an outside system such as a web server.

checkmark Consider using UML

Describing the application's main classes and data model using the Unified Modeling Language (UML) can help refine the objects in your application and avoid potential rework to the code later.

checkmark Consider using code generation

There are a number of tools that will generate ActionScript 3.0 source code from UML diagrams. This can save time in some cases. Two tools worth investigating are Enterprise Architect from Sparx Systems and the free Violet ActionScript 3 Generator (VASGen).

checkmark Consider using design patterns

Two great books to have in your library are: Design Patterns: Elements of Reusable Object-Oriented Software and Head First Design Patterns.

Tuesday, June 9, 2009

Top 10 Changes in Flex 4

InfoQ: Top 10 Changes in Flex 4

This week, Adobe released their first official beta of Flex 4, codenamed Gumbo. The release includes a number of major changes. This list gives a high level overview of the items that have changed in the latest version of the popular RIA framework.

1. Integration with Adobe Catalyst

The primary focus of the Flex 4 development effort is providing support and integration with Adobe Catalyst - Adobe's new designer tool for creating rich Internet application assets without writing code. Catalyst promises to change the way that developers and designers are able to collaborate in their efforts, as it recognizes that application developers and designers work differently. Thus, it allows each to concentrate on what they are good at, as it enables each to work in the traditional ways they are accustomed to. The majority of the changes on this list have been made in order to facilitate integration between Flex and Catalyst.

Learn more about Adobe Catalyst here.

2. Spark Component Architecture

Each version of Flex includes a full component library with all of the common items needed to build an application, including data grids, buttons, layout containers, etc. In Flex 4, the underlying architecture of the components is known as Spark, where it was known as Halo in Flex 3. A major part of the effort to support Catalyst is in revamping the component model to adhere to a much higher level of separation of concerns.

In the new Spark component model, core logic, skinning, and layout have been broken out so that they are handled independently of one another. The Spark component model is built on top of the Halo component model. Basically, that means that it extends from Halo's core base class UIComponent, allowing Flex4 to be adopted incrementally and Flex 3 components to be used in Flex 4 applications.

In addition to the other changes, effects have been updated in Flex 4. Effects can now animate arbitrary objects and types, allowing for much greater flexibility in their use. Flex 4 effects have been implemented in the new "spark.effects" package. Just like the new component library, the Flex 4 effects have been re-implemented, leaving the Flex 3 effects in place for backwards compatibility. For more information on Gumbo Effects see Chet Haase's article on Flex 4 Effects or his blog.

Read the following white paper to learn more about the Spark architecture

3. MXML 2009

MXML is an XML-based abstraction, built on top of ActionScript 3 - the Flash Player programming language. MXML is used for laying out the view portions of the user interface and supporting tooling, such as the IDE, and now Catalyst. MXML 2009 includes a number of updates to support the decoupling of different behaviors (core, skinning, and layout) and the new component library. The Flex 4 components have been implemented in their own package (spark.components), leaving the Flex 3 components in place. MXML 2009 includes a new namespace to support this.

The following example of an application declaration shows using the namespace and defining both the Spark and Halo component namespace:

<s:Application
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/halo">

Thus, one can use a Flex 4 Button by doing the following:

<s:Button label="My Flex 4 Button" />

And, the following for a Flex 3 Button:

<mx:Button label="My Flex 3 Button" />

Check out the MXML 2009 specification for additional detail on the changes.

4. Improvements to View States

Flex 2 introduced the notion of states to the Flex framework, where changes to a view component can be managed through a simple state change. In Flex 4, view states have been revamped to simplify the syntax and make them easier to use. An example of the simplified syntaxes are the new language attributes includeIn and excludeFrom, which can be set on a component to direct them how to behave on a state change (See below).

<!-- Given the states A,B,C -->
<m:states>
<m:State name="A"/>
<m:State name="B"/>
<m:State name="C"/>
</m:states>

<!-- This button will appear in only states A and B -->
<Button label="Click Me" includeIn="A, B"/>

<!-- This button will appear in states A and B -->
<Button label="Button C" excludeFrom="C"/>

Look here for more information on the changes to View States.

5. FXG Support

At its core, the Flash Player is a drawing engine. Adobe has leveraged this with the introduction of FXG in Flash Player version 10, and now its introduction to Flex. FXG is a declarative graphics format, which enables portability of assets between tools. That means that designers will be able to create assets in Catalyst or CS4 Illustrator, and the Flex application developer will be able to import them and use them without having to modify them.

Check out the FXG Specification for more details.

6. Skinning Enhancements

The biggest change in the Spark component model was overhauling skins so that they now control all visual aspects of the components and encapsulate their logic outside of the components core. Thus, this allows the visual parts of a component to be modified independently of the underlying core logic.

Let's look at the PanelSkin.mxml skin file, the default skin for the Panel container, for an example:

<?xml version="1.0" encoding="utf-8"?>
<s:SparkSkin xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" alpha.disabled="0.5">

<fx:Metadata>
<![CDATA[
/**
* @copy spark.skins.default.ApplicationSkin#hostComponent
*/
[HostComponent("spark.components.Panel")]
]]>
</fx:Metadata>

<fx:Script>
/* Define the skin elements that should not be colorized.
For panel, border and title backround are skinned, but the content area and title text are not. */
static private const exclusions:Array = ["background", "titleField", "contentGroup"];

/**
* @copy spark.skins.SparkSkin#colorizeExclusions
*/
override public function get colorizeExclusions():Array {return exclusions;}

/* Define the content fill items that should be colored by the "contentBackgroundColor" style. */
static private const contentFill:Array = ["bgFill"];

/**
* @inheritDoc
*/
override public function get contentItems():Array {return contentFill};
</fx:Script>

<s:states>
<s:State name="normal" />
<s:State name="disabled" />
</s:states>

. . . . .

<s:Rect left="1" right="1" top="31" height="1">
<s:fill>
<s:SolidColor color="0xC0C0C0" />
</s:fill>
</s:Rect>

<!-- layer 5: text -->
<!-- Defines the appearance of the PanelSkin class's title bar. -->
<s:SimpleText id="titleField" lineBreak="explicit"
left="10" right="4" top="2" height="30"
verticalAlign="middle" fontWeight="bold">
</s:SimpleText>

<s:Group id="contentGroup" left="1" right="1" top="32" bottom="1">
</s:Group>

</s:SparkSkin>

Since the only job of this skin file is to control the visual appearance of the Panel container, it makes it possible for a designer to modify how the component appears without ever editing the component source code or understanding the internal behavior of the component. More importantly, it allows designers to use Catalyst in a way that is natural to them.

Look here for more information on skinning Gumbo components.

7. Updated Layout Model

Those familiar with Flex development will notice that the majority of the containers used in the Flex 3 developer are not a part of the Gumbo component library. This is because layout has been decoupled and is now handled through delegation. Since most of the Flex 3 containers existed simply to provide different forms of layout (e.g. HBox for horizontal layout, VBox for vertical layout), they are no longer needed.

The following example shows one way that a Flex developer can now define layout. This example uses the Group class to manage the buttons, which is a new Spark class for management content items. The result is the two buttons displayed side-by-side, like it would have with an HBox in Flex 3.

<s:Group width="400" height="400">
<s:layout>
<s:HorizontalLayout paddingLeft="5" paddingTop="5" />
</s:layout>

<s:Button label="Button 1" />
<s:Button label="Button 2" />
</s:Group>

Adobe's Ryan Stewart hosts the following tech talk reviewing the new layout mechanisms: http://blog.digitalbackcountry.com/2009/05/flex-4-layouts-on-tech-talk-with-ryan-stewart/

8. Flash Builder 4

Flash Builder 4, formerly known as Flex Builder, is the latest version of the Eclipse based IDE for application developers. The new version comes with a handful of updates including: conditional debug break points, more refactoring tools, and FlexUnit 4 support. As always, it includes MXML, ActionScript 3, CSS editors, a visual designer, and the Flex performance and memory profiler (profiler only in the Professional version).

In addition, the latest version includes advanced data management features to simplify the development of data-centric applications. This includes client side data management features that handle CRUD operations and scrolling through large collections on your services.

Get more information on the IDE here.

9. Compiler Performance

A major pain point most everyone developing Flex 3 applications has encountered is poor compiler performance. Thus, one of the published goals for Gumbo was to improve compiler performance in Flex 4. At this point, there are not any official benchmarks published from this work. However, Adobe's Peter Donovan did publish some notes on his early efforts, stating that he believed a 25% improvement would be reached without significant restructuring. He also said that to achieve a 3-4 times improvement, a redesign will be required. Certainly everyone developing enterprise Flex applications hopes that this is addressed by the time Flex 4 ships at the end of 2009.

See Peter Donovan's notes for more information.

10. New Text Capabilities

A major knock on Flash based applications (both Flex and non-Flex based) has been the ability to effectively deal with text. In Flash Player 10, Adobe introduced a new text engine to support the demands of rich Internet applications (multi-lingual, print, keyboard short-cuts, etc). Gumbo includes a handful of new text classes (RichText, SimpleText, etc) for more robust text support within the Flex framework. In addition, Adobe is working on their new Text Layout Framework to give all ActionScript 3 developers the ability to harness the power of the Flash Player's text engine. Learn more about the Text Layout Framework at: http://labs.adobe.com/technologies/textlayout/

As you can see with the wide range of changes, Flex 4 represents another step forward for the popular RIA platform. For additional information on the Flex 4 SDK changes, see Matt Chotin's article, What's new in Flex 4 SDK beta.

Author's Bio

Jon Rose is an enterprise software consultant and Flex Practice Director at Gorilla Logic, Inc. located in Boulder, Colorado. He is an editor and contributor to InfoQ.com, an enterprise software community. He is the co-host of DrunkOnSoftware.com, a videocast for those who like booze and bits. He has worked with clients large and small in both the private sector and government. His love of solving problems drives him to build quality software. You can read his blog at: http://ectropic.com.

New Flex Builder Flash Builder 4 and Flash Catalyst

From InfoQ comes news that Adobe has released betas of Flash Builder 4 (the next version of Flex Builder) and Flash Catalyst. These are public betas, so you might want to check them out if you have the interest and the time.

New features added to Flash Builder 4 include:

  • Template support
  • Event handler generation
  • Getter/setter generation
  • ASDoc tooltips
  • States-based code view
  • Package explorer
  • FlexUnit testing
  • Command-line build
Adobe® Flash® Catalyst™ is a new professional interaction design tool for rapidly creating user interfaces without coding.
  • Transform artwork created in Adobe Photoshop® and Adobe Illustrator® into functional user interfaces.
  • Create interactive prototypes with the ability to leverage them in the final product
  • Publish a finished project as a SWF file ready for distribution
  • Work more efficiently with developers who use Adobe Flash Builder™ 4 to create rich Internet applications (RIAs). Designers use Flash Catalyst to create the functional user experience then provide the project file to developers who use Flash Builder to add functionality and integrate with servers and services.

Saturday, May 30, 2009

Adobe's New Flex Presentation Tool

Acrobat Presentation is a Flex application that creates stunning presentations right from your browser. Work with others online on the same presentation at the same time. No more emailing attachments back and forth, combining comments or wondering who has the latest version. Learn more.

Friday, May 29, 2009

AMFPHP and MySQL character set

sephiroth.it: Flash send and expects data from and to the outside world using unicode UTF-8 (see technote). The gateway.php file in AMFPHP folder is the bridge between your flash .swf file and your service php class.

You need to choose right parameters for the setCharsetHandler method to match your MySQL(server) and AMFPHP service class (client) environment.

You may also want to change client charset in your service PHP class:
mysql_set_charset() - Sets the client character set
mysql_client_encoding() - Returns the name of the character set

Saturday, May 23, 2009

Install AMFPHP on GoDaddy Hosting Site

I got all my information form the following 3 web pages, especially the first one:
1. Install the AMFPHP

First download the AMFPHP library, unzip it and then copy the amfphp folder to webserver. On my Linux hosting site this folder is
~/html/Sites/en.h.com/amfphp
and the URL is http://en.hycademy.com/amfphp. (delete the .htaccess file from this folder.) If everything is right, you will be able to test all the exposed PHP classes at: http://en.hycademy.com/amfphp/gateway.php

Then download StartingWithAMFPHP1.zip Use SQL script to generate tables in MySQL database. Extract all from PHP directory into AMFPHP service directory. In FLEX directory you can find a finished Flex project that you can import into your Flex workspace.

2. Create database

mysql -h dbname.dbhost.com -u username -p <amfphp.sql

3. Create PHP files
PHP service classes
~/Sites/en.h.com/amfphp/services/org/zgflex/cookbook/services/FlexAMFPHP.php
~/Sites/en.h.com/amfphp/services/org/zgflex/cookbook/services/SoccerManager.php
data objects
~/Sites/en.h.com/amfphp/services/org/zgflex/cookbook/dao/Player.php
~/Sites/en.h.com/amfphp/services/org/zgflex/cookbook/dao/Team.php

Please note, PHP script must have the same name as the class inside of it.

4. Create Flex project
Import the Flex project.

MXML application uses two remote objects, one is calling dummy PHP service and the other one works with the soccer data and helps you handle the data.

StartingWithAMFPHP.mxml

......

<mx:RemoteObject id="FlexAMFPHPService" source="org.zgflex.cookbook.services.FlexAMFPHP" destination="amfphp"
fault="faultHandler(event)" showBusyCursor="true">
<mx:method name="communicationTest" result="checkCommunicationHandler(event)" />
<mx:method name="checkAnotherMethod" result="checkCommunicationHandler(event)" />
</mx:RemoteObject>

<mx:RemoteObject id="SoccerService" source="org.zgflex.cookbook.services.SoccerManager" destination="amfphp"
fault="faultHandler(event)" showBusyCursor="true">
<mx:method name="getTeams" result="getTeamsHandler(event)" fault="faultHandler(event)" />
<mx:method name="updateTeam" result="updatedTeamHandler(event)" fault="faultHandler(event)" />
</mx:RemoteObject>

......

Just as you created PHP data class in Team.php, you need to create a simple mapping class in Actionscript. In this class you will store all the data and use it for handling data changes and sending the data back to the server. See Player.as and Team.as in Flex project folder: src/org/zgflex

You also need to configure services-config.xml file, and edit your URL to the AMFPHP gateway.php script.You have to use this XML file while the Flex project is compiled. You will do this by adding compiler parameter in project properties. Your compiler propetries should look something like this:

-locale en_US -services "services-config.xml"

Export the release build to bin-release folder and upload it to webserver's folder: ~/html/Sites/en.h.com/StartingWithAMFPHP/, and now you can access it at: http://en.hycademy.com/StartingWithAMFPHP/StartingWithAMFPHP.html

Working with Flex and PHP in Eclipse

From: Working with Flex and PHP in Eclipse | Adobe Developer Connection
By: Mihai Corlan

Developers who work with Flex and PHP can boost their productivity by combining two tools: Flex Builder and Zend Studio for Eclipse. This setup lets you create a combined project with Flex and PHP natures and reap the benefit of coding in both languages. (In Eclipse, natures link a project with specific builders and other settings.) The setup also enables you to debug your Flex and PHP code at the same time.

In this article I will show you how to install Flex Builder 3 together with Zend Studio for Eclipse, how to create a combined project, and how to debug a project that uses Zend AMF to send data between Flex and PHP.

Requirements

In order to make the most of this article, you need the following software and files:

Flex Builder 3 Eclipse Plug-in

Zend Studio for Eclipse

Zend Framework 1.7 or newer

Web server with support for PHP 5 or newer

Sample files:

  • flex_php.zip (ZIP, 445KB)
  • Note: You can import this archive using Import > Flex Builder > Flex Project.

Prerequisite knowledge

To benefit most from this article, it is best if you are familiar with Flex Builder, ActionScript 3.0, and PHP.

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

Featured Post

Windows和Ubuntu双系统完全独立的安装方法

http://www.ubuntuhome.com/windows-and-ubuntu-install.html  | Ubuntu Home Posted by Snow on 2012/06/25 安装Windows和Ubuntu双系统时,很多人喜欢先安装windows,然...