//Windows1.XML
<Alloy>
<Window exitOnClose="false">
<Button onClick="openWindows2" visible="false">
</Button>
</Window>
</Alloy>
CONTROLLER
//Window1.js
function openWindows2(e)
{
var Window2=Alloy.createController('Window2').getView();
newWindows.open();
}
$.Windows1.open()
<Alloy>
<Window exitOnClose="false">
<Button onClick="openWindows3" visible="false">
</Button>
</Window>
</Alloy>
function openWindows3(e)
{
var Window3=Alloy.createController('Window3').getView();
newWindows.open();
}
$.Windows2.open()
<Alloy>
<Window exitOnClose="false">
<Button onClick="anotherFn" visible="false">
</Button>
</Window>
</Alloy>
//Window3.js
$.Windows3.open()
You define your window in XML, say mycoolwindow.xml.
Then from some other part of your code:
var win=Alloy.createController('mycoolwindow').getView();
win.open();
See example here: https://github.com/ricardoalcocer/AlloyOpenWindow
or go to this link: http://www.youtube.com/watch?v=CB26lUj0UBQ