PDA

View Full Version : Transistion and hitting effect


kempes
06-01-2004, 10:09 PM
Hello everyone,

I am new this forum, and I also a bit of newbie to flash. I have little action or no actionscript knowledge.
However, here is what I want to ask. If you take a look at
http://www.plotdev.com/flashindex.html
you will a see the buttons.

Question 1

Can anyone give me a good detailed simple tutorial on how to achieve the actions of the menu buttons,where when you click on one, it will stay in it's rollover state when the respective sections are loaded :confused: ?

Thank you and may the dear Lord bless. :)

farafiro
06-03-2004, 03:11 AM
kempes
welcome to the forums
try this//*********** I assume u r using MX or higher
//make a movie clip with 2 frame
//give each one a lable as 'up', 'over'
//in the first frame make an action stop();
//in the root
//duplicate it as much as you want
//give each one a name like button1, button2,...........
// in the first frame of the root
selectedMc = null;
numOfMc = 5;
//this is the total number of movies on the root
this.onEnterFrame = function() {
for (i=1; i<=numOfMc; i++) {
this["button"+i].onRollOver = function() {
this.gotoAndStop("over");
};
this["button"+i].onRollOut = function() {
if (_level0.selectedMc != this._name) {
this.gotoAndStop("up");
}
};
this["button"+i].onRelease = function() {
_level0.selectedMc = this._name;
//trace(_level0.selectedMc)
};
}
this[selecteMc].gotoAndStop("over");
trace(this[selectedMc]+".gotoAndStop");
};