Change button icon in AS3

I figured it would be simple to change an icon on the fly,
like a label, using actionscript. But I'm not finding a way to do
it. Suggestions.

[Bindable]
[Embed(source="assets/down.gif")]
private var down:Class;
[Bindable]
[Embed(source="assets/up.gif")]
private var up:Class;
private function changeIcon():void {
but.setStyle("icon", down);
<mx:Button label="Test" id="but" icon="{up}"
click="changeIcon()"/>

Similar Messages

  • Change button icon at runtime

    hi
    we have applications developed using developer suite 10g.
    we have push buttons with icons and there is no problem at runtime as they are visible.
    Now we want to change the icon on the push button when mouse enters or mouse over it at runtime.
    Please give suggest in simple steps how to proceed.we are new to forms 10g.
    Thanks in advance

    These are the error messages appearing in java console.
    we are not able to trace it where the problem is.
    ERROR>WUC-19 [URLDownload.pullFile()] Unable to write to local file C:\PROGRA~1\Oracle\JINITI~1.22\bin\jacob.dll. Failed to download URL http://mbxserver/forms/webutil/jacob.dll
    ERROR>WUC-24 [URLDownload.pullFile()] Error reading URL http://mbxserver/forms/webutil/JNIsharedstubs.dll
    ERROR>WUC-24 [URLDownload.pullFile()] Error reading URL http://mbxserver/forms/webutil/d2kwut60.dll
    why jacob.dll is required in client pc.
    we had download webutil and jacob_18 from website.Chances are they may be corrupt.
    where can we get these files error free.
    Thanks

  • Changing Button icon using CLAF Admin

    Hi All ,
    I have a requirement of changing the standard button icon to a client provided icon.
    I am using CLAF Admin to create a custom look and feel for this purpose. In the custom LAF , I have changed the button icon in the "Customize Styles and Icons" page ( 2nd step of 3 step process ) .
    I have followed the following steps :
    1. Create a custom LAF "mylaf-desktop". Ckick Next. Select "button" in the component drop down
    2. Select the "Icons" tab
    3. Set the URI to "XX_BUTTON.gif", which transformed into ""cabo/images/mylaf-desktop/XX_BUTTON.gif" after saving.
    4. Ported the custom icon into $OA_HTML/cabo/images/mylaf-desktop path.
    After doing the above when I navigate to the preview page and give a random page URL , the buttons in the page are being displayed with the same old icon.
    Any pointer or suggestion will be greatly helpful.
    Thanks,
    Srikanth

    Hi Srikanth,
    I've just posted a similar answer to you elsewhere but here it is again.
    Buttons:
    The button definition is probably the trickiest part of a CLAF as you can EITHER use dynamic Gifs (using icons) or define a HTML button in CSS.
    1) If you want to you dynamic icons you need to create an icon for each part of the button (e.g. adding start, end, top and bottom icons) and reference the url to each in buttonStart, buttonEnd, buttonTopBackground, and buttonBottomBackground icon properties.
    You can do this manually by extending your myclaf.xml file (OA_HTML/cabo/laf/myclaf.xml) with e.g:
    <icon name="buttonStart">
    <context-image uri="OA_HTML/cabo/images/myclaf-desktop/ButtonLeft.gif">
    </context-image>
    </icon>
    ...repeat for buttonEnd, buttonTopBackground, and buttonBottomBackground.
    Once done, you will need to bounce your apache, clear all caches before changes will appear. Even after doing this, I have found button rendering to be a bit dodgy in some environments.
    2) Instead of this technique I recommend simply adding the CSS button property to your xss file (OA_HTML/cabo/styles/myclaf.xss), e.g:
    <style selector="button">
    <property name="background-image">url(/OA_HTML/cabo/images/myclaf-desktop/buttongradient.gif)
    </property>
    <property name="background-color">#00CCCA
    </property>
    <property name="color">#ffffff
    </property>
    <property name="font-size">12px
    </property>
    <property name="font-weight">bold
    </property>
    <property name="border">solid #02A1A5 1px
    </property>
    <property name="white-space">nowrap
    </property>
    </style>
    <style selector="button:hover">
    <property name="background-image">url(/OA_HTML/cabo/images/myclaf-desktop/buttongradienthover.gif)
    </property>
    </style>
    Browsers will pick this up and apply the changes to all buttons on claf pages.
    The only problem with this is that you can only have 1 background image (e.g. see R12 swan buttons) and not a left, right, top, bottom image (see 11.5.10 buttons) - i.e. you can't have rounded corners.
    Mike
    Edited by: M West on 31-Mar-2009 05:53

  • How to change an icon of a button

    hi guys,
    i want to change the icon of a button when it is click
    how can i do it?
    thanks

    You register a listener for that button, e.g.:
    button.addActionListener(new...)
    Then add code to the listener class:
    button.setIcon(new...)
    If you've not come across listeners yet though, you'll need to explore these a bit first.
    Andy.

  • How can I change the icon for the bookmarks menu button

    Using linux, the default icon for the bookmarks menu button is quite ugly. Is there a way to change the icon for the button with some code in userChrome.css ?

    After several intents, I found a solution.
    This is my userChrome.css file:
    @namespace url("http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul");
    toolbarbutton[class="toolbarbutton-1"]#bookmarks-menu-button image[class="toolbarbutton-icon"] {
    list-style-image: url("bookmark_gray.png") !important;
    -moz-image-region: rect(0px, 0px, 0px, 24px) !important;}
    Probably it's messy but works.

  • Is there a way to change the icon associated with icloud account?

    Is there a way to change the icon associated with my iCloud account? It's currently a rose and i do not like it.

    Welcome to the Apple Support Communities
    Are you referring to your iCloud account picture or your user picture?
    It looks like you are referring to your user picture. To change it, open System Preferences > Users & Groups, press the picture box and choose the user picture you want from the ones that came by default. If you want to select a different picture stored on your Mac, drag that photo onto the picture box.
    If you want to change your iCloud account picture, open http://www.icloud.com and log in with your Apple ID. Then, press your name at the top right of the site and press the user picture. If you put the cursor on the picture box, you will see a button at the top of the box to change your picture

  • If your Send / button icons are missing in new messages in Mail, do this

    I was mystified as to why the button icons (for Send, Attach, etc) were suddenly missing from my "new message" email windows. The text descriptions were still there, so i could use the functions, but they were in tiny text, more difficult to click on. Trying to drag the icons back on from the view/customize toolbar menus (as was suggested in prior discussions i found here here) did not work.
    Then i noticed a drop-down menu called "Show" in the bottom left of the View> Customize Toolbar window (opened directly from a New Message window). It toggles whether you see Text Only, Icons and Text, or Icons Only. Mine was somehow set to Text Only. Just toggling it to Text and Icons brought my buttons back.
    I don't know how that preference got changed- i didn't do it, and no one else has access to my Mac- and it looks from Discussions like this has happened to others, and only while in New Message (a glitch?).
    This is the simple but not immediately apparent fix.

    Thanks Bernd:  I am using Adobe Acrobat 10 Pro.  I did get a response from Dave Marchant which directed me how to find the layers icon and I found the options icon as suggested in Adobe Help.  However, the options do not allow me to choose an option of either merging layers or flattening layers.  I am a novice at this and am trying to get this 1-page pdf graphic to convert to a Word document.  Is it possible that I already have a single layer pdf and that Word is doing something weird during the conversion?  I tried to convert the document yesterday and I ended up with two pages in Word.  One page had the text boxes and one had the river channels on which the text boxes had been inserted.  This is not a document I created.  We have been struggling for 5 years at various times to get this one page document into Word so that it can be used in multiple reports.  Even the graphics departments at a couple of companies have not been able to get this document resized from the original 11 x 17 format into 8.5 x 11.  I managed to get that done yesterday.  But now can't get a useable version into Word.  Suggestions?

  • BEx Analyzer Not showing report result in canceling "Change variable Icon"

    Hi Experts,
    Do we have any settings in BEx Analyzer for retrive the Result set even after I click 'Change variable Icon' in Toolbar and cancel the variable pop-up window??
    Eg: My query Result is displayed in Analyzer selecting some vaues in Selection screen.And when I click the Change Variable Icon from 'Analyzer Toolbar' its showing me 'Select values for variable' window.If I select the cancel button in it, then Query result becom blank showing the message "There are variables; change variable values". Do Analyzer having an option or settings to keep the result even if i cancel the variable selection from "change variable icon".
    Thanx in advance..

    Sari-
    If SAP provides such a function, I have not found it. The way I understand it., the change variable value initiates the OLAP back end. This clears the Presentation Manager front end, and clears the 'results' that are displayed on your workbook. If you cancel the OLAP run, the front end clear still executes.
    HOWEVER... if you turn OFF Automatic Refresh before clicking on Change Variable Values and then clicking on Cancel, the presentation manager will not write any changes to your workbook. So that is your best solution.

  • Accept Changes button visible in Approval link but not in Check Status

    Dear Experts,
    We are on SRM 4.0 .
    After a SC is rejected partially the requester can see the SC under Check Status link with the status In Your Inbox
    When the user clicks on the Detail icon, there is only CHANGE button but when the user clicks on Approval Link
    he can see Description as 'Your Shopping Cart xxxxxxxxx was change/rejected in part.Please Check' and when he click on the Detail icon there are two buttons at botton Accept Changes  and  Change  .
    Why is the Accept Changes button not there in detail display of SC under check status link?
    Thanks,
    Anubhav

    Hello,
    This is the standard behaviour of SRM4.0. 
    When a SC has been partially rejected the the SC goes to the requestor approval inbox. Requestor can either accept the change or he/she can change the SC and order again.
    If requestor accept the change that means requestor has been accept the rejection, so requestor will not be able to create the PO for that line item. He/she needs to change the SC depending on the approval note and order again.
    Check status transation is used for check the status of the shopping carts. Due to that reason the Accept change button is not exist there.
    Regards,
    Anindya

  • Updating button icon issue

    Hi, thanks for stopping by.
    Working with scriptUI panel and trying to update icon for my button, but something goes wrong with my code, I guess...
    Can someone write what is the problem here?
    var mainPanel;
    function stabpanel(thisObj) {
        mainPanel =(thisObj instanceof Panel) ? thisObj : new Window("palette", "Change icon", undefined,{resizeable: true});
        var iconFolder = "~/path_1/";
        mainPanel.manSave =  mainPanel.add("iconbutton", [0,0,46,46], File (iconFolder+"AEP.png"), {style: "toolbutton"});
        mainPanel.changeButton = mainPanel.add("button", undefined, "Change icon");
        mainPanel.layout.layout(true);
    mainPanel.layout.resize();
    mainPanel.onResizing = mainPanel.onResize = function (){this.layout.resize ();}
    mainPanel.changeButton.onClick = function(){
    var iconFolder = "~/path_2/";
    // code below doesn`t work
        mainPanel.layout.layout(true);
        return mainPanel;   
       return mainPanel;
       mainPanel.center();
    stabpanel(this);

    You don't need to use autolayout to change the icon, just set the "icon" property.
    Something like this:
    function stabpanel(thisObj) {
        var mainPanel;
        mainPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "Change icon", undefined,{resizeable: true});
        var iconFolders = ["~/path_1/", "~/path_2/"];
        var iconFolderState = 0;
        mainPanel.manSave =  mainPanel.add("iconbutton", [0,0,46,46], File(iconFolders[iconFolderState]+"AEP.png"), {style: "toolbutton"});
        mainPanel.changeButton = mainPanel.add("button", undefined, "Change icon");
        mainPanel.layout.layout(true);
        mainPanel.layout.resize();
        mainPanel.onResizing = mainPanel.onResize = function (){this.layout.resize ();};
        mainPanel.changeButton.onClick = function(){
            iconFolderState = (iconFolderState+1)%2;
            this.parent.manSave.icon = ScriptUI.newImage(File(iconFolders[iconFolderState]+"AEP.png"));
            return;
        return mainPanel;
        mainPanel.center();
    stabpanel(this);
    Xavier

  • Finder questions (changing file icons, moving files, home/e)

    Hello all!
    I got my 17" Intel iMac just two days ago. Gorgeous machine, feeling very comfortable. I switched from Linux and there are a few things I can't figure out on my own, I'd appreciate if someone anmswers these simple questions.
    1. How can I change the icon which represents a certain file type?
    2. How can I "move" the files from a, say, removable drive to my local drive? When I drag the files it shows "+" in a circle and copies the card. But i want to move the files from it, not copy. Command+X and Command+V don't work.
    3. I am used to that home/end buttons bring to the beginning/end of a line, but in OS X they bring to the top/bottom of the page. Makes editing documents very hard. Is there a way to change it?
    Thanks in advance,
    Artemiy.

    Artemiy
    PHP and CSS files are associated with XCode but the icon is plain whiteOK, I can see the problem. I just created a small file of each type, and both acquired the TextWrangler icon. I then changed the .php to "Open with" Xcode, but this did not change the icon. The only way I could change it was to select another editor (SubEthaEdit) – so you may want to experiment here. Of course, it would then be a pain to have to know two editors!
    How do you move the files from a removable drive to HDDI don't do this that often, but if I had a lot I would be inclined to put them in a folder and move that.
    Well, this happens everywhere actually.Probably for GUI editors, since they would use the same OS text-handling features. But sometimes an editor will have extra controls.

  • Changing the icon for saved Web links.

    Im trying out different forum topics to see if anyone can help and I thought this would be a cool thing to do and might be doable with an applescript.
    I save a lot of web address as files to go back to later and I find the default @ icon for firefox or the blank icon for safari pretty appalling. I was wondering if there was a way to change the icon so that when ever I save a new link file it would use the new icon. I was thinking about just an icon that has the Firefox, safari, chrome logo would be good or even better a little picture preview of the web page its self. Any help on this little idea I have is very appreciated
    I really like the idea of a page preview for weblink files. Like this ( http://i12.photobucket.com/albums/a238/Nuclearanthrax/Screenshot2010-09-02at1021 41PM.png )
    I completely understand a straight up no answer to this. I have no idea how applescript works. I have used it very few times.

    Pierre,
    I tried this AppleScript but it was not working. Is there something that I need to check.
    I had a few web link files in a folder and the script RAN the INFO window popped up but nothing changed.
    This would be a valuable tool for me an my students,
    Thanks in advance
    Joe
    Pierre L. wrote:
    The following script should do part of what you are asking for. However, since it uses [GUI Scripting|http://www.macosxautomation.com/applescript/uiscripting/index.html], you must first enable the Accessibility Frameworks by clicking the checkbox labeled "Enable access for assistive devices" in the Universal Access System Preference pane.
    Just copy and paste the script into the AppleScript Editor window and click the Run button.
    *set theInfoFiles to choose file of type {"webloc"} with prompt "Please select one or more Internet location files." with multiple selections allowed*
    *set theAppFile to POSIX file "/Applications/Safari.app" as alias*
    *tell application "Finder"*
    activate
    *open information window of theAppFile*
    *set windowName to name of result*
    *tell application "System Events" to tell process "Finder"*
    *set focused of image 1 of scroll area 1 of window windowName to true*
    *keystroke "c" using command down*
    *end tell*
    *close information window of theAppFile*
    *repeat with thisFile in theInfoFiles*
    *open information window of thisFile*
    *set windowName to name of result*
    *tell application "System Events" to tell process "Finder"*
    *set focused of image 1 of scroll area 1 of window windowName to true*
    *keystroke "v" using command down*
    *end tell*
    *close information window of thisFile*
    *end repeat*
    *end tell*
    Hope it can help.

  • Skins & af|selectOneRadio - changing the icon selected/unselected render?

    Wondering if someone has tried changing the render of the af|selectOneRadio component using CSS/skins? I want to replace the various images used by the blafplus-rich default to bring it into line with radio-button renders used elsewhere in our apps. I've tried using selectors like:
    af|selectOneRadio::content-input::selected-icon {
    background-image: url("..");
    .. but to no avail. Disabling compression and using Firebug seems to confirm that ...
    .af_selectOneRadio_content-input {
    cursor:default;
    padding:4px 3px 0 2px;
    vertical-align:10%;
    ... my CSS setting should be around the mark for the component in question, but it's not actually doing anything. So my questions is whether these images are something we can change, and if so, what is the selector spec required for overriding blafplus-rich to get the job done? Using JDeveloper 11.1.
    Many thanks.

    Hi robli,
    AFAIK there is no way to change the icons for html radios, however they can be changed with the help of Javascript + some css.
    I also checked ADF Faces css files and could not see any selector that you can set your own icon.
    Check out the following link, you may find some useful information on there.
    http://ryanfait.com/resources/custom-checkboxes-and-radio-buttons/

  • How to change the icon of the news in Portal?

    Do you know how to change the icon of the news in Portal?
    I use NewBrowser to Browser the news, but I think the Icon of the News is not good,I want change it ? what should I do?
    Thanks for your help!

    Hi,
    if you are talking about the NewsBrowser of Knowledge Management (Content Management -> Explorer -> News), you should see a button "Edit" on the right side of the news.
    Press this button and fill in a new URL in the input field "Image URL". After saving the new settings, the new image should be displayed.
    Kind regards,
    Ralf

  • Changing RadioButton Icons

    My application uses the Metal look and feel, and it doesnot allow the user to change lafs. I am trying to allow the user to scale application-wide font sizes by using the MetalTheme stuff. Changing the font sizes is easy, but this doesn't affect the appearance of the CheckBox and RadioButton icons (amoung others). So I have implemented by own Icon classes that I want to use, and after the user changes the theme I call the following functions to install my icons.
    UIManager.put( "CheckBox.icon", MyThemeIconFactory.getCheckBoxIcon() );
    UIManager.put( "RadioButton.icon", MyThemeIconFactory.getRadioButtonIcon() );Now, the kicker is that the check boxes work correctly. When the user selects a new font size, the check boxes scale correctly.
    However, the radio button icon never changes size. It seems to always remain the same size as the initial (default) theme size. Does anyone know why it works for check boxes, but not radio buttons?? Also what would I have to do differently to get around this??
    Thanks
    reg

    Nevermind, figured it out!

Maybe you are looking for

  • Battery upgrade for HP-15-g012dx

    What and where can I buy a more celled battery (than the default 3 celled) to complement this: http://www.bestbuy.com/site/hp-15-6-laptop-amd-a8-series-4gb-memory-750gb-hard-drive-black-licorice/...

  • It thinks my video files are music

    I used my iPod with my laptop for the first time a few days ago, and for some reason it moved all of the video files on my iPod into the music section. I can only assume that's because I had a really old version of iTunes on that computer at the time

  • How to create variables in AWB

    Hi Experts, Can anyone tell me how to create Varibales ( the ones that are used in BEX) without logging into BEX. Is there any TCODES for that?? Thanks, Arun

  • Refresh of report hides jQuery calendar popup anchors

    In an attempt to build an interactive tabular form in Oracle Apex 4.0.2.00.07, we have based an interactive report on a query containing: SELECT ...      , apex_item.date_popup2( p_idx              => 11                             , p_value         

  • Hard drive crashed/ Photo shop elements 7 can't be reinstalled/license key valid for one installation

    Good Day All Forum People! My hard drive crashed! I cannot install my Photo Shop Elements into my new hard drive. The License key is designed for one download to one computer. How do I download not only my Elements 7, but as well all my tutorials/tra