writing swf controller