Any thoughts on why this wont work on a button but works just fine on the titlewindow close handler? No compiler errors, no flash debugger errors.
title="Create New Ticket" x="800" y="600" width="800" height="600" textAlign="left" title.workRequest="Create New Work Ticket" title.State1="Create New Support Ticket" title.materialRequest="Create New Material Ticket" close="closeWindow();">
public function closeWindow():void
var closeThisWindow:CloseEvent = new CloseEvent(CloseEvent.CLOSE, true, false);
<s:Button label="Cancel" click="closeWindow();"/>
Obviously it will not work as close event is made for popup windows
The CloseEvent class represents event objects specific to popup windows, such as the Alert control.
And in closewindow(), you have not specified what to close, so when you are using with titlewindow...it will automatically understands by itself to close window which is open and also it supports close event but for button there is nothing to open which it would close and more button does not suppot close event so it will not work.
Hope you understood what I mean to say!!!