BTA Flexing

My passion RIAs…………..Shardul Singh Bartwal

Archive for April 15th, 2009

Managing Custom Events in Flex 3.0 in a easy way

Posted by shardulbartwal on April 15, 2009

As all of us require Custom Events in our Flex applications. Also we know the Event Life Cycle in Flex. I am sure that all of you will be familiar with event targating,bubling,capturing etc.Also we know that we are require to remove the Listeners which we adds. We all know that inside a flex application the event first goes to the application level and then from there back to the component which have to listen it. This issue becomes more critical if we are not using any particular architecture like Pure MVC or Cairngorm etc.So in this condition first you have to dispatch a event and listen it at application level and then again dispatch a event on its occurring and listen that at the desired place. The other ways are like by using the references of the Class from where the event is dispatched and where it is being listen in each other etc.I have created a CustomEventManager Class for managing custom event dispatching, and Listening it.Its very simple to use it. It is a static class.

For dispatching event simply write like this:

CustomEventManager.dispatchEvent(new YourCustomEvent(YourCustomEvent.YOUR_CUSTOM_EVENT));

and for Listioning the custom event write like this at right place in the event Listioning
class(e.g. at creationComplete of the class or constructor etc ):

CustomEventManager.addEventListener(YourCustomEvent.YOUR_CUSTOM_EVENT,yourCustomEventHandler);

I am also adding the code of the ‘CustomEventManager’ class.Hope it will be helpful for you.

For CustomEventManager Class click here.

Posted in ActionScript 3.0, Flex 3.0 | 4 Comments »

Smoothing the Bitmap

Posted by shardulbartwal on April 15, 2009

Normally when we are dealing with the ’smoothing’ property of the ‘Bitmap’ class it looks that its effect is not of the major aspect.But it plays a vital role.I found a very help full link related to understanding its value.If you are not getting the quality factor on the movement(by mean of rotation,skew,scale etc) on bitmap then you should check the ’smoothing’ property of the bitmap by tracing it whether it is true or false.The link below will clear you doubts and variations of the quality issue in Bitmap.Its value is more important if u are getting the bitmap of any Image which you are accessing through the url.
Please have a look at the link below to understand this issue and its solution.Thnx to Grant Skinner for this nice post.

The link is……….

http://www.gskinner.com/blog/archives/2007/08/minor_bug_with.html

Posted in ActionScript 3.0, Flex 3.0 | Leave a Comment »