-
OOP - navigation buttons
I have one .fla where a relatively large navigation menu will be presented to the user. This .fla has multiple frames and over 25 buttons all guiding user either to additional menu options (presented in a different frame) or to a URL.
I am used to doing simple frame-by-frame programming. But am wondering if in this instance, it wouldn't make sense to set up an .as file that has the information for each button's link in the .fla (be it another frame or a URL) - because doing it frame-by-frame is getting VERY messy.
Can anyone point me toward a tutorial (for the OOP-challenged) that could guide me toward making this happen. Is it even possible to create a master .as file / class to control all the buttons in a .fla file (each with different destination?)
TIA
-
okay, I have an idea - but would hate to spin my wheels. Tell me if I'm on the right track:
I could set up one file (fla) that contains all the buttons. Then have each button load an external .swf file. So then I would just make a separate .swf for each "link" that would've otherwise been done in each frame. For the ones that go to a URL, I guess I could just put those on first frame of the master .fla.
Am I getting hotter here? (not in the sexy sense of the word, but in the 'yes, that's the way to go' sense : )
-
basically you need a master class for a button right?
ok, so create a .as file and give it this content:
Code:
package {
public class NavButton extends MovieClip {
// public properties
public var property1;
public var property2;
public var property3;
// constructor
public function NavButton() {
}
// internal function
private function functionName():void {
}
}
}
so in the library right click the symbol and properties and export for AS, and type the class name.
now, you can set properties sush as destination/
-
Here is something more sophisticated:
http://flashscript.biz/flblogger/?p=3