However, if you want to make a changable icon you'll have to do something like this which is the expected behaviour.
 
<?xml version="1.0" encoding="iso-8859-1" ?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
        width="600" height="600" backgroundColor="#FFFFFF">
<mx:Script>
<![CDATA[
[Bindable]
[Embed(source="aol.jpg")]
private var myIcon:Class;
]]>
</mx:Script>
       <mx:PopUpMenuButton id="printMenu" label="Print: Original Size" icon="{myIcon}">
         <mx:dataProvider>
          <mx:Array>
           <mx:Object label="Print: Original Size" icon="{myIcon}"/>
           <mx:Object label="Print: Fit to page" />
          </mx:Array>
         </mx:dataProvider>
        </mx:PopUpMenuButton>
</mx:Application>
 
Hope this helps,
-sam
 
P.S: Notice that if you remove the dataProvider the icon gets set for your PUMB. Because PUMB changes the label based on the selected menu item, it tries to get the icon too from the menu. So if you set the label to something(an item not in the menu) for the PUMB it won't change when you change the selected menu items, which will be the case for the Icon too (that's where the bug is, because it changes even when the label doesn't change ). But in any case the icon should get set - which is a bug. Thanks again

 
On 8/8/06, Samuel Reuben <[EMAIL PROTECTED]> wrote:
Yes I think it is Shan,
 
I'll log the bug. Sorry for the delay in the reply. It was being used with PopUpButton and was somehow missed in PUMB.
 
-sam

 
On 7/18/06, Shannon Hicks <[EMAIL PROTECTED] > wrote:

Nope, no change.
 
Adobe: is this on the official bug list? Seems like an oversight that some of flex's basic functionality isn't working.
 
Shan


From: flexcoders@yahoogroups.com [mailto: flexcoders@yahoogroups.com] On Behalf Of Samuel Reuben
Sent: Tuesday, July 18, 2006 3:47 AM
To: flexcoders@yahoogroups.com
Subject: [Junk E-Mail - MED] Re: [flexcoders] PopUpMenuButton icon not working?

 

try icon="@Embed('../assets/print_16.gif')"

 

It should work,
-sam


 
On 7/8/06, Shannon Hicks <[EMAIL PROTECTED]> wrote:

I've tried adding an icon to the PopUpMenuButton, but it doesn't seem to work.
 
It shows the icon in Flex Builder, but not in the compiled SWF.
 
I've added icons to every other type of button (the same icon, called from the same component in the same way), and they work fine.
 
Maybe it's a bug?
 
Code:
 
        <mx:PopUpMenuButton id="printMenu" label="Print: Original Size" icon="@Embed(source='../assets/print_16.gif')">
         <mx:dataProvider>
          <mx:Array>
           <mx:Object label="Print: Original Size" />
           <mx:Object label="Print: Fit to page" />
          </mx:Array>
         </mx:dataProvider>
        </mx:PopUpMenuButton>
 
If you're going to try it, be sure to actually create the gif, otherwise FlexBuilder throws some compile error about not finding the gif :)
 
Shan

--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.9.9/382 - Release Date: 7/4/2006



--
No virus found in this incoming message.


Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.1/390 - Release Date: 7/17/2006


--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.10.1/390 - Release Date: 7/17/2006



__._,_.___

--
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
Web site design development Computer software development Software design and development
Macromedia flex Software development best practice


YAHOO! GROUPS LINKS




__,_._,___

Reply via email to