I think it’s to be consistent with widthChanged and heightChanged. There is no “resize” event anywhere in FlexJS. It’s probably a good idea to not use the browser names for events.
I do believe there should be a ResizeEvent with consts for SIZE_CHANGED, WIDTH_CHANGED and HEIGHT_CHANGED. This does not yet exist. > On Feb 22, 2017, at 9:20 AM, Justin Mclean <jus...@classsoftware.com> wrote: > > 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