StablexUI icon indicating copy to clipboard operation
StablexUI copied to clipboard

on-display is not working with html5

Open hopewise opened this issue 8 years ago • 3 comments

In html5, at defaults.xml I've noticed that on-display is not working, however, on-change working fine:

on-display="PropsBinder.setCurrentField($this);"
on-create="$this.addEventListener(WidgetEvent.CHANGE, PropsBinder.OnPropertyChange);"

It seems that openfl.events.Event.ADDED_TO_STAGE is not working on html5?

I also tried:

on-create="$this.addEventListener(openfl.events.Event.ADDED_TO_STAGE, PropsBinder.setCurrentField);   $this.addEventListener(WidgetEvent.CHANGE, PropsBinder.OnPropertyChange);"

but didn't work..

versions:

lime: [3.3.0]
openfl: [4.2.0]
stablexui: [1.1.5]

$ haxe -version
3.3.0

it seems it's related to openfl?

hopewise avatar Oct 22 '16 09:10 hopewise

I've created a sample project in openfl, with html5 target, event ADDED_TO_STAGE worked fine, so, it seems a bug in StablexUI ?

hopewise avatar Oct 23 '16 03:10 hopewise

I've tried this simple gui:

<Text text="'Hello'" on-display="
    trace('DISPLAY!!!');
    var g = flash.Lib.current.graphics;
    g.beginFill(0xFF0000);
    g.drawRect(0, 0, 100, 100);
    g.endFill();
"/>

And got red square and string in console. So for me it looks like on-display is working. I've tested with the same libs versions and both Haxe 3.2 and 3.3 (latest git)

Can you assemble a minimal project for me to reproduce this issue?

Also make sure you are not clearing attached listeners somewhere with widget.clearEvent(type)

RealyUniqueName avatar Oct 24 '16 17:10 RealyUniqueName

Oh, wait. I tested with latest StablexUI from git. Everything else had the same versions.

RealyUniqueName avatar Oct 25 '16 06:10 RealyUniqueName