I would like to add an title Icon image to a Panel, but cant find the click event on that icon,
The titleIconObject of the Panel class is declared as an mx_internal variable, so if you want to do anything with it you will probably have to extend Panel and override it and some of the methods that reference it.
EDITED TO INCLUDE FURTHER INFORMATION FROM MY COMMENT:
#seismael: Actually, upon further review, a better way would be to override commitProperties and handle it there. Open up the Panel class in the SDK and look for the section beginning if (_titleIconChanged) (in the current SDK I'm using it's line 1168). Just do super.commitProperties() and then adjust that conditional block to add your event listener for _titleIcon, etc
Related
i have a map on my page with maptype control button. When initializing the map i add a css style(highlighting the current active map type, like "Map" or "Satellite")to the button.
When resized, the map kind of reloads and the button css disappears, so i have to wait for the resize to end and reapply css style on the button.
In the end it just looks weird, because the map loads and the button has default color, after 2 seconds (i use settimeout) the button is applied the css again. How can this be done so the button gets the css before map loads and also keep that css.
Should i use a callback here and would that make a difference?
As mentioned in Custom Controls, few rules are necessary to create your own custom control. The following are the guidelines which also acts as best practice:
Define appropriate CSS for the control element(s) to display.
Handle interaction with the user or the map through event handlers for either map property changes or user events (for example, click events).
Create a element to hold the control and add this element to the Map's controls property.
To know more about these concerns, please go through the discussion and sample codes in the given documentation primarily in the following:
Drawing Custom Controls
Handling Events from Custom Controls
Positioning Custom Controls
A Custom Control Example
Adding State to Controls
I need to completely initialize a custom component in my Flex app (i.e. I should be able to access it from action script and get its properties and its children etc), But I do not want to add it to the display or make it visible.
I have tried to add it to my visible component, but keep it visible, but often many of its properties are set only when it is drawn, so i don't get what i need.
Is there a way to add a custom component to some sort of 'Virtual' display, that is not visible to the user?
You could add the component to an invisible Sprite - that way the component itself could both be on the stage and have its own visible property set to true.
Did you try using initialize()? After a view is added to the display list, the initialization stage begins. Calling initialize() before addChild() should let you initialize the view without needing to first add it to the stage.
For more info visit:
http://flexscript.wordpress.com/2008/10/24/flex-component-lifecycle-and-flex-component-framework/
http://blog.deadinkvinyl.com/2008/10/05/flex-3-addchild-and-initialize/
Not sure if possible without adding it to the display list, although I'd wish it were to some extent.
I once had to make custom drag proxy, which didn't work with the real component, because of some weird skinning issues. So instead I had PopupMananger add a box as a popup, added my component to the box, called validateNow on the component, drew it in a bitmap data, removed the popup, and used the bitmap data as the proxy.
So what you were trying was missing a call to validateNow most likely.
How to add custom component in context menu of datagrid.Here custom component like one text box with formatting details.
You cannot put components into the context menu. You can only have menuitems that dispatch a menuclick event. Unfortunately the context menu in the flashplayer is lacking a lot of functionality like that.
You might be able to highjack the context menu all together and display some sort of title window on a right click, but I am not sure if this is possible or how you would go about trying to achieve it.
In my flex app I have custom tooltips on buttons that hide and show based on user context.
The problem that I dealing with is that when I call my showTips() function I only want to show tooltips on the buttons that visible in the view. So buttons that on a un-selected tab (tabNavigator) should not show the tooltips.
For some reason all tooltips are showing.
Is there a way to detect if a button is not in current view, like on a un-selected tab?
If you gave us some code I could check this out, but would this work?
if(button.parent.visible) { showTip(button);}
Instead of custom coding for each button, make use your tabnavigator's creation policy is set to "auto".
Check this link for more details
http://livedocs.adobe.com/flex/3/html/help.html?content=layoutperformance_05.html
I would like to be able to change the active pane of an accordion using javascript.
I see a behavior set_SelectedIndex but I can not seem to get it to work.
How can I find out what the supported methods are for this control?
How can I set the selected index from the page?
I found a comment on this blogpost http://disturbedbuddha.wordpress.com/2007/11/30/selecting-an-ajax-accordionpane-by-id/ which showed me how to use Accordion.AccordionBehavior.set_SelectedIndex(index);.
I am outputting a startup script from the codebehind of variables with the paneIds prefaces with a code and their index. This allows me to set the active pane by id.