How to take button's label over its bitmap?

i've converted template from psd to catalyst and then open it in flex 4. i've written button labels but they dont appear and i couldnt find how to get it over bitmap skin :s how?

hi, i solved it.
this is skin code:
<?xml version="1.0" encoding="utf-8"?>
<s:Skin
xmlns:s="library://ns.adobe.com/flex/spark" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:d="http://ns.adobe.com/fxg/2008/dt">
<fx:Metadata>[HostComponent("spark.components.Button")]</fx:Metadata>
<s:states>
<s:State name="up" />
<s:State name="over" stateGroups="overStates" />
<s:State name="down" stateGroups="downStates" />
<s:State name="disabled" stateGroups="disabledStates" />
<s:State name="selectedUp" stateGroups="selectedStates, selectedUpStates" />
<s:State name="selectedOver" stateGroups="overStates, selectedStates" />
<s:State name="selectedDown" stateGroups="downStates, selectedStates" />
<s:State name="selectedDisabled" stateGroups="selectedUpStates, disabledStates, selectedStates" />
</s:states>
<s:Rect left="1" right="1" top="1" bottom="1"radiusX="
2" radiusY="2" 
>
<s:fill>
<s:BitmapFill source="@Embed('/assets/images/templatetıp/ubuton_5.png')" />
</s:fill>
</s:Rect></s:Skin>
and this is main.mxml code:
<mx:Button includeIn="Page1" x="270" y="284" label="Button" skin="components.ubutonButton"/>
and this is solution adress:
http://blog.flexexamples.com/2009/07/10/setting-a-background-image-on-a-halo-button-contro l-in-flex-4/

