actionscript-3transparencymodal-dialogmodalpopups

How can i change modal transparency in Flex


I create a modal window with PopUpManager

_zoomImgPopUp = PopUpManager.createPopUp(this, Image, true) as Image;

When the modal window is opened, all background is gray and with blur. How can i change color, blur and transparency of background.

I find this article http://mprami.wordpress.com/2008/04/22/alert_popup_modal_transparancy_color_blur_changes/

but it is for "mx" application. I need something with "spark" components.

UPD: Solved. It must be:

_zoomImgPopUp.setStyle("modalTransparency", 0);
_zoomImgPopUp.setStyle("modalTransparencyBlur", 0);
PopUpManager.addPopUp(_zoomImgPopUp, this, true);

Solution

  • You have access to styles in the tag that affect Modal.

    You should be able to do this:

    _zoomImgPopUp.setStyle("modalTransparency",1);
    _zoomImgPopUp.setStyle("modalTransparencyBlur",3);
    _zoomImgPopUp.setStyle("modalTransparencyColor", #ff0000);
    

    You can put this in your application / component / module that references the popup.

    <fx:Style>
            @namespace s library://ns.adobe.com/flex/spark;
            @namespace mx library://ns.adobe.com/flex/halo;
            global {
                modal-transparency: 1;
                modal-transparency-blur: 2;
                modal-transparency-color: #ff0000;
            }
    </fx:Style>