tags:

views:

29

answers:

2

Hi,

Does anyone know what the onLoad() or similar Event is in Flex? I'm trying initialize, but no joy.

            protected function videoArea_initializeHandler(event:FlexEvent):void
        {
            var currentPosition:int = videoArea.verticalScrollPosition;
            if (currentPosition < 0)
            {
                left_button.visible = false;
                right_button.visible = true;
            }
        }
+3  A: 

The best alternative for onLoad() in Flex would be creationComplete.

See this link (Adobe) and this link (MikaFlex) for more information about the event hierarchy.

Prutswonder
+2  A: 

What are you trying to initialize? If you're asking for the Flex Parallel to OnLoad(); perhaps you should tell us where onLoad() comes from?

I strongly suggest reading up on the Flex Component LifeCycle.

You can do initalization in the constructor of a component. If using MXML, you might want to use the preinitialize event. Some folks also use creationComplete.

www.Flextras.com
creationComplete seems the way to go, yeah.. I was checking the XML Nodes to .length to decide whether the arrows are required to load or not.
StuBlackett