Similar Messages

  • How can i change the color of the text on a button in Roll Over or Click state (Cs5.5)

    Hello,
    Here is the problematic:
    1° How can i change the color of the text on a button in Roll Over or Click state (Cs5.5)
    - I've many button in a doc im creating
    - the color of the buttons is white with black stoke & black text
    - in roll over state i want them to inverse the color coding (the text white & bottom black)
    - currently the text becomes invisible as black on black cant be seen (ive stroked it white but that looks ugly)
    - i would just like to know if there is a function made for this?
    My other questions:
    2° Ive a presentation on which Ive created buttons which tigger pop-up animations
    - i have 5 buttons which trigger animations
    - the viewer can chose to Click on any of the buttons randomly
    - the problem is once the animation is open how can it be close... either:
    a) by it self after "40" seconds
    b) when ther viewer clicks another button
    3° Ive created buttons linking pages..
    - "go to page xxx"
    - when i do a preview and click on the buttons the links dont take me to the right pages
    - is that normal? (maybe in preview its suppose to be like that)
    4° I would like to intergrate YouTube videos in the presentation so they play inside the docment.. when i tried.. it said the 'link isnt a flash video'
    - what should i do?
    5° Once i export it into Swf. how how can i visualize it? or put it online?
    Thank you for your time.

    stlbbl4u wrote:
    Hello,
    Here is the problematic:
    1° How can i change the color of the text on a button in Roll Over or Click state (Cs5.5)
    - I've many button in a doc im creating
    - the color of the buttons is white with black stoke & black text
    - in roll over state i want them to inverse the color coding (the text white & bottom black)
    - currently the text becomes invisible as black on black cant be seen (ive stroked it white but that looks ugly)
    - i would just like to know if there is a function made for this?
    You should setup Object Styles - these can also include Paragarph Styles that can be triggered when the Style is selected.
    http://help.adobe.com/en_US/indesign/cs/using/WS5CEDB81A-0011-4dc9-9DE8-AC7AD4C80076a.html
    My other questions:
    2° Ive a presentation on which Ive created buttons which tigger pop-up animations
    - i have 5 buttons which trigger animations
    - the viewer can chose to Click on any of the buttons randomly
    - the problem is once the animation is open how can it be close... either:
    a) by it self after "40" seconds
    b) when ther viewer clicks another button
    I'm not sure what you mean - I don't do files with Animations
    3° Ive created buttons linking pages..- "go to page xxx"
    - when i do a preview and click on the buttons the links dont take me to the right pages
    - is that normal? (maybe in preview its suppose to be like that)
    Does it work properly when you export it to the finished file?
    4° I would like to intergrate YouTube videos in the presentation so they play inside the docment.. when i tried.. it said the 'link isnt a flash video'- what should i do?
    InDesign won't link directly to youtube videos. I think your best bet would be to use Downloader to download the video and embed them directly in Indesign.
    5° Once i export it into Swf. how how can i visualize it? or put it online? 
    Thank you for your time.
    You can look up how to embed a SWF file into your HTML - but it depends what you mean by "online" there's a dozen ways to get a file "online".

  • How to unlock ipad with voice over?I even entered my correct password byt the voice over kept on saying it's wrong? 0409 is my password how come its wrong.. and the voice over kept on saying zero has no value?

    how to unlock ipad with voice over and password?  i already entered my correct password the voice over kept on saying its wrong..my password is 0409.. and the voive over says"zero" has no value?

    Turn off VoiceOver
    1. Press the Home button
    2. Tap Settings.
    3. Then double-tap Settings.
    4. Tap General.
    5. Then double-tap General.
    6. Use three fingers on the screen to scroll to Accessibility
    7. Tap Accessibility.
    8. Then double-tap Accessibility
    9. Tap VoiceOver
    10. Then double-tap VoiceOver.
    11. Tap "On" next to VoiceOver
    12. Then double-tap "On" to turn it off.

  • How to create Button which size is calculated from its text ?

    I think JButton works like this: either in constructor or by setText() method the text is set and according the lenght, font and fontRendererContext preffered size is calculated before the layout manager ask for the prefferedSize for first time.
    I want to override paint() method because i want to draw my own text(and the only way i discovered how to force button not to paint text is to set text to
    null or empty String). I want the button to be as long as length of text plus insets.
    But layout manager ask for preffered size before paint method is invoked but i find out what size should be in paint method because i need graphics
    parameter to get FontRendererContext from it. So layout manager shrink button to minimum because first time the preffered size calculated from null or
    empty String is returned.
    public class MyButton extends JButton {
            public MyButton() {
                this.setText(null);  //or setText("");
                this.setContentAreaFilled(false);
                this.setFocusPainted(false);
                this.setBorderPainted(false);
                                                          ////already here i need to know what the size should be
            @Override
            public void paint(Graphics g) {
                Graphics2D g2 = (Graphics2D) g;
                TextLayout textLayout = new TextLayout("MyButton", this.getFont(), g2.getFontRenderContext());
                Rectangle2D boundsOfText = textLayout.getBounds();                                                                    /////////here i find out what size should be
                this.prefferedSize = new Dimension((int)boundsOfText.getWidth()+10,(int) boundsOfText.getHeight()+10);
                g2.setColor(Color.WHITE);
                g2.fillRoundRect(1, 1,(int)getPreferredSize().getWidth(),(int) getPreferredSize().getHeight(), 10, 10);
                g2.setColor(Color.BLACK);
                g2.drawRoundRect(1, 1,(int)getPreferredSize().getWidth(),(int)getPreferredSize().getHeight(), 10, 10);
                g2.drawString("MyButton", 7, (int)boundsOfText.getHeight() + 6);
                g2.dispose();
        }So how can i do that? How can JButton know prefferedSize before its paint method is invoked?

    The previous example was simplified.
    public class MyButton0 extends JButton {
        private String myText;
        public MyButton0(String text) {
            this.myText = "Button";
            //this.myText = text.toUpperCase();
            this.setFont(new Font("SansSerif", Font.PLAIN, 13));
            setContentAreaFilled(false);
            setBorderPainted(false);
            setFocusPainted(false);
        @Override
        public void paint(Graphics g) {
            Graphics2D g2 = (Graphics2D) g;
            g2.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
            //backround painting
            GradientPaint background = new GradientPaint(0, 0, new Color(255, 255, 255), 0, getPreferredSize().height / 2, new Color(0, 0, 0), true);
            if(getModel().isRollover()){
                background = new GradientPaint(0, 0, new Color(255, 255, 255), getPreferredSize().width , getPreferredSize().height , new Color(0, 0, 0), true);
            if(getModel().isPressed()){
                background = new GradientPaint(0, 0, new Color(255, 255, 255), 0, getPreferredSize().height / 2, new Color(210, 210, 210), true);
            g2.setPaint(background);
            g2.fillRoundRect(1, 1, getPreferredSize().width - 3 , getPreferredSize().height - 3, 10, 10);
            //Border painting
            g2.setColor(new Color(255, 255, 255));
            g2.setStroke(new BasicStroke(2.0f, BasicStroke.CAP_BUTT, BasicStroke.CAP_BUTT, 10.0f));
            g2.draw(new RoundRectangle2D.Double(1, 1, getPreferredSize().width - 3, getPreferredSize().height - 3, 10, 10));
            //text paiting
            g2.setFont(getFont());
            TextLayout tl = new TextLayout(this.myText, getFont(), g2.getFontRenderContext());
            int startPositionOfText = getPreferredSize().width - (int) tl.getBounds().getWidth();
            startPositionOfText = startPositionOfText / 2;
            g2.setColor(new Color(255, 255, 255));
            g2.drawString(this.myText, startPositionOfText -2, getHeight() / 2 + 5);
            g2.dispose();
        @Override
        public Dimension getPreferredSize() {
            return new Dimension(133, 31);
    }Assume text is so long as doesn't fit inside button. I have hard-set preffered size but i would like to calculate preffered size from text lenght.
    Or i need calculate startPosition of text to center it. But i don't want have preffered size hard-set.

  • HT201441 my friend found this ipod touch 5g and its in find my ipod mode it say the ipod is currently linked up to other apple id so i want to find the owner or learn how to take that off

    my friend found this ipod touch 5g and its in find my ipod mode it say the ipod is currently linked up to other apple id so i want to find the owner or learn how to take that off

    The Apple ID is an email address. Simply email the person at that email address.
    If not successful, turn the iPod in to the police.

  • Error message 42110 upon opening itunes does not interfere with playing library or downloading.  Although printing jewel case lables the text prints over its self.  How do I fix this?

    I get an error 42110 upon opening itunes.  It has no effect on downloading to or playing my library.  However when I try to print a jewel case insert the text prints over its self.  How do I fix this.  It only started recently.

    Try the following user tip:
    iTunes for Windows 11.0.2.25 and 11.0.2.26: "Unknown error -42110" messages when launching iTunes

  • How do I recover a .app and its file contents after osx "click and hold" "hit x button" delete

    How do I recover a .app and its file contents after osx "click and hold" "hit x button" delete.
    Accidently deleted rapidweaver and all of its content and paid plugins with it. all contain in its package contents. how do i restore.  I tried using recovery software.

    It is possible that you inadvertently corrupted the file while doing the edit.
    But it could also be possible that you moved the file? For iMovie to see it, it should be in the Movies/iMovie Projects folder.

  • I have been getting this message " no sim installed " too many times then my phone goes off , its iphone 4S , its really a problem i cant get calls or anything and im not sure how to take the SIM out then insert it again , what to do ??

    i have been getting this message " no sim installed " too many times then my phone goes off , its iphone 4S , its really a problem i cant get calls or anything and im not sure how to take the SIM out then insert it again , what to do ??

    Use the sim tool that came with your phone or a safety pin and just insert it into the hole at the side of the sim tray and push it in and then pull it out.  It is no more difficult than that and then just close it again.

  • How long does step 4 of 6 (transferring Purchases) take from an iphone? its been doing it for about 20-30 minutes now and hasn't progressed at all, i dont know if its crashed or anything, and im scared to unplug it... HELP

    how long does step 4 of 6 (transferring Purchases) take from an iphone? its been doing it for about 20-30 minutes now and hasn't progressed at all, i dont know if its crashed or anything, and im scared to unplug it... HELP

    how long does step 4 of 6 (transferring Purchases) take from an iphone? its been doing it for about 20-30 minutes now and hasn't progressed at all, i dont know if its crashed or anything, and im scared to unplug it... HELP

  • How to take a snapshot in acrobat reader for its

    I wander how to take a snapshot in PDF file while using acrobat reader for ios. Anyone have any idea.

    You can zoom into the area of interest and get a screen capture by simultaneously pressing the home button and the power button.

  • How do I get "custom label" button back on Contacts

    I used to have "custom label" button for phone number tags on contact list. It is now gone. Any way to get it back. This started on my iPhone 4 and remains on my iPhone 5.
    SOLUTION FOUND !!!
    Go into settings and do this:
    Settings --> Mail,Contacts,Calendars --> Default account (for Contacts)--> select "On My Phone"
    this restored the custom labels button when creating new contacts. Somehow it was set to 'Hotmail" and i guess Hotmail does not support customized labels so it isn't offered when creating new contacts.

    That is what i a talking about. When i go to add a new contact and go to edit the label - the generic list of number types is present but the additional list of custom lables is not present - nor the button to create a new one. Some of my contacts do have the custom label present - old contacts created back when the buttons and label types were all there but it is no longer present when creating new contacts or editing contacts that were recently added.

  • How to take a picture the menu???

    I noticed that some of facebook users are uploading the picture of their program or website. I just want to know how to take a picture if I am using iphone 4. My friend said press the power button and menu button at the same time but its not working. What should I do???

    Try this...
    press and hold the home button
    press and release the sleep/power button (you'll hear a shutter click)
    release the home button
    look in your camera roll

  • How do I get my "stuff" over to a Samsung device?

    Hi , I am working on Mac os x, Indesign cs6.
    My problem is when I am exporting my file as jpg ore a PDF using rgb coz its going on Ipad. The file is turning out real smoggy and dirty looking when i send them via mail and open it on I pod. When I use a cable and do it manually trough I tunes it works out fine. With that said it only works on my apple Ipad devices and NOT on Samsung.
    So to make my question short´n simple:
    how do I get my "stuff" over to a Samsung device with the right colours

    Are you only intending to put things on your personal tablet, or is the question about how to publish to digital tablets (Samsung with Android OS) in general?
    If you export to jpg or PDF, take care to set the compression to high or maximum so that the image doesn't suffer from lossy compression to a heavy degree.
    You mention iPad, then iPod, then iPad again, then Samsung Android. What really are you doing? More detail as to your intentions is needed. Most images on any digital device use the sRGB color space to define and control the color of an image.

  • How to right align s:Label inside a s:controlBarContent ?

    My spark app has a control bar at the top and i want to right-align a label inside it so my button bar is on the left and my label is on the right. I tried using the 'horizontalAlign="right"' which works find inside a s:panel but not inside a s:controlBarContent. Does anyone have any idea how to achieve this please? Also, the flash builder 4 ide won't let you move the label over in design mode either...
    Thanks for your help,
    Regards,
    Mark.

    I figured it out myself. I added an s:Hgroup around my label and set width="100%" and horizontalAlign="right" you need to set the width to 100% otherwise you're just right aligning within the actual width of the component (which is pretty useless eh?).
    I hope this helps someone else too.
    Regards,
    Mark.

  • How to select the download location? its automatically downloading to users folder in c drive. i wanna change it..plz help me out......

    how to select the download location? its automatically downloading to users folder in c drive.. i wanna change to my desktop...plz help me out...

    Tools -> Options -> Save files to -> Click browse button and browse for folder where you want to save the file.

Maybe you are looking for