Skip to main content

Calculate Date Range

I was working on a weekly events module ..
At some point I need to be able to get a list of week days by providing only on day, for example if I provide today date I expect the whole week contains today regardless to the current month or years ..

The following example shows how we can do that, with some extra features ..


source code available via flash context menu

RGB to Hexadecimal in ActionScript

The following method simply converts a given RGB value to hexadecimal format..
i.e. 0 > #000000

public function getProperColor(input:int):String {
	var color:String = "#";
	var checker:Number = 0;
	if (input.toString(16).length<6) {
		while (checker<6-input.toString(16).length) {
			color += "0";
			checker++;
		}
	}
	color += input.toString(16);
	return color;
}

ComboBox List ToolTip

ComboBox is a very common component used in many projects, what if we can extend its features?
The following example creates a custom tooltip for each item in the DropDown List, data provider for these tips can be set in the ComboBox dataProvider as follows:

[Bindable] private var comboProvider:Array = [
    {label:"item 1", data:{tip:"bla bla bla .."}},
    {label:"item 2", data:{tip:"bla bla .."}},
    {label:"item 3", data:{tip:"bla bla bla bla .."}}
    ];


source code available via flash context menu

Next step is to implement custom controls to make this ToolTip interactive by adding some like “rename” and “delete”
I’ll get back to you soon with another example

Scale9Grid with Masking

ActionScript DisplayObject has a property called scale9grid used to scale objects according to nine regions based rectangle, detailed information could be found here

One day I was trying to use it for scaling effect applied to a MovieClip with curved corners and dynamic loaded image within, the problem was that the mask didn’t scale properly using scale9grid ..
I didn’t find an answer to why not, this post on Kirupa still has no reply, and I was using ActionScript 2.0

Well, I used a work-around way to bypass this issue, it’s simple, just leaving the mask with sharp corners with no scale9grid applied, and draw extra border that has the same background color to hide the image corners visually!
this won’t work nice unless we have only solid background color

hiding image corners
hiding image corners

I was hoping that adobe fixes this issue in AcrionScript 3.0, but unfortunately they didn’t ..

Few days ago I found this post at Mark Grossnickle’s blog, his custom Scale9Mask works fine with masked objects, but it has to be applied individually, and there’s a scaling factor issue, here is a demonstration example with source code available via flash context menu

Many thanks to Mark Grossnickle ..

Lost and Found

First time I heard that term ‘Interactive Development’ it felt like I found my lost space ..
I did not even try to find a definition or a meaning, it’s simply describing tons of ideas I had in mind ..
When I remember the day I learned about ActionScript and the reason that made me very curious about it’s capabilities regarding to the user experience, and looking to the present day worldwide internet race, I can say that being an Interactive Developer is the most important criteria which leads to a new digital world.

The road in out there, where Adobe as an Architect and Fi as an Implementer, they’re the keys to the future of web, If you want to be a part of this evolution don’t waste another second ..
Start right now and join the commnity ..