flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Maurice Amsellem <maurice.amsel...@systar.com>
Subject RE: spark.skins.SparkButtonSkin -> Undefined state 'up'
Date Wed, 02 Oct 2013 13:12:16 GMT
You are correct.  

iconDisplay is not in the skin itself, but in its parentClass (SparkButtonSkin).
Sorry for the confusion.

So all is well that ends well :-)

Maurice 

-----Message d'origine-----
De : Frank Dahmen [mailto:frank@dahmenia.de] 
Envoyé : mercredi 2 octobre 2013 15:01
À : users@flex.apache.org
Objet : Re: spark.skins.SparkButtonSkin -> Undefined state 'up'

Flex 4.9.1 does include icondisplay
ok, my sdk version does not meet the docs version, so the docs are not wrong

thanks


----- Original Message ----- 
From: "Maurice Amsellem" <maurice.amsellem@systar.com>
To: <users@flex.apache.org>
Sent: Wednesday, October 02, 2013 2:48 PM
Subject: RE: spark.skins.SparkButtonSkin -> Undefined state 'up'


You are right, spark Button (actual ButtonBase) has an icon.
however, it's not a property, it's a style, so that you can set it in css or 
in MXML.

In MXML it wouldn't make a difference that it's a property or a style.

Note that the default spark.skins.spark.ButtonSkin (in Flex 4.10) does not 
"implement" the skinPart "iconDisplay", so you will have to add it in your 
custom skin.
That's very easy,
Just add:
<BitmapImage id="iconDisplay" />
In the right place in your custom skin.

Regards,

Maurice

-----Message d'origine-----
De : Frank Dahmen [mailto:frank@dahmenia.de]
Envoyé : mercredi 2 octobre 2013 14:35
À : users@flex.apache.org
Objet : Re: spark.skins.SparkButtonSkin -> Undefined state 'up'

no, i don't have it anymore

but i now i see that spark button has an icon property and 
spark.skins.spark.ButtonSkin (the default) does include it....out of the box

so i think the docs are wrong:

spark.components.Button:

"... The default skin has a text label. Define a custom skin class to add an 
image to the control. ..."



----- Original Message ----- 
From: "Maurice Amsellem" <maurice.amsellem@systar.com>
To: <users@flex.apache.org>
Sent: Wednesday, October 02, 2013 2:00 PM
Subject: RE: spark.skins.SparkButtonSkin -> Undefined state 'up'


Do you have the link where you see that ?

Maurice

-----Message d'origine-----
De : Frank Dahmen [mailto:frank@dahmenia.de]
Envoyé : mercredi 2 octobre 2013 13:12
À : users@flex.apache.org
Objet : Re: spark.skins.SparkButtonSkin -> Undefined state 'up'

ah, thanks

although i saw an example in the www which used it just as i did

thanks



----- Original Message ----- 
From: "Maurice Amsellem" <maurice.amsellem@systar.com>
To: <users@flex.apache.org>
Sent: Wednesday, October 02, 2013 11:05 AM
Subject: RE: spark.skins.SparkButtonSkin -> Undefined state 'up'


The required states for a skin are listed in the "skinStates" section of the
host component (in this case spark.components.Button):

(Apache)
http://flex.apache.org/asdoc/ => spark.components.Button => Skin States

(Adobe)
http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/components/Button.html#SkinStateSummary


Maurice


-----Message d'origine-----
De : Scott Matheson [mailto:smatheson@intralinks.com]
Envoyé : mercredi 2 octobre 2013 10:48
À : users@flex.apache.org
Objet : Re: spark.skins.SparkButtonSkin -> Undefined state 'up'

Frank
    I am not sure if this is your issue, with Skins you have to define all
the states the skin will need, even if you do not need these states in your
application, I have not found any documentation that define what states you
need for any skin


A button needs


<s:states>
        <s:State name="up" />
        <s:State name="over" />
        <s:State name="down" />
        <s:State name="disabled" />
</s:states>



I always start with the default item, button, button bar etc, then in visual
designer (4.6) click generate skin, then delete all the code that defines
the  button, then add my own code

This is a small example of a ICON in a button

In this example, it is the same icone with colors for each state

<s:SolidColor color.disabled="#F2F2F2" color.down="#FFD241"
color.over="#FFD241" color.up="#DCDCDC"/>



Scott

<?xml version="1.0" encoding="utf-8"?>

<!--

    ADOBE SYSTEMS INCORPORATED
    Copyright 2008 Adobe Systems Incorporated
    All Rights Reserved.

    NOTICE: Adobe permits you to use, modify, and distribute this file
    in accordance with the terms of the license agreement accompanying it.

-->

<!--- The default skin class for the Spark Button component.

       @see spark.components.Button

      @langversion 3.0
      @playerversion Flash 10
      @playerversion AIR 1.5
      @productversion Flex 4
-->
<s:SparkButtonSkin xmlns:fx="http://ns.adobe.com/mxml/2009"
                   xmlns:s="library://ns.adobe.com/flex/spark"
                   xmlns:fb="http://ns.adobe.com/flashbuilder/2009"
                   width="21" height="22"
                   alpha.disabled="0.5"
                   >

