Hi,

> Looks like you’re using a flash event instead of the flexjs one.

Thanks for that I tried that as well, but still doesn’t work.

I can see the Resize bead is doing this:
 window.addEventListener('resize', 
org.apache.flex.utils.Language.closure(this.resizeHandler, this, 
'resizeHandler'), false);

And dispatches a “sizeChanged” event like so:
initialView.dispatchEvent('sizeChanged’);

Any reason for the event name change?

So this code below will work. But it seems a rather roundabout way of doing it.

<?xml version="1.0" encoding="utf-8"?>
<js:Application xmlns:fx="http://ns.adobe.com/mxml/2009";
                xmlns:js="library://ns.apache.org/flexjs/basic" 
initialize="init()">

    <js:beads>
        <js:BrowserResizeHandler />
    </js:beads>
    
    <fx:Script><![CDATA[
        public function init():void {
            initialView.addEventListener("sizeChanged", resized);
        }

        public function resized(event:Event):void {
            trace("resized to " + initialView.width + " x " + 
initialView.height);
        }
        ]]></fx:Script>
    <js:valuesImpl>
        <js:SimpleCSSValuesImpl/>
    </js:valuesImpl>
    
    <js:initialView>
        <js:View percentWidth="100" percentHeight="100">
            <js:Label text="Resize Me" />
        </js:View>
    </js:initialView>

</js:Application>

  


Thanks,
Justin

Reply via email to