Ryan,
Absolutely. That's how I've handled things on my homepage. The answer I
suggested to Alex was an effort to stay on point with regard to his
question.
I would also recommend that he set up named functions outside his
buttonBehavior function. It may not be necessary for his current project,
but cleaner, and would make sufficiently generic functions available for
other elements.
function btnROver(){
this.gotoAndPlay("over");
}
function btnROut(){
this.gotoAndPlay("out");
}
function btnRelease(){
this.gotoAndPlay("display_frame");
loadMovie(this.href, "load_target");
}
function buttonBehavior():Void {
for (var i = 1; i < 8; i++) {
//do tmpMC = _root["mb_"+i]; just once per loop
//to save processing
var tmpMC:MovieClip = _root["mb_"+i];
// add a var to the mc that tracks it's content
tmpMC.href = "section_"+i+".swf";
//assign button behavior functions
tmpMC.onRollOver = btnROver;
tmpMC.onRollOut = btnROut;
tmpMC.onRelease = btnRelease;
}
}
buttonBehavior();
-Keith
http://home.mn.rr.com/keithreinfeld
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com