- Home
- Tutorials
- Flash
- Intermediate
- Flash MX Object Oriented Menu using PHP
Flash MX Object Oriented Menu using PHP
This article has been added to your 'Favorites' list.

PART5 - ActionScript - More methods for our function
color back. this.onRollOut = function() {
this.label_txt.textColor = 0x999999;
};
Make it an active link based on it's instance name. (The use of a String object here allows the toLowerCase String method as menu items are in uppercase.)
this.onRelease = function() {
myString=new String(this._name);
getURL(myString.toLowerCase()+".html");
};
To actually set the text of the menu item the txtSet method is defined for the object which takes one parameter, name and sets the dynamic textfield of the movieClip which we named label_txt.
this.txtSet = function(what) {
this.label_txt.text = what;
};
Finally a positioning method so each objected created can be moved around on the stage.
this.posMe = function(xVal, yVal) {
this._x = xVal;
this._y = yVal;
};
};// Don't forget to close myButton Definition
Once we have it all defined we tell Flash the myButton Object is actually based on the movieClip Object and assosiate it with the linkedClip from then library we made when we set up the movie.
// register myButton as a movieclip
myButton.prototype = new MovieClip();
//assosiate the object with 'but' in library
Object.registerClass("but", myButton);
//**********************************************
