Perhaps you need to create an extern class for the SWC types, so that you have something to override. For example:
extern class SWCClassType {
public function hello ():Void;
}
class MyClassType extends SWCClassType {
public override function hello ():Void {}
}
There’s also a way to replace a class defined in an SWC. For example, say you have a type in the SWC that has no code, and just defines a MovieClip symbol. You should be able to inject code using the @:bind meta-data on the SWF target, I think it works like this:
@:bind
class SWCClassType extends MovieClip {
// add your own types
}
protected function get defaultStyleProvider():IStyleProvider
{
return null;
}
I have class that extends it.
if I try to override it:
@:getter(defaultStyleProvider) @:protected override function getDefaultStyleProvider(): IStyleProvider {
return CustomController.globalStyleProvider;
}
compiler shows error: Field getDefaultStyleProvider is declared 'override' but doesn't override any field
as I try to override native getter from as3 but in haxe syntax its getDefaultStyleProvider not get defaultStyleProvider
tried to make extern property but got an error that I can not redefine property from the parent. @:extern var defaultStyleProvider(default, never): IStyleProvider;
Error: Redefinition of variable defaultStyleProvider in subclass is not allowed. Previously declared at feathers.core.FeathersControl
will try more with externs and bind maybe will somehow push compiler to add the override to getter.
this looks dead end, probably will fork lib and refactor getter to function so I can override it, not nice but I can not find any other solution here, would be nice to have untyped code in as3
Yeah! The tricky (and valuable, but still tricky) part is that Haxe compiles to ActionScript Bytecode directly, and avoids AS3. That’s why you can do untyped __js__ but you can’t do untyped __as3__ because Haxe skips that step for Flash