DataProvider.getItemIndex() function does not work

In ActionScript 3.0, DataProvider.getItemIndex() method is not working properly. It mostly returns -1, as an indicator of ‘Item not found’ in the DataProvider.

Following code illustrates the problem ::

import fl.controls.ComboBox;

var cb:ComboBox = new ComboBox();

var dp:DataProvider = new DataProvider();
dp.addItem({label:”Ashvin Savani”});
dp.addItem({label:”Naresh Khokhaneshiya”});
dp.addItem({label:”Jignesh Dodiya”});
dp.addItem({label:”Alpesh Vaghasiya”});

cb.dataProvider = dp;

//get index of item ‘Naresh Khokhaneshiya’
var index:int = dp.getItemIndex({label:”Naresh Khokhaneshiya”});

//following line outputs :: index : -1, which is totally wrong
trace(“index : ” + index);

//set the item selected
cb.selectedIndex = index;

Naresh Khokhaneshiya

AIR – Change the size of Stage at runtime dynamically

Yesterday I came across a fact that you can resize the stage size dynamically at runtime using actionscript code. But this is limited to AIR only (either Flash or Flex) but not supported in normal Flash.

Following is the code to change the width and height of the stage at anytime (runtime) using actionscript in AIR (Flash) ::

stage.stageWidth = {numericValue};

stage.stageHeight = {numericValue};

Of course, we can change the width and height of the stage in Flash (normal) using JavaScript or some other external script which controls the container of the swf file.

Naresh Khokhaneshiya

Flash Player 9 does not support Ordered List

Surprisingly Flash Player 9 does not support Ordered List <ol> tag for TextField.htmlText property. It gives output same as Unordered List <ul>. Also it does not support “type” attribute of <ul> tag.

TextField.htmlText supports List Item <li> tag but that is also limited. It does not support “type” attribute of <li> tag. It supports only “circle” as a type of <li> tag.

Flash Player 9 supports following HTML tags :

Hope that Flash Player 10 will support <ol> tag 🙂

Naresh Khokhaneshiya

Another VERY SPECIAL day for me

29th of January’ 2008 is another special day for me as I got married with Preeti.:) It was very much fun for all the other people except me and Preeti as we needed to be ideal for all the time:( .

Naresh Khokhaneshiya

Windows Vista Ultimate Explorer Bug

Just see the attached file to see the bug in the tree view of Windows Vista Ultimate Explorer. There is only one folder in the drive and its showing two folders of the same name in tree view.

Same thing you can find with filenames also. See another attachment which shows pure bug of Windows Vista Business Explorer where it shows two files with the same name and with same extensions in the same folder !!!

Naresh Khokhaneshiya

Flash Media Server and NetStream Publish

When we use NetStream.publish method in append mode for any flash video file, the metadata is not updated in that flash video file. Actually it remains same as whatever was previously while the stream was recorded at the first time in recording mode.

Here you can find more details on the same … FMS Release Notes

Naresh Khokhaneshiya

Adobe Flash CS3 Professional – Error

I found that Adobe Flash CS3 Professional gives following error in IDE ::

Location : , Line 1

Description : 5005: Unknown error optimizing byte code.

Source :

This is happening when I compile library of size 8+ MB, and that is having 250+ classes !!

Do any one know what is the exact reason behind this or any solution for this?

Naresh Khokhaneshiya

Special Day for Me

The day of 14th May of 2007 was very much special for me because on that day I got engaged with a girl named Preeti…..

Naresh Khokhaneshiya