开发者

AS3 window class which can hold components

I need to create a "pop开发者_开发知识库up 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.


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).


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