The purpose is to separate logic from look, so all visual elements should be defined in a skin. Is it also possible to define some visual properties, e.g. color, in a skin as a variable and somehow reference such variable from the host component?
There is no error when a skin has <fx:Script> and inside the script there is a public variable. If the skin had an id, then it would be possible to reference its public variables through this id. But skins have no id, only skinClass property is just set to the skin class. (unless there is a way to give an id to a skin which I don't know about), so it's not possible to reference any variables from outside.
It is solved by declaring a SkinPart in the component and using the same id in the skin. Case closed - unless someone knows better way.