Custom SkinState?

I'm pretty new on AS3, development of counting and qnx. Is it possible to create a custom SkinState and then set this State on a button?

Here's a scenario: I have a series of 5 buttons, using a custom look. The skin of the States for typical upwards, downwards, selected and disabled. When the user chooses a button, I would like to be able to set the State of the key to what we call "incorrect" that has a background color different than other States.

Is this possible?

TIA

B

[Edit: or perhaps in my ignorance I'm going about this all wrong.] Is there a better way to do this? THX]

Yes it's true. Duplicate your original CustomSkin and change the background color.

Tags: BlackBerry Developers

Similar Questions

  • QNX. UI. List and custom converters

    Hi, I created a CellRenderer for my qnx.ui.list, so that I can format the text inside.

    everything works fine, except that before, when I used the default, I got stripes (alternating white and blue) on my list, and now I no longer receive them.

    While this isn't a huge thing, I would like to get some advice here in accordance with the implementation of the same thing on my cell display.

    Here's what it looks like:

    package renderers
    {
        import flash.text.TextFormat;
    
        import qnx.ui.listClasses.CellRenderer;
        import qnx.ui.skins.SkinStates;
    
        public class TimeTravellerListCellRenderer extends CellRenderer
        {
            public function TimeTravellerListCellRenderer()
            {
                super();
                var newFormat:TextFormat = new TextFormat();
                newFormat.font = "Arial";
                this.setTextFormatForState(newFormat, SkinStates.UP);
                this.setTextFormatForState(newFormat, SkinStates.SELECTED);
            }
        }
    }
    

    Thanks in advance

    to change the colors of alternating CellRenderer, you must create a custom for her appearance. then in the cell renderer, you'd setSkin (CustomCellRendererSkinWhite) and that he would use the next skin:

    package
    {
        import flash.display.DisplayObject;
        import flash.display.Sprite;
    
        import qnx.ui.skins.SkinAssets;
        import qnx.ui.skins.SkinStates;
        import qnx.ui.skins.listClasses.CellRendererSkinWhite;
    
        public class CustomCellRendererSkinWhite extends CellRendererSkinWhite
        {
            private var upSkinOdd1:Sprite;
    
            public function CustomCellRendererSkinWhite()
            {
                super();
            }
    
            override protected function initializeStates():void
            {
                super.initializeStates();
    
                upSkinOdd1 = new Sprite();
    
                upSkinOdd1.graphics.clear();
                upSkinOdd1.graphics.beginFill(0xFF0000);
                upSkinOdd1.graphics.drawRect(0,0,26,47);
                upSkinOdd1.graphics.endFill();
    
                /**
                 * Due to the new system you need to set the scale9grid
                 */
    
                var oldUpSkinOdd:DisplayObject = new SkinAssets.CellRendererUpOddWhite();
    
                upSkinOdd1.scale9Grid = oldUpSkinOdd.scale9Grid;
    
                this.setSkinState(SkinStates.UP_ODD, upSkinOdd1);
            }
        }
    }
    

    hope that things cleared up. Good luck!

  • Add a border to my custom skin.

    Hello.

    I'm developing an ActionScript 3.0 for PlayBook application.

    I want to add a black border on my custom skin, but I don't know how.

    It is a piece of my code:

    package
    {
        import flash.display.Sprite;
        import flash.geom.Rectangle;
        import qnx.ui.skins.SkinAssets;
        import qnx.ui.skins.SkinStates;
        import qnx.ui.skins.UISkin;
        public class CustomButtonSkin extends UISkin
        {
            /** @private **/
            protected var upSkin:Sprite;
            /** @private **/
            protected var selectedSkin:Sprite;
            /** @private **/
            protected var disabledSkin:Sprite;
            /** @private **/
            protected var downSkin:Sprite;
            /** @private **/
            protected var gridRect:Rectangle;
            public function CustomButtonSkin()
            {
                super();
            }
    
            override protected function initializeStates():void
            {
                gridRect = new Rectangle(8,8,20,20);
                upSkin = new Sprite();
                upSkin.graphics.beginFill(0xFF6600);
                upSkin.graphics.drawRoundRect(0,0,172,44, 10,10);
                upSkin.graphics.endFill();
                upSkin.scale9Grid = gridRect;
    ...
    

    Hey,.

    just before:

    upSkin.graphics.beginFill(0xFF6600);
    

    put this:

    ....
    
    upSkin.graphics.lineStyle(1,0);
    upSkin.graphics.beginFill(0xFF6600);
    
    ....
    

    hope that helps. Good luck!

  • Problems with the Transition of custom components bare in s:TileGroup

    I have a problem with transitions play does not correctly on a custom component that is displayed in a < s:TileGroup >.

    Code of the custom component;

    <?xml version="1.0" encoding="utf-8"?>
    <s:SkinnableComponent xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark"
     skinClass="com.mydomain.view.skins.SkinFile">
     
     <fx:Metadata>
      [SkinState("normal")]
      [SkinState("photo")]
     </fx:Metadata>
    
     <s:states>
      <s:State name="normal" enterState="invalidateSkinState()" />
      <s:State name="photo" enterState="invalidateSkinState()" />
     </s:states>
     
     <fx:Script>
      <![CDATA[
       override protected function getCurrentSkinState():String {
        return currentState;
       }
      ]]>
     </fx:Script> 
     
    </s:SkinnableComponent>
    

    The skinfile itself is relatively simple

    <?xml version="1.0" encoding="utf-8"?>
    <s:Skin xmlns:fx="http://ns.adobe.com/mxml/2009" 
      xmlns:s="library://ns.adobe.com/flex/spark" 
      xmlns:mx="library://ns.adobe.com/flex/mx"
      width="300" height="200" width.photo="140"
      >
       
     <fx:Metadata>
      [HostComponent("com.mydomain.view.components.MyComponent")]
     </fx:Metadata>
     <s:states>
      <s:State name="normal"/>
      <s:State name="photo"/>
     </s:states>
     
     <s:transitions>
      <s:Transition autoReverse="true">
       <s:Resize target="{this}" duration="500" />
      </s:Transition>
     </s:transitions>
     
     
     <s:Rect id="rect" radiusX="15" radiusY="15" top="0" right="0" bottom="0" left="0">
      <s:fill>
       <s:LinearGradient rotation="90">
        <s:GradientEntry color="0xffffff" ratio="0" />
        <s:GradientEntry color="0xf0f0f0" ratio="1" />
       </s:LinearGradient>
      </s:fill>
      <s:stroke>
       <s:SolidColorStroke color="0xc0c0c0" weight="1"/>
      </s:stroke>
     </s:Rect>
     
    </s:Skin>
    

    When displaying a couple class MyComponent instantiated in a s:TileGroup as follows;

    <s:TileGroup width="940" verticalGap="20" horizontalGap="20" clipAndEnableScrolling="true">
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
     <components:MyComponent currentState="{theState}" />
    </s:TileGroup>
    

    and saw two buttons to switch the value of the 'State' to 'Normal' or 'photo', it resizes the component properly to the small size, but that goes back to the smaller size to the largest size, it does not play the transition. It just makes small to large immediately.

    The strange thing is, however, that if I use a tag < s:HGroup > instead of < s:TileGroup > it works like a charm, so I guess that's not so much the custom component or skin that is causing problems.

    When I put the transition of the size of the component itself instead of in her skin, then it works as expected, but I think that transitions should be defined in the skin and not in the component itself, right?

    I do something wrong or didn't I just encountered a bug maybe?

    It took me a while to realize it was.  TileLayout organises its elements in a grid of 'cells' and each cell is the same size (the size of the largest component).  Then, each element is placed in its own cell because the horizontalAlign/verticalAlign properties.  By default, TileLayout a horizontalAlign = justify which means that extends the element to the size of the cell.  In order to have an effect of resizing plays on the skin of the element does not really have any effect.  He gets to work when the shrinkage, but fails more and larger, I guess because the increase in the width of an element affects all cells, while the lower has not.

    So I think the right thing to do here is to either wrap a group around the Rect and mentioned target that you like, or the TileGroup.horizontalAlign left/center/right value.

    Here's a simplified example of how you can reproduce it:


    http://ns.Adobe.com/MXML/2009.
    xmlns:s = "library://ns.adobe.com/flex/spark" >
       
            [Bindable] public var test: Boolean = true;
    ]]>
       

       
       
           
               
                   
                       
                       
                       
                       
                   

                   
                   
                       
                           
                       

                       
                           
                       


                   
                   
                   
                       
                   

               
           
       
       
       
           
       
       
       
           
       

       
       
           
           
       

       
       
           
           
       

       
       
           
           
       

       

    If you wish, you can ask about a bug, but I have the feeling that we would not be can not fix because probably you shouldn't use horizontalAlign = justify and change the width of the element at the same time.

  • Poor - and not yet no answer customer service!

    Hello!

    My apologies for the weird subject but heading I really wanted to attract someone's attention because at the present time (a guy called Paul online support side) nobody came back to me at all about my recent visit to your store from Covent Garden and the very disappointing time there.

    In short if your management team he has just done what they said they'd do and return my call to discuss things further as a guy named will be very kindly suggested I do we would not be here!

    This email comes from me trying to talk to a member of the management team after my visit to Covent Garden on September 22 and the feedback left by me after my experience so far here.

    Will me has called and left a message on 30 September by inviting me to remember to discuss also I have does - no call back. So I didn't call back the next day - no call back and the next day still no call. We are now on day 5 and after talking to someone in the store who very frankly really seemed to not want to be there and really seemed not the least bit interested to help me at all I'm resigned now pretty much on the fact that I get not this call and will not in fact also discuss how some members of staff there myself and the day my wife turning what was supposed to be one of the highlights of our stay in London in one of the low points.

    I talked to a representative of the online customer service which was fantastic, although itself also agreed that realistic, my chances are slim to a call back that he was however able to seize a member of the business team that supposedly spent on the information of countless previous officials do not have in the hope of a return call We'll see if it succeeded or not - I doubt that very much.

    So I'll now emailing this email to all the world that I can at Apple, to raise awareness on the fact that your ship called the flag shop in London (while the street regent is under renovation) has not only some very few poor staffing but also issues clearly a massive communication issues. I have to wonder how the store works effectively in this management, I myself am a branch manager and would like to know of all these questions should they arise and also to know the importance of the Dodge don't no calls - or even potentially conflicting ones. Clearly here, it is not the case, and as such I have to say that I will never to set foot in this store again.

    You do not discuss Apple here. This is a user to user support site, and your long message falls on deaf ears. To inform Apple that you are disappointed by something, use their site here, http://www.apple.com/feedback comments

  • Will add custom wallpapers slows my iPhone?

    I'm willing to change the wallpaper on my iPhone SE to the default. Like all the default screen phone, we lost during the update I have to download it manually.

    My question is, will this effect to the performance of the phone?

    I use backgrounds custom throughout my iPhones for a long time and never noticed any performance impact. You should be OK to use a background customized without worrying about losing on processing power.

  • I'm recently back from Berlin where I accidentally left my iPhone 6. My friend tried to send it to me; However, he was returned by customs. Need advice on getting my iPhone 6 sent from Berlin to California.

    I'm recently back from Berlin where I accidentally left my iPhone 6. My friend tried to send it to me; However, he was returned by customs. Need advice on getting my iPhone of Berlin has been sent to California.

    You'll have to talk to the German customs and find out what their requirements are to send an iPhone.

  • custom ring tone does not work

    After the update this morning I hope this question was correct.

    I use a custom for some people to know how ringtone call by ringing. But nothing changes.

    It does not work.

    Nobody knows or has heard of this problem?

    Thank you

    Try these general steps. They could help.

    1 reset your iPhone by pressing and holding the sleep/wake and home buttons.

    2 disconnect you from your iCloud account and reconnect again.

  • News about the resolution of a bug in the custom IOS 10.0.1 ringtones

    I'm having a problem with IOS 10.0.1 and my IPhone 6 64 GB. Custom ringtones work anymore... I would like to know how many time usually needed to solve this kind of bug... Anyone know any news about this?

    What about custom ringtones does not work? Are you talking about ringtones purchased from iTunes, or ringtones you created yourself? I have a long list of self-made custom ringtones on my 6 iPhone with iOS 10, and they work fine. Have what troubleshooting you tried?

  • Custom iOS 10 lyrics

    Hi, I was wondering if anyone had any problems with their custom iOS Apple music 10 words?

    My words appear more like coding the way they appear on iTunes, I like to remove my words and just use those of Apple's music, but every time I have to remove my custom words and uncheck the box they reappear.

    Anyone can shed some light on this?

    Very much appreciated.

    I just want to say that, as soon as the upgrade to iOS 10 I face a similar question. Not all of my custom words show in my iPhone, only very few of them. Even though I can access/view of all those on my iTunes. Some people suggested using app "get lyrical".

  • 10 IOS and custom ringtones and sounds

    IOS 10 won't recognize that custom ringtones, or recognize his custom like whatsapp sounds.

    There is no solution to this annoying problem.

    Please, wake up!

    eduardokelly wrote:

    IOS 10 won't recognize that custom ringtones, or recognize his custom like whatsapp sounds.

    There is no solution to this annoying problem.

    Please, wake up!

    Who exactly do you think that speak here in this technical forum of the user to?

    My custom ringtones work always for all the contact I have given too...

    Problem with whats app contact with them.

    you want to use Apple the link below please contact us.

  • the custom words does not appear in my iPhone

    Hello

    I joined my iPhone IOS 10 6 more and I noticed that the custom words does not appear in my iPhone, even if I have them in my iTunes library. I signed up with the same Apple ID on all devices. Very few of them, I can access the lyrics in my phone, but not all of them (as he used to be in iOS 9)

    any help is appreciated.

    Thank you

    Ahmed

    I downloaded a program on my Mac (no app store unfortunately) called "get lyrical". automatically add lyrics to iTunes. Then in iTunes file > library > Update music library to iCloud. doing this during the last 20 minutes and so far it seems to work.

  • Contact and IOS 10 custom ringtones

    Hi all,

    I just upgraded my Iphone 6 s more to IOS10 and everything works fine, but I noticed that custom ringtones assigned to a single contact, no longer work.

    Does anyone else have this problem?

    Thank you.

    Have you tried used your ringtone and reset the unit?

  • The sum of total revenue for each customer unique and graphic it!

    Sunny greetings from Athens!  I walked for 5 hours for an elegant solution to the following:

    I want to add the total amount of revenue for each customer unique and graphic to view what customers bring in most of the species.

    Example of this in it:

    Customers Charged €
    A 100
    B 200
    C 250
    A 130
    A 120
    B 100

    Customers

    Total €
    A 350
    B 300
    C 250

    How this can be implemented by the numbers? As elegantly as possible?

    Hi menick,.

    SUMIF () will do the job.

    the formula in table 2::B2 =.

    SUMIF (table 1::A, A2, table 1::B)

    It is filled down.

    Quinn

  • Transfer photos with custom metadata

    I have all my photos on my Macbook pro (Photos app) and held them with faces and custom metadata.  I would like to transfer most of them to my iMac (photos app).  I tried various methods, including parachuting, but I lose the metadata.

    is it possible to keep custom metadata?

    is it possible to keep custom metadata?

    The only way to EVS all the metadata transferred another Mac photo library. Make a copy of the photo library on an external drive and copy the complete library to your other Mac.

    If you want to only copy the selected photos to a library on the other Mac with included metadata, export photos using the "file > export". Who will save most metadata (places, keywords, titles, descriptions), but you cannot transfer the faces in this way.  Photo library not even iCloud will now synchronize albums faces between macs or mobile devices.

Maybe you are looking for

  • Display order of Gallery

    Displaying my images via the gallery app I see no way to control the order of the photos in the slideshow. I would like to see the photos in chronological order. Thank you for advice or recommendations.

  • Most of my games crash

    Hello, I bought digital downloads of some games, and when I installed them and made them and press play, he said that it has stopped working, it comes from nowhere, even games that worked before "stopped working" now, ive tried to uninstall, running

  • Windows Internet Explore 10 Platform Preview

    I know its too early to ask, but it is sad to IE10 is not available for Windows Vista. Given that Platform Preview is not supported Windows Vista. So with this we can conclude last version of IE for Windows Vista is IE9 Or there are chances for IE10

  • I don't have a box games in windows vista

    I have no games in my windows vista computer. I was told to check the windows features box games. but there no box of games there... what to do now?

  • Want 7640: Racquet very hard and often jams

    My biggest concern is that most of the time when it prints, it makes a very loud racket and often jams. I have remove the tray paper our and readjust the book that seems to do better for printing, or both. Anyone got any suggestions?