<fx:Metadata>[HostComponent("com.peach.uofs.components.basic_navigation_pag
es.pips.JumpToGoToPage")]</fx:Metadata>



    <!-- states -->
    <s:states>
        <s:State name="up" />
        <s:State name="over" />
        <s:State name="down" />
        <s:State name="disabled" />
    </s:states>
    <s:layout>
        <s:ConstraintLayout/>
    </s:layout>


<s:Rect width="100%" height="100%" id="box" >
    <s:fill >
        <s:SolidColor alpha="0" />
    </s:fill>
</s:Rect>

    <s:Group  >
        <s:Group  >
            <s:Path left="4"
                    data="M16.9038 6.31691C16.9136 6.2925 16.9214 6.26711
16.9292 6.24171 16.9429 6.20851 16.9526 6.17531 16.9604 6.14211 16.9683
6.11769 16.9761 6.09132 16.9819 6.06691 16.9897 6.03078 16.9995 5.99562
17.0073 5.95851 17.0093 5.93605 17.0132 5.91164 17.019      5.88625
17.0249 5.84914 17.0269 5.81203 17.0308 5.77296 17.0308 5.7505 17.0327
5.72609 17.0347 5.70265 17.0366 5.66554 17.0366 5.6255 17.0366 5.58449
17.0366 5.57277 17.0366 5.56105 17.0366 5.54933 17.0366 5.53664 17.0327
5.52687 17.0327 5.5132      17.0308 5.47609 17.0269 5.44093 17.0249
5.40187 17.021 5.37648 17.0151 5.34914 17.0132 5.31984 17.0093 5.29054
17.0015 5.26027 16.9956 5.23 16.9878 5.19875 16.9819 5.1675 16.9741
5.13625 16.9663 5.11183 16.9565 5.08546 16.9507 5.06007 16.9429
5.02687 16.9312 4.99367 16.9155 4.96144 16.9077 4.93703 16.8999 4.91359
16.8901 4.89211 16.8765 4.85793 16.8608 4.8257 16.8452 4.7964 16.8335
4.77003 16.8198 4.74757 16.8062 4.72218 16.7925 4.69484 16.7788 4.66652
16.7612 4.64015 16.7437 4.61281      16.7261 4.58644 16.7104 4.56007
16.6929 4.53761 16.6772 4.51711 16.6616 4.49367 16.6401 4.46535 16.6167
4.43898 16.5952 4.41066 16.5796 4.39308 16.564 4.37453 16.5444 4.35597
16.5229 4.33058 16.4976 4.30519 16.4722 4.27882 16.4546 4.26125 16.4351
  4.24464 16.4155 4.22511 16.3921 4.20461 16.3667 4.18312 16.3394 4.16261
16.3159 4.14406 16.2925 4.12453 16.269 4.10695 16.2476 4.09035 16.2202
4.0757 16.1987 4.05714 16.1714 4.03957 16.1382 4.01906 16.1089 4.00148
16.0991 3.99562 16.0874 3.98781      16.0776 3.98097L9.37451
0.237808C8.46631 -0.266098 7.32568 0.0561676 6.81982 0.962418 6.31592
1.86476 6.63818 3.00929 7.54248 3.51515L9.91357 4.83644C3.90381 7.22023
-0.244629 13.1987 0.0112305 20.0112 0.050293 21.0484 0.92334 21.854 1.9585
21.8159      1.99756 21.815 2.03467 21.812 2.07373 21.8081 3.0542 21.7114
3.79834 20.8657 3.76318 19.8706 3.56006 14.5855 6.84912 9.96437 11.5581
8.22414L9.78076 11.4077C9.27295 12.314 9.59912 13.4566 10.5054 13.9614
10.8511 14.1548 11.2339 14.228 11.6011      14.1909 12.1929 14.1323
12.7456 13.7964 13.0562 13.2359L16.8003 6.53468C16.8081 6.51906 16.8159
6.50246 16.8237 6.48488 16.8354 6.46242 16.8472 6.43703 16.8608 6.41359
16.8745 6.38039 16.8882 6.34914 16.9038 6.31691Z"
                    verticalCenter="0" winding="nonZero">
                <s:fill>
                    <s:SolidColor color.disabled="#F2F2F2"
color.down="#FFD241"   color.over="#FFD241" color.up="#DCDCDC"/>
                </s:fill>
            </s:Path>
        </s:Group>
    </s:Group>



</s:SparkButtonSkin>




On 10/2/13 8:18 AM, "Frank Dahmen" <frank@dahmenia.de> wrote:

>Hi,
>
>i'm using
>
><s:Button label="button" skinClass="spark.skins.SparkButtonSkin"/>
>
>got the error: Undefined state 'up'.
>
>
>do i have to to subclass SparkButtonSkin?
>
>(i want to put an icon on the Button)
>
>
>thanks


________________________________

Disclaimer: This electronic mail and any attachments are confidential and
may be privileged. If you are not the intended recipient, please notify the
sender immediately by replying to this email, and destroy all copies of this
email and any attachments. Thank you. 


Mime
View raw message