You can't show one instance many times. You will have to create as many
instances as you need windows.
private function createWindow(message:String):void
{
var win:BasicWindow = new BasicWindow();
win.showText = message;
win.open();
}
You will have to manage all the instances created.
Haykel Ben Jemia
Allmas
Web & RIA Development
http://www.allmas-tn.com
On Wed, Dec 17, 2008 at 10:50 PM, markflex2007 <[email protected]>wrote:
> Hi,
>
> I have a component file.
>
> BasicWindow.mxml
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Window xmlns:mx="http://www.adobe.com/2006/mxml"
> layout="absolute" width="300" height="200">
> <mx:Script>
> <![CDATA[
>
> [Bindable]
> public var showText:String;
>
> ]]>
> </mx:Script>
> <mx:Label horizontalCenter="0" y="58" text="{showText}" id="lbl"/>
> </mx:Window>
>
> This is the main file,but I only can open the window once,I want to
> know how to open it many times.Please help me.Thanks
>
> main.mxml
>
> private var win:BasicWindow = new BasicWindow();
>
> private function createWindow():void{
> //Alert.show("I am here");
>
> win.showText = "Show me on the Window";
> win.open();
> }
>
>
> <mx:Button label="Open Window" click="this.createWindow()"
> horizontalCenter="0" y="50"/>
>
>
>