Migrating an existing flex 3 application to html5 using haxe openfl encountered issues

to explain my problem i should talk first about our project. We have a flex 3 project with an mxml view wich contains a button when click on it, it shows a popup.
first step was to convert the mxml view to as3 with compiler options in flash builder. Now all we have is source code of the flex 3 sdk and a small app in as3. So we used as3hx tool to convert the whole code to haxe.
After resolving a bunch of compile time errors we have now an app that runs but it shows nothing. we use flashdevelop with js target. our first thoughts were to debug the flex 3 app to see steps used to load the application, As we know the flash player instantiates the SystemManager wich is the root of all flex apps
In the main flex app we have

public class Main extends Application{}


*  The frameworks must be initialized by SystemManager.
*  This factoryClass will be automatically subclassed by any
*  MXML applications that don't explicitly specify a different
*  factoryClass.
public class Application extends LayoutContainer{}

The Frame metadata indicates that the factoryClass is the SystemManager wich should be instantiated before the instantiation of the Application class.
But in Haxe we have

    class Application extends LayoutContainer{}

Those metadata dont work in haxe because our target is js not flash so is there any way to implement this approach?
And even if i try to instantiate the SystemManager in the ApplicationMain in openfl a lot of variables that are not initialized such as stage is null also the loaderInfo. I didnt find the way that the flash player works with flex and how it instantiate the SystemManager and initilize those variables.
And what about the openfl-html5 because we need js target?
Thanks for your help or any clarifications.

OpenFL supports three different entry points for applications

Extends Sprite

When you have a main class that ends openfl.display.Sprite, OpenFL creates the stage and adds an instance of your class onto the stage. stage, loaderInfo and other properties should not be null.

This is what most OpenFL projects use, and is most like a traditional Flash project

import openfl.display.Sprite;

class MyClass extends Sprite {
    public function new () {
        super ();
        trace ("Hello World");

Static Main Function

In Haxe (without using OpenFL), Flash projects instead begin with a static main function. From there, you can create an instance of a class and add it to the stage, or not. This is less commonly used in OpenFL projects, but is supported for compatibility with these kinds of applications.

The stage is created in this case, but is only accessible through public static references such as Lib.current.stage

class MyClass {
    static function main () {
        trace ("Hello World");

Lime Application

OpenFL also supports a more advanced style of starting an application. You can extend the lime.app.Application class, and take more complete control over the lifecycle of an application. The entry point begins before a native window is created, or OpenFL stage, and you have control over when this occurs.

Perhaps your code is falling through to this third kind of entry point, as your class does not extend Sprite.

How much Flex code do you rely upon? Can your code be made to extend Sprite and operate from there?

In my humble opinion you are going the wrong way.
If you try to get Flex SDK code and translate it will be painful and a dead end.
Convert the mxml code to use some layout/widget library such as HaxeUI. (it’s pretty easy as you can use xml files, and the component names are very close)
and use as3hx to convert as3 classes.

Afterwards, Fix Array conversion to typed arrays, and clean reflection conversions.

That’s how we did it.