Johannes,

I gathered from the documentation that the recomended method was to
invalidate via flags in the styleChanged method and update your rendering in
updateDisplayList.

Out of interest what do you do?

I knew I would get caught on this. ;-)
Well, I have had a lot of experience with the framework so some things get
intuitive. Most of the times I use committal flags ONLY when something
doesn't invalidate itself OR styleName settings. Since setting the styleName
actualy calls styleChanged("styleName") it keeps the flow going in the same
direction.

But, I don't do a whole lot in styleChanged(). Setting styleNames,
invalidating. :)

So, bottom line is use flags until you can tune an guitar with your ear. ;-)

Muzak,

Graphical skinning seems to be mainly focused around mxml and programmatic
skinning around AS.

That is not true.

Case in point; AS skins are just a class that implements IFlexDisplayObject
right? An interface that is it. A graphical skin also implements
IFlexDisplayObject.

So with this abstraction skins are skin regardless of color, no pun
intended.. :)

Get used to the fact the framework can do what you want, you just have to
point it in the direction you want to go:)

Now, as far as design view in Flex Builder with skins, that will have to
wait for future releases. But, runtime skinning rocks, and it can be done
eloquently.


Peace, Mike




On 06 Mar 2007 04:53:25 -0800, Muzak <[EMAIL PROTECTED]> wrote:

  Hi Mike,

Was kinda hoping someone from Adobe would respond, but oh well..
Maybe it's because I'm used to only call methods when needed (in the
creation process).

class MyClass {

private var __prop:String = "";
private var __hasInitialized:Boolean = false;

function MyClass() {

if(__prop.length > 0) {
setProp();
}
__hasInitialized = true;
}

private function setProp() {
// do something with __prop
}

function set prop(val) {
__prop = val;
if(__hasInitialized) setProp();
}

}

So setProp is only called:
- from constructor when __prop has a value (because "set prop" is called
before the constructor)
- from the setter, but only if the constructor has run first
(__hasInitialized == true).

Looks like I'm gonna have to get used to the new workflow a bit more
(using flags and invalidate methods, etc..).

Right now I'm not doing much in styleChanged, just checking which style
has changed and act accordingly.

Was mainly trying to figure out where's the best place to check for
graphical skin changes and what takes place in what order (which
methods are called and in what order), that kind of stuff.
The docs aren't really helping when it comes to graphical skins for custom
components and AS3.
Graphical skinning seems to be mainly focused around mxml and programmatic
skinning around AS.

But, as always, I wanna do things the hard way, hehe.. :-)

Thanx again for your time.

regards,
Muzak

----- Original Message -----
From: "Michael Schmalle" <[EMAIL PROTECTED]<teoti.graphix%40gmail.com>
>
To: <[email protected] <flexcomponents%40yahoogroups.com>>
Sent: Tuesday, March 06, 2007 12:40 PM
Subject: Re: [flexcomponents] styleChanged called twice during
initialization process

>> - Are those 2 calls really necessary/useful?
>
> I wouldn't trust anyones answer on this except the framework engineers.
:)
>
> I would say, if you find there is a lot of processing happening in your
> styleChanged() method, regardless of the null being passed two times,
create
> a flag and invalidateProperties(). Then in that call do your processing.
>
> Although this might happen on the same queue, I haven't tested it. If
so, it
> still might be a good idea, could you give an example of what you
normally
> do in styleChanged(). It's for repainting, setting styleName's etc.
>
>
> In my experience with the Flash 9 Player, you are going to have to do a
lot
> of sloppy coding before you will hit the players performance.
>
> Peace, Mike
>




--
Teoti Graphix
http://www.teotigraphix.com

Blog - Flex2Components
http://www.flex2components.com

You can find more by solving the problem then by 'asking the question'.

Reply via email to