• Flex动态添加组件例子 Flex如何动态添加组件


     Flex动态添加组件例子 Flex如何动态添加组件
    Flex动态增加组件的例子,请复制代码运行查看效果,请注意背景颜色不能用vbox.backgroundColor = randColor 得到,要使用vbox.setStyle("backgroundColor", randColor);
    </mx:Application>
    Flash动画
    在线播放


    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="vertical"
    verticalAlign="middle"
    backgroundColor="white">

    <mx:Script>
    <![CDATA[
    import mx.containers.VBox;

    private function addAccordionChild():void {
    var vbox:VBox = new VBox();
    vbox.label = "child " + accordion.numChildren;
    vbox.percentWidth = 100;
    vbox.percentHeight = 100;
    var randColor:uint = Math.random() * 0xFFFFFF;
    vbox.setStyle("backgroundColor", randColor);
    accordion.addChild(vbox);
    }

    private function removeAccordionChild():void {
    if (accordion.selectedChild) {
    accordion.removeChild(accordion.selectedChild);
    }
    }
    ]]>
    </mx:Script>

    <mx:ApplicationControlBar dock="true">
    <mx:Button label="Add child"
    click="addAccordionChild();" />
    <mx:Button label="Remove Child"
    click="removeAccordionChild();" />
    </mx:ApplicationControlBar>

    <mx:Accordion id="accordion" width="250" height="100%" />

    原文地址:http://www.favzone.com/trackback.asp?tbID=70&amp;action=addtb&amp;tbKey=cf76b77765781061adaf58db8b4b9b39abe6e05b</textarea> 

  • 相关阅读:
    NGINX基本概念
    IP地址进制转换
    路由
    ip ,网段, 网关
    ipaddress模块
    第53课 被遗弃的多重继承(上)
    const static valitate 区别
    第49课 多态的概念和意义 (虚函数virtual)
    第75课 图的遍历(深度优先遍历DFS)
    第74课 图的遍历(广度优先遍历BFS)
  • 原文地址:https://www.cnblogs.com/zdcaolei/p/2405316.html
Copyright © 2020-2023  润新知