Copy link to clipboard
Copied
Using the Button Class, how would one keep it in its Highlighted, down state after clicking it?
Not using SimpleButton or creating a movieclip button but using the provided Button that comes with Flash.
Copy link to clipboard
Copied
you can't.
use a movieclip button.
Copy link to clipboard
Copied
Well, I almost have it.. using 'emphasizedSkin'.
But the issue now is that the label disappears.
Copy link to clipboard
Copied
lol. that's making a simple task as complicated and time-consuming as possible.
Copy link to clipboard
Copied
kGlad.. The simple task you said could not be done?
Now that I know how to do it.. it is not very time-consuming.
Maybe you can offer a useful alternative that does the same.
Copy link to clipboard
Copied
i did: use a movieclip button.
Copy link to clipboard
Copied
The goal was to make this work using the Button class.
This could be used in a project which already has lots of Buttons used and you do not want to replace them all with MovieClips.
For those interested in a way to achieve this:
First go to the 'Component Assets' in your Library and then 'ButtonSkins'
Duplicate the 'Button_downSkin' and call it 'highLightSkin' and alter it as you like.
The AS is as follows:
function month_click(event:MouseEvent):void {
for (var rx in btns) {
btns[rx].emphasized = false;
}
event.target.setStyle("emphasizedPadding", 3);
event.target.setStyle("emphasizedSkin", "Button_highLightSkin");
event.target.emphasized = true;
}
btns is a movieclip which contains all of the buttons.
Perhaps 'someone' can advance this.. c'mon.. you know you want to.
Copy link to clipboard
Copied
Components are probably the least efficient items to include in a design in terms of file weight... I avoid them as much as possible for that reason. Just as an example.... An Button component can be up to 15 times larger than a SimpleButton in terms of bytes in the swf file. I do not have a comparison for a movieclip approach, but my own experience has been, homemade things are lighter designs.
Copy link to clipboard
Copied
Yes, Ned but as mentioned, this was for use on Existing Buttons.
Copy link to clipboard
Copied
I don't remember that being in the original posting... you only brought that up after asking for alternatives and being told what they are. Using Buttons is simply inefficient design, and complicating the coding of them only adds to the burden they put on a file.
Copy link to clipboard
Copied
Got some reading issues on here today..feel free to re-read the original post:
"Using the Button Class..."
Perhaps I did not make that clear and misused the term 'Button Class'. If so, accept my apologies. If not so, then I challenge you guys to make the provided sample better.
Not by fixing the Gremlin by getting a Ferrari.
Advice taken though that components can increase filesize, just not the topic here.
Copy link to clipboard
Copied
As far as I know and the documentation goes, it is not possible. You can do it with the SimpleButton class in AS3 with some variables if you want to restore things, but the Button class does not share the "...State" properties the the SimpleButton class has. The MovieClip approach is the cleanest approach.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now