Get swf stage dimensions

Is it possible to get stage width and height from swf?

First of all: there is only one stage.

To make sure you get the stage from anywhere you have Lib.current.stage

If you ask Lib.current.stage.width you will get the displayobjectcontainer width, so if you don’t add anything to the stage it will report zero.

If you want the “screen size” you can ask for Lib.current.stage.stageWidth and Lib.current.stage.stageHeight . Those will contain the size of the screen.

Hope this helps!

Not exactly.
I have swf with assets. And I want to get the stage width, that is setted up in fla file.
Is it possible?

Ok, did some research.
What you are asking is a common problem even since the AS3 era.
When you load an swf the original stage for that swf is lost and the only way to get that information is either from the metadata or from the Loader object that you used to load the SWF.

I am not sure if openFL mirrors the flash api in this particular sense, but you can certainly try.

Here it is some as3 code. It should be trivial to convert to haxe

// imports
    import flash.display.LoaderInfo;

// loading code
    var loader:Loader = new Loader();
    loader.load(new URLRequest('some_swf.swf'));
    loader.contentLoaderInfo.addEventListener(Event.INIT, loaderInitHandler);

// listener
    function loaderInitHandler(event:Event):void 
    {
        var info:LoaderInfo = event.target as LoaderInfo;
        trace('Loaded swf is ' + info.width + ' x ' + info.height + ' px');
    }

What target are you deploying to? (and what is the purpose of getting the dimensions of the swf)