yes and no ... for [Event]
yes ... but [Bindable]
is not just a metadata tag ... [Bindable]
(without arguments!!) instructs the compiler to generate AS3 code, that will make sure a PropertyChangeEvent
is dispatched if you set the property (you can see that if you let the mxmlc keep generated AS3 code) ...
also, for [Embed]
this is not the case ([Embed]
must be followed by a variable. interfaces cannot have variables) ... you will always be able to retrieve the metadata through flash.utils::describeType
... this is quite inconsistent, since some metadata tags really provide just metadata compiled into the output, and some metadata instructs the compiler to really take action ... yet again, metadata provided by some tags is so heavily used by the flex framework, they become a language feature in MXML (as [Event]
) ... but they are not in AS3 ... however AS3 is a pretty close represantation of what happens on the VM, whereas MXML and Flex Framework both are only vaguely related to it ... this is also why ActionScript classes and MXML components interoperate very horribly (you might have noticed MXML doesn't have the concept of interfaces, execution flow (and thus time), whereas AS3 doesn't have the concepts of events or bindings (which are "native" in MXML, but are built on top of AS3, using some metadata, and the flash.events
package, looking very nice in MXML, but being an impressive number of calls and instantiations in AS3)) ...
what you want, probably will not work ... i personally think, it's more of a flaw that interfaces are allowed to have metadata at all ... nearly all metadata is for use at runtime ... at runtime, every object has its own class and interfaces are secondary for introspection/reflection ...
so back to the old school phrase: an interface requires behaviour, a class provides implementation ... [Event(name="fooUpdate", type="com.acme.events.FooEvent")]
is pure metadata ... and metadata is implementation in the world of AS3, because this does not require anyone to do anything (you might as well just write [Bar(foo="123")]
) ... it is a tag to put on top of a class, if and only if the class has this very line somewhere within its implementation: this.dispatchEvent(new FooEvent(FooEvent.FOO_UPDATE));
... what you are kind of trying to say is, any IFoozer
implementation will dispatch FooEvent.FOO_UPDATE
... this is a guarantee the compiler cannot provide, because it doesn't check metadata vs. implementation ...
hope that helped ...
greetz
back2dos