BowlerHatLLC / vscode-as3mxml

ActionScript & MXML language extension for Visual Studio Code. Develop apps for Adobe AIR, Adobe Flash Player, or Apache Royale.
https://as3mxml.com/
Apache License 2.0
257 stars 40 forks source link

Configuration option to define Adobe Animate library symbols with generated linkage #456

Open bls1999 opened 4 years ago

bls1999 commented 4 years ago

I have graphics with AS3 linkage that don't have any corresponding AS3 files (the linkage is assigned in the .fla project and the files are generated automatically when the SWF is compiled). As a result, the program throws a problem to the problems list with this message:

Type was not found or was not a compile-time constant: NameOfGraphic.(1046)

Is there a way to specify which project files are generated automatically by flash in order to mute these errors? Maybe in the config file?

joshtynjala commented 4 years ago

You will need to create the appropriate .as file for each of your library symbols with AS3 linkage. There's no way for VSCode to know that something is automatically generated by Animate, so you need to do it manually instead. It can probably be as basic as this:

package {
    import flash.display.MovieClip; //or Sprite, if you prefer
    public dynamic class NameOfGraphic extends MovieClip {}
}
bls1999 commented 4 years ago

Oh, darn. Thanks for the response. Would it be possible in the future to add a feature to the config file that would let VSCode know which files are included in the .fla?

joshtynjala commented 4 years ago

It's something that I can look into, but I'm not sure that it's possible.

bls1999 commented 4 years ago

Thanks a bunch. I suppose a way to go about it would be "ignoring" the absence of files explicitly listed in the config file.

leuraupp2 commented 9 months ago

This feature is about to work? I need this feature too, cause i have so many generated linkage.

joshtynjala commented 9 months ago

This feature is not planned because there is no way to get the linkage names from Animate.

leuraupp2 commented 9 months ago

This feature is not planned because there is no way to get the linkage names from Animate.

Ok, thanks 😊