PDA

View Full Version : LIB or Sen Please Help... XML Navigation



Digitalosophy
August 18th, 2003, 01:25 PM
Guys, I promise this is my last question regarding the XML nav you guys made


I want the navigation to expand onRollOver not onRelease.

When i change it it doesn't work, why not? This seems so simple but yet it won't work

here's some code


mySubButton.onRollOver = function() {
getURL(this.myUrl, this.myTarget);
trace(this.buttonLabel.text+" : "+this.myURL);
}
mySubButton.onRollOver = function() { this.glare.play(); }
mySubButton._x = this._x;
mySubButton._y = this._y + vSpacing*(j+1);
mySubButton.arrow.swapDepths(0);
mySubButton.arrow.removeMovieClip();
}
}

myButton.onRollOver = function() {
if (mainMenu.currentSubMenu != this){
mainMenu.currentSubMenu.arrow.setToRotateTo(0);
mainMenu.currentSubMenu = this;

var currButton = this;
mainMenu.onClosedMenu = function(){
this.offset = vSpacing * currButton.subMenus;
this.dropStart = currButton.ID;
this.currentSubMenu.createSubMenu();
currButton.arrow.setToRotateTo(90);
}
mainMenu.offset = 0;
}else{
mainMenu.currentSubMenu = null;
this.arrow.setToRotateTo(0);
mainMenu.offset = 0;
}
}
}else{
myButton.myUrl = menuItem[i].attributes.URL;
myButton.myTarget = menuItem[i].attributes.TARGET;

myButton.onRollOver = function() {
getURL(this.myUrl, this.myTarget);
trace(this.buttonLabel.text+" : "+this.myURL);
}
myButton.arrow.swapDepths(0);
myButton.arrow.removeMovieClip();
}

myButton.onRollOver = function() { this.glare.play(); }
myButton._x = 3
myButton._y = -2; // position
myButton.homePosition = myButton._y += vSpacing*i;
}


Thank you in advance

lostinbeta
August 18th, 2003, 01:35 PM
Look at your script, you have 2 onRollOver handlers.

So the second one that gets called (this.glare.play()) overwrites the first one (produce menu code)

Digitalosophy
August 18th, 2003, 01:48 PM
lol woah, did i miss that part in Flash 101? why can't i use the same handlers more than once?

anyway thanks a lot man.

*Digitalosophy Tip's Hat*

lostinbeta
August 18th, 2003, 03:21 PM
Dynamic event handlers are functions, so when you define what happens in 1 function and then create a new function with the same name it overwrites the original function to make way for the new function.

Example..

function test() {
trace(2);
}
test();
//returns 2 but function test() {
trace(2);
}
function test() {
trace(9);
}
test();
//returns 9

eyezberg
August 18th, 2003, 03:23 PM
it's as if i told you "when i clap, go left and right"
..what will you do? ;)

lostinbeta
August 18th, 2003, 03:32 PM
Originally posted by eyezberg
it's as if i told you "when i clap, go left and right"
..what will you do? ;)

LOL... actually that is an awesome example!

Digitalosophy
August 18th, 2003, 04:05 PM
actually that was a great example. thanks a lot guys, this is why i love kirupa :)