you need to put it in an action, or a function that is run by the entity.
the easier way is just to go in WED, select the entity, go to properties, and check the "polygon" flag. should be just the same.
The problem is: "my" can be pretty much every element. if you put it just at some random place in the wdl file, the compiler won't know who is meant by "my"... just set it in WED...