Problem accessing generated swf classes in VSCode

Hello, I am new to openfl and just getting used to the workflow using SWF assets.

I am using ‘preload’ and ‘generate’ to set up my swf library. I have no issues instantiating a symbol with
Assets.getMovieClip - but I would like to instantiate the generated classes or extend them normally as described in the ‘using swf assets’ tutorial and in this video tutorial

Generate seems to be working properly, I have the _generated folder in Export/neko/haxe with all the expected classes. However when I try to access them in such a way: var clip = new MySymbolClass (); VSCode does not recognize the type, and I get an Unresolved identifier error.

Is there something simple I am missing? How should VSCode be accessing these classes?

I am using haxe 2.4.0 plugin (nadako), and lime 1.2.1 plugin for VSCode
as well as lime 7.0.0, openfl 8.4.1, and haxe 4.0.0-preview.4

Thanks

Does it compile properly, despite VSCode complaining about it?

Actually, yes it does - I hadn’t realized this.

Is there a way to have vscode recognize the classes (not complain)?

It’s possible it might work properly after you build for the first time. You may have to restart VSCode at least once to clear out the compile cache. Improving support VSCode before doing an initial compile is still TODO

The other approach is to openfl process your.swf first, then to use the already processed SWF in your assets directory, and use Assets.loadLibrary ("path/to/processed/swf.bundle"); instead. Sorry I’m not writing out a fuller example, but following this process would make generated classes immediately available without a project build

1 Like