- Home
- Tutorials
- Flash
- Intermediate
- Flash MX Object Oriented Menu using PHP
Flash MX Object Oriented Menu using PHP

PART4 - ActionScript - The Red Bar
It is also a method of myButton and is being called onRollOver. It is defined within the myButton Object using the this keyword
this.doHighLight = function() {
We will need a counter so initalize i to zero
i=0;
Now Create an empty MovieClip on the root timeline named highlight_mc underneath the menu item.
_root.createEmptyMovieClip("highLight_mc", 1);
Now that it exists set it's position, in relation to the Menu item that has been rolled over, to create the movie.
with (_root.highLight_mc) {
_x = this._x-50;
_y =this._y;
Define an EnterFrame event for the highlight_mc. The enterFrame creates a loop drawing a thick red line 200 pixels wide using ActionScript Vector Drawing methods.
_root.highLight_mc.onEnterFrame = function () {
if (_width<200) {
lineStyle(20, 0xFF0000, 80);
moveTo(_root.highlight_mc._x+i, 10);
lineTo(_root.highlight_mc._x, 10);
i += 10;
Once it is 200 pixels long clean up the enterFrame so we don't have a neverending loop to slow down the Flash player
} else {
onEnterFrame = undefined;
Now finish up the Code Blocks
}// end if-then-else
};// end enter frame
}// end with
}; // finish the function
