Button default skin

4 views
Skip to first unread message

Wayne Fidler

unread,
Sep 1, 2010, 7:27:10 PM9/1/10
to bumpslide
Hi,

I finally just updated my library to the latest code... It used to be
I could quickly make a button by setting frame labels and exporting my
clip with Button as the base class. It still works, but now a default
gray skin is appearing in addition to my assets.

Feels like a newbie question even though I've been using the library
for years.. how do I get the default skin to NOT render? I looked into
destroySkin() but don't think I'm getting it right.

Thanks,
Wayne

David Knape

unread,
Sep 5, 2010, 9:02:31 PM9/5/10
to bump...@googlegroups.com
The button class does something special in the postConstruct method in
that it creates a default skin if one was not set. The class it uses
is defined in a static public var Button.DefaultSkinClass. So, you
could make all Buttons not attach skins by setting that to null.
However, the Button class no longer has the _over,_selected, _down
hooks you are used to, and there is no gotoAndStop( state ).

This functionality is not in com.bumpslide.ui.MovieClipButton. This
class bypasses the default skin stuff and use the same kind of
workflow you had before. This class is updated as of today. Be sure
you checkout the latest.

There is a FLA here:
http://github.com/tkdave/bumpslide_as3_examples

Note that I set the component definition class so you get some
properties in the component inspector.

Also note that this FLA is linked to the bumpslide-as3 SWC file. I
had an issue here with the 'Automatically declare stage instances'
(off) not working properly when I had my button class set to extend
the MovieClipButton class found in the SWC. It worked fine when I
added framework source to the class path. The solution was to create
an actual class file for the custom button clip and set the base class
there. Then, Flash would honor the auto-declare stage instance
setting I specified. It's like if there isn't a class file, and the
base class is in a SWC, Flash doesn't know how to not automatically
declare stage instances.

I must warn you all that the code on github is still in flux. I've
added a skinning framework to the core, but only button and slider
actually use this.

-dk


--
David Knape
Programmer / Consultant

> --
> --
> Bumpslide Mailing List
> http://groups.google.com/group/bumpslide
>
> To post to this group, send email to bump...@googlegroups.com
> To unsubscribe from this group, send email to
> bumpslide+...@googlegroups.com

Wayne Fidler

unread,
Sep 6, 2010, 2:21:43 PM9/6/10
to bump...@googlegroups.com
Very nice, many thanks for the insight.

~wayne


----------
wayne fidler
media mongrel
971.404.9175
http://www.moonpatrol.com
----------

David Knape

unread,
Sep 6, 2010, 11:50:41 PM9/6/10
to bump...@googlegroups.com
Correction:
"This functionality is not in com.bumpslide.ui.MovieClipButton." should be
"This functionality is NOW in com.bumpslide.ui.MovieClipButton."

Make this the base class of your movie clip.

Frame labels for states are "off", "over", "down", "selected", "disabled".

A child MovieClip with the name 'background' will be sized to the
button dimensions.
The label should be a classic TextField named label_txt.

If child elements are coming up null on state change, separate each
state into a separate timeline layer. I don't know why, but it helps.

Meanwhile, please explore the skinning stuff, and let me know what you
think. I'm having good luck with it for certain kinds of development.

-dk

--
David Knape
Programmer / Consultant

Wayne Fidler

unread,
Sep 7, 2010, 12:32:50 PM9/7/10
to bump...@googlegroups.com
Thanks David. Awesome. I will definitely explore the skinning stuff, when I get a little down time.

~wayne

Reply all
Reply to author
Forward
0 new messages