Take the 2-minute tour ×

I'm using the bit101 components for flash in as3, and I have a window with a white background color. I want to make that color semi-transparent. If I set the alpha for the window, everything inside the window is also semi-transparent. I just want the background. How do I accomplish this? This is my code:

window = new Window(square, 10, 10, 'ADVANCED\t\t\t\t\t\t\t Use spacebar to randomize values');
            window.width = 380;
            window.height = 140;
            window.hasMinimizeButton = true;
            window.shadow = false;
            window.minimized = true;
            window.addEventListener(Event.RESIZE, onWindowResizeHandler, false, 0, true);
            window.color = 0xFFFFFF;
share|improve this question
add comment

1 Answer

up vote 1 down vote accepted

From a quick look at the source code, it appears that the Window contains a Panel, and the Panel contains a protected _background object.


override public function draw():void
    _background.graphics.lineStyle(1, 0, 0.1);
    if(_color == -1)
    _background.graphics.drawRect(0, 0, _width, _height);

I would try to extend both the Window and the Panel classes and somehow add the ability to specify a backgroundAlpha property, which would be the second argument to beginFill() above. It looks like a lot of work.

There doesn't appear to be a more straightforward way to do this.

share|improve this answer
add comment

Your Answer


