views:

225

answers:

3

I need to create a "popup window" in AS3, which can contain things like textboxes and datagrids and stuff like that.

I have searched thoroughly, and have been unable to find such a component or class. Why did they remove the AS2 window in as3? That would have been perfect for this.

The closest thing I could find was http://fatal-exception.co.uk/blog/?p=69 which cannot support textboxes or datagrids.

Thanks for your help, I need this very badly.

A: 

It's not entirely clear what you want to do.

If you want to create a display object at the top of your application, then create a new layer directly on stage. That can have anything you like in it, and you can make it draggable or whatever you wish.

If you want to create a Flash window that floats above the browser, then you can't. Or rather, you can, but you need to create a new window using JavaScript (called from ExternalInterface, see this StackO question), load in a new SWF, and then link the two SWFs using LocalConnection. This is really unsatisfactory though, because LocalConnection is broken (in a whole host of ways).

alecmce
A: 

I was able to build a window class myself quite easily. It has some decent functionality.

I used startDrag(false) and stopDrag(); to program the dragging functionality, and this.parent.removeChild(this); to get rid of the window.

Cyclone
That doesn't answer your own question, so should not be considered an answer.
alecmce
It includes the basic functionality needed to make a "window". Implementation is up to whoever is using the code. I'm afraid you misinterpreted my question. The main question is not why the component was removed in as3, rather how can I create something which in effect mimics its capabilities. I feel your downvote was unnecessary, "drowntoge" provided a similar answer yet you did not downvote them. Please explain your logic.
Cyclone
A: 

What I would do is to create a class that extends MovieClip, include a TextField at the top as the title, an X button to close it, event handlers in order to handle dragging etc.
You can then instantiate the class and add the items to be shown as children.

Şafak Gezer
Pretty much what I eventually did
Cyclone