openfl.display.MovieClip has no field fixo

trace(e.currentTarget.currentFrame);
var mc:MovieClip = e.currentTarget;
mc.fixo = true;

error: openfl.display.MovieClip has no field fixo

I’m not sure what you’re expecting, here. is this a movieclip defined in a fla symbol, or something?

yes it is a movieclip, i edited the comment

Movieclips on OpenFl are not dynamic like they are in flash. you can’t set any property on them

what should i do then? I’m learning haxe now

can you explain what you’re trying to do in the long run? what problem are you having that this fixo bool is supposed to solve

Maybe you want to extend MovieClip:

class FooMc extends MovieClip {
    public var fixo:Bool = false;

    public function new() {
        super();
    }
}

This way you need to use new FooMc to create the movie clip.

Of course this doesn’t mean fixed display object, it depends on how the property fixo is used.

1 Like

In the example above, when combined with the extended class from @Hydroper you would need to do this:

var mc:FooMc = cast(e.currentTarget);
mc.fixo = true;
1 Like