So the question of can you get a skin to
ignore the parent’s alpha, the answer is no. The parent will apply it along
with your skin’s alphas no matter what. Now I suppose you could override the
getter/setter of alpha on your component and propagate to the skins and just
don’t call super, you could even set another well-known variable that your
skins could read and make their own adjustments.
Matt
The issue is still that I cannot get access to the actual value of
`alpha' in a programmatic skin.
The only reason that this is almost a moot point is that if you change
the alpha property on the parent object, it applies an alpha channel to all the
skins and contents of the object anyways -- so using alpha in the skin would be
redundant. The real question is: If you provide a skin, should you be able to
override (and even completely ignore) the alpha blending on the component, at
least just for the parts drawn by that skin ( e.g., lets say you wanted to have
a selective alpha applied).
On 3/6/06, Matt Chotin <[EMAIL PROTECTED]> wrote:
Yes alpha is a property that runs from 0 to 1. All of
the other alpha's (backgroundAlpha for example) are done as styles with the
same 0 to 1 range.
As for creating skins with arguments in the constructor, we
really don't support it, it has to be no-arg. We don't have a general
mechanism of knowing the constructor arguments and using them in a factory…
Matt
Hello,
Your aware that alpha values in AS3 are from 0 to 1 ?
When you say;
" Regardless of the value, it seems that if you set the alpha of a VBox,
it applies it
to the skin anyway, whether you want to override
the behavior or not."
When you set the alpha of any instance it effects the instance of
itself and it's children which in this case would be the borderSkin instance.
I don't understand why you wouldn't be able to set the alpha of a DisplayObject
which RectBorder is.
As far as using getStyle() with an actuall property, I think Adobe changed the
implementation of getStyle() (Adobe can comment on this [ can you get
non-defined style properties with getStyle() ?? ] ). I think it is more strict
now.
:: this.alpha
It would return 1 if the skin is fully opaque. IE alpha = 100%
Anyway, I don't understand the problem really ;-) I know why I am writting this
becasue I didn't relaize that the values of alpha had changed in as3.
Peace, Mike
On
3/5/06, Jono Spiro < [EMAIL PROTECTED]>
wrote:
Preface: I'm extending a RectBorder and am trying to
paramterize the
coloring, etc., and have one problem with two ways
to go about it --
neither of which I can figure out. In one sense
this is a more general
problem...
Problem: In a programmatic skin I'm writing, I
cannot get access to
the 'alpha' value of an object, say a VBox where I
set the borderSkin
to my subclass. I *can* get access to
"backgroundColor" thought, for
instance.
Proposal 1) When I need the value:
getStyle("alpha") -- this always
returns 0. Or just saying `this.alpha' always
returns 1. Regardless of
the value, it seems that if you set the alpha of a
VBox, it applies it
to the skin anyway, whether you want to override
the behavior or not.
Ugh.
Proposal 2) More generally, what if I want to
instantiate my skin
subclass with a constructor -- not just the
default constructor, but
including values like alpha and keeping them
privately? Skins must
provide default constructors, otherwise they don't
compile -- is there
a way to provide constructor arguments to a skin,
and then use it? I
tried instantiating a skin like this, and passing
the instance to
borderSkin, but it didn't do anything.
(dataBinding would be an ideal
solution, so the skin gets redrawn).
Cheers,
Jono :~)
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
YAHOO! GROUPS
LINKS
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
YAHOO!
GROUPS LINKS
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
SPONSORED LINKS
YAHOO! GROUPS LINKS
|