25. May 2011

ColorPicker and DateField in Flex 4.5

ColorPicker is not available in Flex 4.5 with Spark architecture. I found this problem while I was migrating desktop project to mobile AIR for Android.

Fortunately there is solution. Alex Harui wrote simple Spark based components that replace ColorPicker and DataField functionality.

Update: Unfortunetely swatch DropDown component does not work in mobile world. You could not select color from swatch. This problem is bounded to DropDown/ComboBox problem in mobile world. I recieved recommendation from Adobe developers to move DropDown part to new view state and avoid using s:DropDown.

Please drop a comment to this post if you have working mobile colorpicker component.

15. December 2010

Ako zmigrovať aplikáciu z Flex 3 na Flex 4

Flex 4 má podstatne vylepšenú a flexibilnejšiu architektúru.

Migrácia z jednej architektúry na druhú nie je úplne jednoduchá.

Mihai Corlan vo svojom článku k migrácii na Flex 4, píše o užitočnom  PDF dokumente Technical Guide: Upgrading Flex 3 applications to Flex 4 SDK.

Osobne odporúčam postup, kedy si vývojári odskúšajú Flex 4 na menších aplikáciach a potom začnú pomaly prepisovať časti komponent. Pri veľkých aplikáciach môže byť tento postup veľmi náročný a zdĺhavý.

Flex 4 má podstatne prepracovaný DataGrid. Pri migrácii formulárov si dajte pozor na Form a FormItem, majú inak definované rozloženie a medzery medzi komponentami.

4. December 2010

Spark vs. MX – size of Flex application

I’m building several applications based on newer Flex/Spark architecture. It is good practice to keep application at minimal size. With Spark architecture I hit several problems.

One critical problem is that application with Spark is quite big. I decided to enable support for RSL…

There is problem that RSL is available only for official releases of Flex SDK. You can run aplication on developer’s machine, but user will see some fancy errors.

There is another problem with Adobe’s RSL. Browser will contact Adobe server before application start. You could see 3-5 connections. Flash Player is checking version of RSL. This will slow down start of application. It could take 10 seconds in network with higher latency. That is very bad.

Therefore only viable solution is to turn off RSL and use “Merge into code”.

Folks who advocate for Spark says that it is much more efficient and it has better structure. Sure, it’s true. You can do many things with Spark much easier than with MX.

I was wondering why were my applications with Spark that big. I made small reasearch. You can see comparison between MX, Spark and MX+Spark projects on followich chart. In the first step I was testing only size of application with just one Button in Release mode. Then I’ve added some other components and application starts growing.

Measured against Flex SDK 4.5.0.17689.

The last result with Spark is very sad, because Spark application with Button, DataGrid, FormItem and TextInput is two times bigger than application using MX.

Do you know about any way how to shrink Spark applications?

1. December 2010

Flex Spark komponenty – ako aplikovať grafický štýl na viac komponent

Flex 4 obsahuje Spark komponenty, ktoré umožňujú aplikovať grafický štýl zdedený zo SparkSkin.

Keď chceme aplikovať takýto definovaný štýl na Button, stačí to zapísať nasledovne:

<s:Button label="Ahoj" 
    skinClass="style.MyButtonStyle" />

Predstavme si, že máme aplikáciu s 50 Buttonmi. Písať 50x skinClass=… by asi nebolo to pravé orechové.
Použijeme zápis pomocou fx:Style a do MXML s aplikáciou vložíme nasledujúci kód:

<fx:Style>
@namespace s "library://ns.adobe.com/flex/spark";

s|Button {
skin-class: ClassReference("style.MyButtonStyle");
}
</fx:Style>

Hotovo. Štýl je aplikovaný na všetky inštancie s:Button.

  • Babel fish

      Translate from:

      Translate to:

  • Where’s the fish?

  • Further info

  • Twitter

    Follow @jurajmichalek on twitter.

  • Learning

    lynda.com online training tutorials
  • Tags

  • Topics

  • Comments