Flex 4 开发后台管理系统(2)
2014-03-22 21:16
351 查看
书接上回: /article/1665749.html
然后安装debug http://www.adobe.com/go/flashplayer_debugger
在最下面有针对IE的debug安装。并且把设置默认的浏览器是IE。
1,首先安装flash builder
/article/1665751.html然后安装debug http://www.adobe.com/go/flashplayer_debugger
在最下面有针对IE的debug安装。并且把设置默认的浏览器是IE。
2,功能实现
使用Tree 组件和SuperTabNavigator 组件:<s:Application xmlns:flexlib="http://code.google.com/p/flexlib/" xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600" creationComplete="initTabs()"> <fx:Declarations> <!-- 将非可视元素(例如服务、值对象)放在此处 --> <fx:XMLList id="treeData"> <node label="管理后台"> <node label="产品管理"> <node label="产品分类管理"/> <node label="产品管理"/> </node> <node label="地区管理"> <node label="省管理"/> <node label="市管理"/> <node label="县管理"/> </node> </node> </fx:XMLList> </fx:Declarations> <fx:Script> <![CDATA[ [Bindable] public var selectedNode:XML; import flexlib.controls.SuperTabBar; import flexlib.events.TabReorderEvent; import mx.controls.Label; import mx.containers.VBox; import mx.containers.Canvas; import flexlib.controls.tabBarClasses.SuperTab; import mx.containers.Panel; [Embed(source="../assets/document.png")] private var document_icon:Class; [Embed(source="../assets/home.png")] private var home_icon:Class; [Embed(source="../assets/closeButton.png")] private var close_icon:Class; private function initTabs():void { addTab("Home", nav, "This tab can't be closed", home_icon); for (var i:int = 0; i < 3; i++) { addTab("Tab " + (i + 1), nav); } callLater(initNonClosableTab); } private function initNonClosableTab():void { nav.setClosePolicyForTab(0, SuperTab.CLOSE_NEVER); } private function addTab(lbl:String, navigator:SuperTabNavigator, contentString:String=null, icon:Class= null):void { if (lbl == "") lbl = "(Untitled)"; var curNum:Number = nav.numChildren + 1; var child:VBox = new VBox(); child.setStyle("closable", true); child.label = lbl; if (icon) { child.icon = icon; } else { child.icon = document_icon; } var label:Label = new Label(); label.text = contentString == null ? "Content for: " + lbl : contentString; child.addChild(label); navigator.addChild(child); } /* The following two functions are a bit of a hack to try to get the * tab navigator to refresh the display and resize all the tabs. When * you change stuff like tabWidth (which is a style) then the tab * navigator has a hard time re-laying out the tabs. Adding and * removing a child can sometimes trigger it to re-layout the tabs. * I don't know, but just don't change tabWdith or horizontalGap or whatever * else at runtime, OK? Pick some values and stick with them. */ private function invalidateLater():void { var child:Canvas = new Canvas(); nav.addChild(child); nav.removeChild(child); callLater(invalidateNav); callLater(invalidateNav); } private function invalidateNav():void { nav.invalidateDisplayList(); } private function tabsReordered(event:TabReorderEvent):void { var tabBar:SuperTabBar = event.currentTarget as SuperTabBar; tabBar.setChildIndex(tabBar.getChildAt(event.oldIndex), event.newIndex); } // Event handler for the Tree control change event. public function treeChanged(event:Event):void { selectedNode=Tree(event.target).selectedItem as XML; } ]]> </fx:Script> <mx:Panel width="100%" height="100%" paddingBottom="5" paddingLeft="5" paddingRight="5" paddingTop="10" title="产品管理后台"> <mx:HDividedBox width="100%" height="100%"> <mx:Tree id="myTree" width="15%" height="100%" change="treeChanged(event)" dataProvider="{treeData}" labelField="@label" showRoot="false"/> <!--<mx:TextArea width="85%" height="100%" text="Selected Item: {selectedNode.@label}"/>--> <flexlib:SuperTabNavigator id="nav" width="85%" height="100%" closePolicy="{SuperTab.CLOSE_ROLLOVER}" horizontalGap="0" scrollSpeed="25" startScrollingEvent="{MouseEvent.MOUSE_DOWN}" stopScrollingEvent="{MouseEvent.MOUSE_UP}"/> </mx:HDividedBox> </mx:Panel> </s:Application>
相关文章推荐
- Flex 4 开发后台管理系统(2)
- 应该记住的flex开发快捷键
- Flex 开发入门
- FLEX 与现有开发语言的通信全面解析
- Flex开发实例教程-Mp3播放器
- 关于MyEclipse和flex的集成开发的配置补充
- 基于RIA Flex Flash 平台开发的进销存企业信息管理系统开发经验
- Flex开发流程设计器的经验之谈(4)
- flex 和java 一起开发.实验远程调用.
- Flex 开发gSOAP的客服端
- Flex开发环境的配置
- 使用FLEX和Actionscript开发FLASH 游戏-使用输入和动态背景
- FlashDevelop 3.3.4 + Flex SDK 4 开发环境配置
- arcgis api for flex 开发入门(六)identify
- 一步一步使用Ext JS MVC与Asp.Net MVC 3开发简单的CMS后台管理系统之创建输出验证码图片的控制器
- Flex 开发笔记1——走进Flex
- IntelliJ IDEA支持Flex开发
- Flex开发框架cairngorm 入门级别的理解
- flex 开发项目报错之404错误解决方案
- Flex和.NET协同开发利器FluorineFx--部署