Oct 9
Removing list of elements from Array or ArrayCollection

If you need to remove list of selected items in List component in Flex
you should not go from first element to last element of selectedIndices array
because once you remove one selected element all indexes will shift on one position to the left

solution is very simple you just need to go from last element to first element of selectedIndices array

in this case you will not have any problems with indexes

same for simple Array

May 17
Transparent Flex app click-through solution

In my project I had situation that I need to load flex transparent flex application and to haveposssibility to click through this applicatio
I was trying to set backgroundAlpha to zero, but it doesn’t help me because application container overlap object under this application
here is a trick
on application create complete:

private function creationCompleteHandler():void
{
rawChildren.removeChildAt(0);
}

it will removes displayObject in application which overlaps objects under flex app

Apr 15
How to get showEffect working first time

Today I got problem with showEffect in my project, when I added my component via PopUpManager.addPopUp I notice that showEffect doesn’t run.
To get it working you need add creationComplete handled inside component and dispatch FlexEvent.SHOW event in created handler.

happy coding ;)

Mar 17
FLASH&FLEX Developer’s Magazine 02/2009 issue review

ffdmag

I am glad to say that Flash & Flex Developer’s Magazine published new issue

FFD’s magazine is great, they growing every day, it seems that there is working professional people, they know how to do work in a best way!

Their articles dealing with important things for flash and flex developers.

Contents includes the following  articles and tutorials

  • Flash Flex developer interview with Dave Schroeder about the Flashbelt Conference…
  • BannerSnack – A quick alternative to Flash?…
  • Working With Flash CS4 New Features: Inverse kinematics (IK) with Bone Tool…
  • Tracking Time with Screenweaver HX…
  • Using all the different components within CS4 to built a complete site…
  • Model View Controller – What’s the Secret Sauce… ?…
  • JSFL Quirks…
  • SWX: The Native Data Format for Adobe Flash…
  • An introduction to Flickr In Flash…
  • Flash video and AS3…
  • WebORB tricks…
  • Multi-user Applications in haXe…
  • 7Achieving a retro-style using only Flash…
  • Secrets of a professional Flash game programmer…
  • Interview with Lee Brimelow…
  • More …

I would like to highlight some excellent articles:

  • “WebORB tricks” by Vitaliy Morarian
    “WebORB for Java - it is server-side technology which enables connectivity between Flex, Flash, AJAX and Silverlight clients and Java applications.”
  • “Secrets of a professional Flash game programmer” by Tom Rassweiler
    “For the last five years as the leader of the Flash development team at Arkadium, a NY based game development company, I have worked on more than a hundred Flash games for clients, ranging from toy companies like Mattel to publishing giants like Hearst and NewsCorp.”
  • “Working With Flash CS4 New Features: Inverse kinematics (IK) With Bone Tool” by Chetankumar
    “You will learn about recent updates to Flash CS4. Work with Flash CS4 Bone Tool.”

Everyone who is interesting to publish article can do it without any problems, this magazine is open for any suggestions

I published my first article “OOP with AS3″ in their first issue on 1/2008  and was very happy

You can find my second article in 2/2009 issue:

  • “Model View Controller – What’s the Secret Sauce… ?” by Anton Krasnoshchok
    “Business applications consist of a user interface (UI), business logic, and data models. For example, standard UI components such as buttons or checkboxes have UI elements, logic that knows how to respond to user inputs, and data models.”

You can subscribe to FFD’s magazine here
Can’t wait for next issue, nice work guys!

Jul 15
MVC Pattern Presentation (Cairngorm vs Mate)

This presentation will guide you through the MVC Pattern and Flex implementation of MVC (Cairgorm and Mate Frameworks)

download MVC.pptx (724.83 KB)

download MVC.ppt (889 KB)

download MVCCairngorm.zip (33.55 KB)

download MVCMate.zip (343.01 KB)

May 28
Flex Application Size

Don’t forget

By default Flex Builder compile application to debug build,
Don’t forget before deploying your application to production server to export release build
Project -> Export Release Build…
release build can be twice smaller than debug version

