Measure flex component creation time

Code snippet for the cases when you can't understand how long application response visually.

Usage:
- call MeasureUtil.logNextFrameTime before you are expecting complex UI creation.
- you will see traces as result:

Timer::frames 140,156,172,172

which means that next frame starts rendering only after 140 ms. But average frame interval should be about 1000 / 31 = 32 ms. Second frame occurs after 156 ms after our method call.

Code is pretty simple, checking for time pass in ENTER_FRAME.

package {
 
    import flash.events.Event;

Dependency injection in flex

Finally I played with inversion of control in flex. It was only one thing that I missed in big actionscript application. Here is sample dependencytest.zip

Start conditions

To implement dependency injection need a way to access to each class in application in order to define if it marked with metadata or not. Metaprogramming way can simplify, automate usage of util. But here is one problem. How to get access to all classes in application. Here could be 3 ways:

Read more

  25 Feb 2008 - 10:40pm

Get list of classes in flex application

This isn’t common goal for developers. And furthermore problem solving isn’t easy. Actionscript code doesn’t give access to available classes at runtime. So only trick I can image is parsing swf file by itself and get class names. Crazy implementation? Yes, it is. :-) But no coding here because flash decompilers written in actionscript already exist.

Swfassist:

Read more

  25 Feb 2008 - 2:08pm

DateChooser cook page: emphasizing some dates

DateChooser component in flex is nice but changing its behavior isn’t easy. To make easy step such as coloring (highlighting) background in pointed dates you need make real hack. Extending DateChooser stopped on component encapsulation. It prevent access because a lot of fields marked as private.

Read more

  22 Feb 2008 - 1:44pm

Give user a choice to select font

Subject with loading font isn't new but some its part weren’t still described. Or I missed them and had to walk through debugging nightmare.

So target application is text/image editors on flash that gives user option to be unique and change font style of his label. And the problem is the font as other graphic content has some weight. Including fonts to application affect on user traffic and experience, because user has to wait longer. And here usually comes idea don’t load all fonts with application and load them only when user require it.

Read more

  21 Dec 2007 - 7:23pm

Singleton template in flex builder

Наткнулся на пост в рунете о плагине Eclipse Monkey. Если коротко, то это плагин который позволяет описывать на javascript темплейты генерации кода для Eclipse. Судя по примерам через javascript можно даже оперировать с java классами в еклипсе. Затронуло.

Read more

  20 Sep 2007 - 7:36pm

BitmapUtil for changing image contrast, brightness in actionscript.

It is small library for work with BitmapData. You can easy create image editor with this code. There are many variants of library usage. Demo and all sources are included.

Description
Library can be used in flex of actionscript 3.0 project. Actually there is only one class in library. It contains public methods that do ations with image.
Next is possible with BitmapUtil:

  • To change the contrast;
  • To change the brightness;
  • To change the saturation;
  • To do the effect of negative;
  • Read more

      11 Sep 2007 - 12:20am