Flex 4 ItemRenderer Question - apache-flex

I have a DataGroup with a Custom ItemRenderer. Within the itemrenderer, there are 2 states. normal and hovered. I have a <s:Group> within the itemrenderer that shows a bunch of data but i only want to be shown when hovered so I can do includeIn="hovered" which is good.
the problem is the x,y position of this group needs to be outside the bounds of the container itself. much like a tooltip only that this is not a tooltip.
whatever i do, it stays within the bounds of the datagroup. any ideas? or am I missing something simple here?

The behavior you are describing sounds an awful lot like a tooltip/datatip. Why not create your own tooltip skin and assign it to your renderer instead of re-inventing tooltips?
EDIT: Based on the comment below, the approach I would consider is to show a custom skinned Panel or ToolTip when entering the hovered state using the PopUpManager.addPopUp method. After adding it, then position it where ever you like. You'll probably need to change the local coordinates to the global coordinates when moving your popup. Then call PopUpManager.removePopUp when exiting the hovered state. Hope that helps.

Related

How to temporarily hide elements while designing in Gluon Scene Builder?

I have complex design that has several layers on top of each other. Problem is that if I click on object, other object that on top of it gets selected. How I can switch off visibility of my top objects while working on my bottom layer, so that they won't get in the way?
I finally found how to achieve what I wanted. Just select element that in the way and in properties remove tick from visible. Now you can design without anything obstructing your view! Just don't forget to make visible all elements before you save your work.

difference between <s:Line> and graphics.lineTo()

If I skin a button and use the AS3 graphice.clear() and graphics.lineTo and beginFill to create a shape, the button overlaps other items in the container.
When I use the and mxml to create the same shape, the button is neatly positioned inside the container.
Why is that?
This is probably happening because Flex is unable to calculate the size of your dynamically drawn button, while the MXML version allows the size to be calculated prior to being displayed. You may need to override the measure method to calculate the width/height. If that's not the issue, then post some code so we can take a closer look. Hope that helps.
Because the Line Object is doing a bunch of checks and extra work you aren't doing when you use the Graphics object. Look at the code for spark.primitives.Line to see what its doing that you aren't.

Flex 3 - Custom tab navigator

I'm trying to create a custom tab navigator that has to look like this http://www.freeimagehosting.net/uploads/b470d024c4.jpg.
Also, when there's a rollover, the borders of the arrow have to be in blue (like the label in the current tab).
For that purpose, I've created a custom component: a hbox containing a label and a canvas with 3 images inside (for the arrow tip that has to change depending on the currentState).
Then, I thought of overlapping the components in order to get the blue highlight color (ex: arrow button 3 is over arrow button 4. The image of the arrow tip in button 3 will be transparent outside the arrow, so that we can see the black color of the following button).
I'm now trying to position the components inside the canvas ... but I cannot.
After the creationComplete event, I assign the label text and I was calculating the coordonates of the component but it doesn't take into account the label width... -_-'
Any ideas?
Thanks. Regards,
BS_C3
Read up on the Flex Component LifeCycle. You should be positioning and sizing your child components in the updateDisplayList() method; not in a creationComplete handler.
You should assign the label text in either commitProperties or createChildren depending upon when you know what it is.
If you want to share some code, we may be able to hone in on the exact problem. If you run code like this:
myLabel.text = 'Blahblahblahblah';
trace(myLabel.width);
I would expect that the width has not changed to reflect the new text because the myLabel has not gone through it's own component lifecycle steps yet.

Tree dataTipFunction tooltip Change position,Flex3

I am doing dataTipFunction on Tree in Flex3 Air,
At present the tooltip hides the present node, i need to reposition the tooltip above the node, how can change the x,y position of the tooltip.
Thanks in Advance
The way I did this was to add the toolTipShown listener on the tree itemRenderer, not on the tree. I have a blog post that shows you how to do it, including the code for positioning the tooltip below or above the node.
Hook into the tooltipShow event on the Tree and move the tooltip yourself (a reference to the tooltip is in the event)
tooltipShow
You might need to do a bit of logic to position it correctly, and you'll probably want to check if repositioning it would move it off screen and move it below instead in that case.

Zooming effect on datagrid cell with an image in the itemrenderer

I am not able to figure out how to zoom the image displayed with the help of an item renderer.If i apply the Zoom effect on rollover ,the particular cell zooms the image with the scroll bars.Is their any other way of doing this without showing the scrollbars.
You'll need to duplicate the image and place it outside of the datagrid component. If it's inside the datagrid, it'll be forced into one of the rows. It might be helpful for you to look at the code for the DataGridDragProxy - it does does something sorta similar.

Resources