EXTERNALIZING ASSETS

There are a number of ways to externalize code and assets.

MODULES

If there is application functionality that not every client will use or may not be used right away, you can split it into a module; a module is compiled into its own SWF and then is loaded at runtime via code. The root tag in an MXML file defining a module is mx:Module. Modules are loaded at runtime using the ModuleLoader.

RSLS

If you have multiple applications that share some of the same code libraries, you can use runtime-shared libraries to only require the code be downloaded once and used by both applications during the browser session. Note, only Adobe signed runtime-shared libraries can persist on the client and be cached by the Flash Player after the browser is closed. This is a new feature available in Flash Player 9 Update 3 (9,0,115,0) that enables the Flex framework to be cached and used by Flex applications from any domain.
More info on RSLs at livedocs

RUNTIME CSS LOADING

You can load style sheets at run time by using the StyleManager. These style sheets take the form of SWF files that are dynamically loaded while your Flex application runs.
By loading style sheets at run time, you can load images (for graphical skins), fonts, type and class selectors, and programmatic skins into your Flex application without embedding them at compile time. This lets skins and fonts be partitioned into separate SWF files, away from the main application. As a result, the application’s SWF file size is smaller.

RUNTIME LOADING OF ASSETS

The Image control in Flex takes a source which can either be an embedded image or a relative path to the image. When the latter is specified, the image is loaded at runtime and is not embedded into the SWF file.
Embedded image:

<mx:Image source=”@Embed(source=’./assets/butterfly.gif’)”/>

Image loaded at runtime:

<mx:Image source=”/assets/butterfly.gif”/>

SUB-APPLICATIONS (Flex 3.2)

As of Flex 3.2 (and higher), there is now an additional option: sub-applications.
The PDF of the chapter in the doc is here:
Chapter 1: Developing and loading subapplications
http://livedocs.adobe.com/flex/3/loading_applications.pdf
The original planning overview (then code named “Marshall Plan”) can be found here:
http://opensource.adobe.com/wiki/display/flexsdk/Marshall Plan

Additional info:

http://www.adobe.com/cfusion/communityengine/index.cfm?event=showdetails&productId=2&postId=12169

http://www.countermarch.com/blog/index.cfm/2008/2/26/Optimizing-with-Flex-3

http://www.simplyprofound.com/post/Flex-3-Optimization-and-SWF-Filesize.aspx

http://www.slideshare.net/dcoletta/optimizing-flex-applications

http://wireless-watch.com/2008/04/24/reduce-the-size-of-a-flex-3-application-avoiding-unnecessary-references-with-the-getqualifiedclassname-method

http://livedocs.adobe.com/flex/3/html/help.html?content=performance_06.html

Apr 26
Getter/Setter Generator

One time when I started to develop project based on Cairngorm Framework, I had a task to create a lot of Value Objects (VO)

Read the rest of this entry »

Apr 22
Flex Font Embedding

When you embed fonts, Flex stores all of the font information in the SWF file so the font is displayed properly even if it’s not installed on the user’s computer. If you use a font in your sources that isn’t installed on a user’s system, and you don’t embed the font in the SWF file, Flash Player automatically selects a substitute font to use instead. Sometimes you have to embed font event if you are sure that it is installed on a user’s system, because to mask, tween and skew dynamic text fields possible only with embedded fonts.
Read the rest of this entry »

Apr 18
Localizing Flex Applications with ANT

To make Internationalization/Localization for your Flex applications very easy
Lets split whole process by steps
Read the rest of this entry »

Apr 6
Build optimized RSLs with ANT

Runtime Shared Libraries (RSLs) are libraries of components that are shared by applications in the same domain.
You can shrink the size of your application’s resulting SWF file by externalizing shared assets into standalone files that you can separately download and cache on the client. Multiple Flex applications can load these shared assets at runtime, but each client need only to download them once. These shared files are called Runtime Shared Libraries.
Read the rest of this entry »