Re: [Flashcoders] Custom buttons - radio style
Thanks for your response Ashim,I will try to place the movieclip buttons into a new unique MovieClip, and then link that mc to a new custom RadioGroup class. We'll see where that leads me and I'll report back with my findings (or lack of).Any other ideas out there?thanks again Jim--original message-Ashim wroteI'd say you need to wrap the system in a RadioControl class of some sort.This is a group class and knows of all the radio buttons that are affectedas part of this group. That was you can have a second group if you need it.This class can have a currentSelection variable which stores whatever isclicked. Right before you change its value though, you first reset itscontentsEg:private function onClick(e:MouseEvent):void{if (currentSelection){currentSelection.mouseEnabled = true;currentSelection.goToAndStop("up");}currentSelection = e.currentTarget;currentSelection.goToAndStop("down");currentSelection.mouseEnabled = false;}I'm not entirely sure how you can connect things from the Flash library. I'dgenerate the buttons from the group class.However you could put all the buttons into a movieclip and type as the groupclass. I guess you can then run through the names and assign listeners. THatmay not be the best though.Ashim2008/12/23 jim skolmoski >> Listers,As an experienced AS2 coder, and a very new AS3 coder, I'm having> trouble writing some classes.Since I work with a few Flash designers, I'm> hoping that I can create some classes that would automatically add> functionality to interactive programs that they are designing.The current> project's design calls for a left nav with custom buttons. Each of these> buttons (movieclips) have UP, OVER, and DOWN states (as labels). As a button> is selected by the user, that button will remain in DOWN state and lose its> functionality (via several removeEventListeners). Then as a different> button is selected from the left nav, I would like it to enter a DOWN state,> and also trigger an event that would make the initial button move to its UP> state and gain functionality once again.I have a MainNav class that provides> all the functionality for the buttons. My designers would simply name the> stage instance to "MainNav1_MainLabel1" and link the button movieclips to my> class. My class will dissect the instance name to to two items: the> button's name and the label that the root should gotoAndStop. I however> have yet to figure out how to implement the communication that changes the> earlier depressed button back to the UP state when another button is> clicked. How should I implement this communication? via the document> class? make a event class?Another part of this story is that when the root> goes to another label, often times the screen will have subNav buttons which> will also work in this custom radio fashion. It would be nice if I could> use the same classes.Thanks for your timeany hints or pointers are> appreciatedJim> _> Life on your PC is safer, easier, and more enjoyable with Windows Vista(R).>> http://clk.atdmt.com/MRT/go/127032870/direct/01/___> Flashcoders mailing list> Flashcoders@chattyfig.figleaf.com> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders> _ Send e-mail faster without improving your typing skills. http://windowslive.com/online/hotmail?ocid=TXT_TAGLM_WL_hotmail_acq_speed_122008___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Re: [Flashcoders] Custom buttons - radio style
I'd say you need to wrap the system in a RadioControl class of some sort. This is a group class and knows of all the radio buttons that are affected as part of this group. That was you can have a second group if you need it. This class can have a currentSelection variable which stores whatever is clicked. Right before you change its value though, you first reset its contents Eg: private function onClick(e:MouseEvent):void { if (currentSelection) { currentSelection.mouseEnabled = true; currentSelection.goToAndStop("up"); } currentSelection = e.currentTarget; currentSelection.goToAndStop("down"); currentSelection.mouseEnabled = false; } I'm not entirely sure how you can connect things from the Flash library. I'd generate the buttons from the group class. However you could put all the buttons into a movieclip and type as the group class. I guess you can then run through the names and assign listeners. THat may not be the best though. Ashim 2008/12/23 jim skolmoski > > Listers,As an experienced AS2 coder, and a very new AS3 coder, I'm having > trouble writing some classes.Since I work with a few Flash designers, I'm > hoping that I can create some classes that would automatically add > functionality to interactive programs that they are designing.The current > project's design calls for a left nav with custom buttons. Each of these > buttons (movieclips) have UP, OVER, and DOWN states (as labels). As a button > is selected by the user, that button will remain in DOWN state and lose its > functionality (via several removeEventListeners). Then as a different > button is selected from the left nav, I would like it to enter a DOWN state, > and also trigger an event that would make the initial button move to its UP > state and gain functionality once again.I have a MainNav class that provides > all the functionality for the buttons. My designers would simply name the > stage instance to "MainNav1_MainLabel1" and link the button movieclips to my > class. My class will dissect the instance name to to two items: the > button's name and the label that the root should gotoAndStop. I however > have yet to figure out how to implement the communication that changes the > earlier depressed button back to the UP state when another button is > clicked. How should I implement this communication? via the document > class? make a event class?Another part of this story is that when the root > goes to another label, often times the screen will have subNav buttons which > will also work in this custom radio fashion. It would be nice if I could > use the same classes.Thanks for your timeany hints or pointers are > appreciatedJim > _ > Life on your PC is safer, easier, and more enjoyable with Windows Vista(R). > > http://clk.atdmt.com/MRT/go/127032870/direct/01/___ > Flashcoders mailing list > Flashcoders@chattyfig.figleaf.com > http://chattyfig.figleaf.com/mailman/listinfo/flashcoders > -- The Random Lines My online portfolio www.therandomlines.com ___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
[Flashcoders] Custom buttons - radio style
Listers,As an experienced AS2 coder, and a very new AS3 coder, I'm having trouble writing some classes.Since I work with a few Flash designers, I'm hoping that I can create some classes that would automatically add functionality to interactive programs that they are designing.The current project's design calls for a left nav with custom buttons. Each of these buttons (movieclips) have UP, OVER, and DOWN states (as labels). As a button is selected by the user, that button will remain in DOWN state and lose its functionality (via several removeEventListeners). Then as a different button is selected from the left nav, I would like it to enter a DOWN state, and also trigger an event that would make the initial button move to its UP state and gain functionality once again.I have a MainNav class that provides all the functionality for the buttons. My designers would simply name the stage instance to "MainNav1_MainLabel1" and link the button movieclips to my class. My class will dissect the instance name to to two items: the button's name and the label that the root should gotoAndStop. I however have yet to figure out how to implement the communication that changes the earlier depressed button back to the UP state when another button is clicked. How should I implement this communication? via the document class? make a event class?Another part of this story is that when the root goes to another label, often times the screen will have subNav buttons which will also work in this custom radio fashion. It would be nice if I could use the same classes.Thanks for your timeany hints or pointers are appreciatedJim _ Life on your PC is safer, easier, and more enjoyable with Windows Vista®. http://clk.atdmt.com/MRT/go/127032870/direct/01/___ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders