New DateField Component with the BackgroundColor Property. Explanation

May 27, 2008

This post is continuation of the previous post.

How to do this:

Create a lib project with a new Class which extends the DateField Class and the required .swc file is created in the bin folder.

Now we need to include one .as file which defines all the required properties for the DateField Component.

The .as file is already available for the TextInput component, which defines the required border properties. So all we need to do is get that file and include it in the NewDateFiled Class.

The .as file is BorderStyles.as and it is present in the sdk’s at

C:Program Filesflex_sdkframeworksprojectsframeworksrcmxstylesmetadata

Now get this .swc file generated [lib] into the your projects [paste it in your projects lib folder ] and drag the NewDateField component from the custom folder from the design view.

Now you can see the new properties included in the NewDateField component.

The below image shows the New DateField component with BackgroundColor property.

Enjoy the post ! comments are welcome for queries ..


New DateField Component with the BackgroundColor Property.

May 22, 2008

It may be thought by the Developers who did the DateField component that BackgroundColor property may not be required, or I don’t know their intention , but what if it is required for your App ?.

Even we [our projects] had this requirement in the beginning, when we were into projects, but I could not find time to do R&D. After I got in to the core part of the Framework and explored the classes and got the logic to implement this.

To tell frankly its simple but to get the logic you really need to explore the classes.

newdate

Will come back with explantion. The above image shows the NewDateField Component.


ActionScript Execution TimeLimit !

May 15, 2008

The default time for executing .as[ Script ] file is 15 sec’s and if the the file takes more that 15 sec’s it throws an Runtime Exception Error #:1502, and the below image shows the error message.

Here if we wanted our Script to execute more than the default time then we need to specify the time limit at the Application [Tag].

The property to use is :

scriptTimeLimit

It takes the value for sec’s specification. And the max value it can have is 60 sec. It means that the Script can be executed for only 60 sec’s.

Code Example:

<mx:Application xmlns:mx=”http://www.adobe.com/2006/mxml” layout=”absolute” creationComplete=”init()” scriptTimeLimit=”40>

</mx:Application>

The below image shows the Error Message:

Error Message For Script TimeOut .!

Enjoy The code..!


Designing BusyCursor’s or Custom BusyCursor’s.

May 8, 2008

There is default skin for BusyCursor and that skin is in the pakage mx.skins and .as file BusyCursor you can find them in your sdk’s

Now coming to desing BusyCursor:

Here we need to design our own Cursor Programmatically that is write a class which extends the Sprite Class  and use the Graphics class and with its methods, you can make your own Design for Cursor’r and finally include the skin in the App as a Style, with the Property busyCursor in the CursorManager Class.

<mx:Style>

CursorManager {

busyCursor: ClassReference(“NewBusyCursorSkin”);

}

Here NewBusyCursorSkin is the class which draws your skin[ contains code to draw] and include that class as below.And when including styles Programmatically we got use the ClassReference() method with the Class Name as the parameter.Above line shows it. To understand this post you need to know what is Sprite and Graphics Classes.

This image shows the Custom BusyCursor i have developed.

Custom BusyCursor.

Enjoy the Post. Stay tuned for the code.


Action Script Access time Exceeds 15 sec’s Error.

May 3, 2008

The default time for script acces is 15 sec’s and if you intend to have more access to the script then we got to use the property scriptLimittime at the Application tag.

The max value is 60 sec’s.

I will come back with Error Message and code Example.


Follow

Get every new post delivered to your Inbox.