Here is an example:
All I wanted was a rollover movieclip that shows a fading in.
Step 1:
Duplicate FListBoxItem in library and call it FCUstomItem (or anything else).
Step2:
Create a movieclip (instance name rollOver_mc) as follow:
- first frame : empty,
- next 4 frames have a fading in.
action for frames:
- frame 1: stop();
- frame 5: stop();
Add this mc into the FCustomItem into a new layer. (make sure the registration point is at the right place so the width will match the listbox).
Step 3:
The class is extended by adding the following code in the FCUstomItem action layer :
ActionScript Code:
#initclip 3
/*
FCustomItemClass
EXTENDS FSelectableItemClass
This is a customized LIst Item.
*/
function FCustomItemClass() {
this.init();
}
FCustomItemClass.prototype = new FSelectableItemClass();
Object.registerClass("FCustomItemSymbol", FCustomItemClass);
// code for rollOver
FCustomItemClass.prototype.onRollOver = function() {
this.rollOver_mc.gotoAndPlay(2);
this.rollOver_mc._width = this.fLabel_mc._width+this.icon_mc._width+15;
};
step 4
Do not forget Linkage Id for FCUstomItem symbol. Go to the library. Right clik on FCUstomItem, clik on linkage, type in identifier:FCustomItemSymbol and check Export in First Frame.
Hope this helps.