在 FLEX 3.0 中创建弹出窗口

发布于 2024-12-28 05:10:09 字数 3504 浏览 5 评论 0原文

我创建了一个自定义组件扩展 Canvas 的弹出窗口,我希望画布的外观与图像中显示的类似。是否有任何想法如何创建类似的弹出窗口。 在此处输入图像描述

这里我给你示例到目前为止我已经完成的代码...

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="550" height="350" backgroundAlpha="0">
<mx:Script>
    <![CDATA[
        import mx.managers.PopUpManager;

        public function btnImage_click():void
        {
            PopUpManager.removePopUp(this);
        }

    ]]>
</mx:Script>
<mx:Image source="Images/close.png" top="4" left="500" useHandCursor="true" buttonMode="true" click="{btnImage_click();}" />
<mx:Fade id="fadeIn" duration="700" alphaFrom="0.0" alphaTo="1.0"/>
<mx:VBox height="100%" width="100%" horizontalAlign="center" verticalAlign="middle">
    <mx:Canvas height="85%" width="90%" backgroundColor="#ffffff" backgroundAlpha="1" >
        <mx:VBox height="100%" width="100%">
            <mx:HBox height="70%" width="100%" horizontalAlign="center" verticalAlign="middle">
                <mx:Image id="btnPrevious" source="Images/previous.png" 
                    click="{vsSubImages.selectedIndex--}" enabled="{vsSubImages.selectedIndex!=0}"/>
                <mx:ViewStack height="100%" width="90%" creationPolicy="all" id="vsSubImages">
                    <mx:VBox height="100%" width="100%" horizontalAlign="center" verticalAlign="middle" showEffect="{fadeIn}">
                        <mx:Image id="img1" maintainAspectRatio="true" height="100%" width="100%" horizontalAlign="center" verticalAlign="middle" />    
                    </mx:VBox>                  
                    <mx:VBox height="100%" width="100%" horizontalAlign="center" verticalAlign="middle" showEffect="{fadeIn}">
                        <mx:Image id="img2" maintainAspectRatio="true" height="100%" width="100%" horizontalAlign="center" verticalAlign="middle" />    
                    </mx:VBox>                  
                    <mx:VBox height="100%" width="100%" horizontalAlign="center" verticalAlign="middle" showEffect="{fadeIn}">
                        <mx:Image id="img3" maintainAspectRatio="true" height="100%" width="100%" horizontalAlign="center" verticalAlign="middle" />    
                    </mx:VBox>                  
                </mx:ViewStack>
                <mx:Image id="btnNext" source="Images/next.png" 
                    click="{vsSubImages.selectedIndex++}" enabled="{vsSubImages.selectedIndex!=2}" />
            </mx:HBox>
            <mx:Box height="30%" width="100%" horizontalAlign="right" verticalAlign="top">
                <mx:Form height="100%" width="100%">
                    <mx:FormItem label="Project Name : " >
                        <mx:Label id="lblName" />
                    </mx:FormItem>
                    <mx:FormItem label="Description : " >
                        <mx:Label id="lblDescription" />
                    </mx:FormItem>
                    <mx:FormItem label="Technology Name : " >
                        <mx:Label id="lblTechnology" />
                    </mx:FormItem>
                </mx:Form>
            </mx:Box>
        </mx:VBox>
    </mx:Canvas>
</mx:VBox>
</mx:Canvas>

主要思想是在画布上显示关闭按钮,目前我正在画布后面。 请帮我。

I have created a Popup that is custom component extends Canvas i want the look of the canvas is similar like that showed in image. is there any idea that how to create a pop up similar like that.enter image description here

Here i am giving you the sample code that i have done till now...

<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="550" height="350" backgroundAlpha="0">
<mx:Script>
    <![CDATA[
        import mx.managers.PopUpManager;

        public function btnImage_click():void
        {
            PopUpManager.removePopUp(this);
        }

    ]]>
</mx:Script>
<mx:Image source="Images/close.png" top="4" left="500" useHandCursor="true" buttonMode="true" click="{btnImage_click();}" />
<mx:Fade id="fadeIn" duration="700" alphaFrom="0.0" alphaTo="1.0"/>
<mx:VBox height="100%" width="100%" horizontalAlign="center" verticalAlign="middle">
    <mx:Canvas height="85%" width="90%" backgroundColor="#ffffff" backgroundAlpha="1" >
        <mx:VBox height="100%" width="100%">
            <mx:HBox height="70%" width="100%" horizontalAlign="center" verticalAlign="middle">
                <mx:Image id="btnPrevious" source="Images/previous.png" 
                    click="{vsSubImages.selectedIndex--}" enabled="{vsSubImages.selectedIndex!=0}"/>
                <mx:ViewStack height="100%" width="90%" creationPolicy="all" id="vsSubImages">
                    <mx:VBox height="100%" width="100%" horizontalAlign="center" verticalAlign="middle" showEffect="{fadeIn}">
                        <mx:Image id="img1" maintainAspectRatio="true" height="100%" width="100%" horizontalAlign="center" verticalAlign="middle" />    
                    </mx:VBox>                  
                    <mx:VBox height="100%" width="100%" horizontalAlign="center" verticalAlign="middle" showEffect="{fadeIn}">
                        <mx:Image id="img2" maintainAspectRatio="true" height="100%" width="100%" horizontalAlign="center" verticalAlign="middle" />    
                    </mx:VBox>                  
                    <mx:VBox height="100%" width="100%" horizontalAlign="center" verticalAlign="middle" showEffect="{fadeIn}">
                        <mx:Image id="img3" maintainAspectRatio="true" height="100%" width="100%" horizontalAlign="center" verticalAlign="middle" />    
                    </mx:VBox>                  
                </mx:ViewStack>
                <mx:Image id="btnNext" source="Images/next.png" 
                    click="{vsSubImages.selectedIndex++}" enabled="{vsSubImages.selectedIndex!=2}" />
            </mx:HBox>
            <mx:Box height="30%" width="100%" horizontalAlign="right" verticalAlign="top">
                <mx:Form height="100%" width="100%">
                    <mx:FormItem label="Project Name : " >
                        <mx:Label id="lblName" />
                    </mx:FormItem>
                    <mx:FormItem label="Description : " >
                        <mx:Label id="lblDescription" />
                    </mx:FormItem>
                    <mx:FormItem label="Technology Name : " >
                        <mx:Label id="lblTechnology" />
                    </mx:FormItem>
                </mx:Form>
            </mx:Box>
        </mx:VBox>
    </mx:Canvas>
</mx:VBox>
</mx:Canvas>

The main idea is to show the close button on the Canvas currently i am getting that behind the Canvas.
Please Help me.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

白衬杉格子梦 2025-01-04 05:10:09

标记位于代码最底部的最后一个 标记之前。因为画布的行为就像最后一个位于 z 索引的最顶部。

Put the <mx:Image source="Images/close.png" top="4" left="500" useHandCursor="true" buttonMode="true" click="{btnImage_click();}" /> tag at the very bottom of the code before last </mx:Canvas> tag. Because canvas behaves like last is at the very top in the z-index.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文