多视图切换简单应用—Accordion折叠视图组件

Categories: Flex; Tagged with: ; @ October 12th, 2008 13:38

Accordion继承自Container,可以实现视图折叠显示的功能.可直接现实内容信息或提供交互操作视图.各子容器之间的关系是并列的. 可以通过Accordion提供的折叠导航按钮来控制视图间的切换.

		
				
						
								
						
						
						
						
						
							
						
				
				
						
				
		

效果如下:

image

多视图切换简单应用–使用TabNavigator Use TabNavigator In Flex

Categories: Flex; Tagged with: ; @ October 12th, 2008 12:22
		
				
						
						
						
						
						
						
						
						
						
				
		

效果:

image

多试图切换简单应用–使用ViewStack实现 User ViewStack in Flex

Categories: Flex; Tagged with: ; @ October 12th, 2008 12:16

ViewStack是由一些折叠起来的试图组成. ViewStack只提供折叠形式排列子容器.

	
		
		
			
			
			
			
		
		
			
		
		
		
		
		
		

	
	

在ViewStack中放置Canvas组件, 在点击Button的时候会选择制定的Canvas已完成操作.

效果:

image image

Flex中使用Alert提示用户选择 Use Alert in Flex

Categories: Flex; Tagged with: ; @ October 12th, 2008 12:02

在日常应用中,经常需要弹出一个Alert,提示用户进行选择. 如删除文件时提示用户是否确定删除,然后根据用户选择进行下一步操作:

应用举例:

AS代码:

		import mx.controls.Text;
		import mx.events.CloseEvent;
		import mx.controls.Alert;
		private function popAlert():void{
			Alert.yesLabel = "是";
			Alert.noLabel = "否";
			
			Alert.show("请选择是或者否","选择对话框",Alert.YES|Alert.NO,
			this,clickselectHandler,null,1);
		}
		
		private function clickselectHandler(event:CloseEvent):void{
			if (event.detail==Alert.YES){
			displaySelect_txt.text="选择了是";}
			else{
			
			displaySelect_txt.text="选择了否";}
		}

在MXML中使用上面的代码:

	
	

效果:

image image

Flex中弹出菜单使用 Use PopUpButton In Flex

Categories: Flex; Tagged with: ; @ October 12th, 2008 11:48

弹出菜单方式与下拉列表框[ComboBox]非常相似, 但PopUpButton是对button的扩展,而下拉列表框则用于列举出数据.

创建PopUpButton:

            import mx.controls.*;
            import mx.events.*;

            private var myMenu:Menu;

            // Initialize the Menu control, and specify it as the pop up object
            // of the PopUpButton control. 
            private function initMenu():void {
                myMenu = new Menu();
                var dp:Object = [{label: "New Folder"}, {label: "Sent Items"}, {label: "Inbox"}];        
                myMenu.dataProvider = dp;
                myMenu.selectedIndex = 0;       
                myMenu.addEventListener("itemClick", itemClickHandler);
                popB.popUp = myMenu;
                popB.label = "Put in: " + myMenu.dataProvider[myMenu.selectedIndex].label;
            }

            // Define the event listener for the Menu control's itemClick event. 
            private function itemClickHandler(event:MenuEvent):void {
                var label:String = event.item.label;        
                popTypeB.text=String("Moved to " + label);
                popB.label = "Put in: " + label;
                popB.close();
                myMenu.selectedIndex = event.index;
            }

在MXML中使用弹出菜单:

    

        
        
        
        
        
        
        

效果:
image

Newer Posts <-> Older Posts



// Proudly powered by Apache, PHP, MySQL, WordPress, Bootstrap, etc,.