Maybe see what [as3swf](https://github.com/claus/as3swf/blob/master/src/com/codeazur/as3swf/tags/TagDefineButton.as#L38) does?