Hi,

There is a RESIZE event but...

If you are actually creating a custom component, I wouldn't recommend attaching events that actually are going to effect your updateDisplayList() and commitProperties().

Ok, If a client calls width or height, you are going to get an invalidateProperties(), invalidateSize() and invalidateDisplayList().



Lets see, the sequence would be...

1) myComponent.width = 350;

2) myComponent.invalidateSize()

3) myComponent.invalidateProperties()

4) myComponent.invalidateDisplayList()

5) myComponent.commitProperties()

6) myComponent.updateDisplayList()

You will get this always.

The trick would be to check your cached properties in commitProperties(), then if they have changed, switch a flag that says(as aggregated as you want)

var baseCalc:int = blah;

if (baseCalc != cachedBaseCalc)
{
   cachedBaseCalc = baseCalc;
   rightBoxInvalidateFlag = true
}

Then...

In you call that happens next in the updateDisplayList() you now have a fine grained access point to only update the calcs that have changed.

IE updateDisplayList()

If(rightBoxInvalidateFlag)
{
   //redraw only right box since it's metrics changed
   rightBoxInvalidateFlag  = false;
}

I hope that helps and doesn't confuse. hehe I develop some pretty big components and using events IN your component, well my opinion is nah don't do it.

Use the framework Luke. ;-)

Peace, Mike







On 8/23/06, tddclare <[EMAIL PROTECTED] > wrote:

I'm creating a custom component extending UIComponent.

Much of the component is drawn by the Drawing API during the updateDisplayList using
settings calculated during the commitProperties. Works great.

The problem arises when the end developer USING the component changes the size of it
manually (example: the height and width are 150, and they create a button whose click
changes the component's width to 300).

My commitProps and updateDispList are VERY conditional - only redrawing the elements that
NEED to be redraws to increase performance.

What I can't find / missed is how to know the component itself resized and to set a flag that
will tell my commitProps and updateDispList to redraw everything. What is that event / how
do I tell they resized me?

Thanks!

-- TC




--
What goes up, does come down. __._,_.___

--
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