• Adobe Flex迷你教程 — 实现类似新浪微博评论消息容器


           今晚刷微博的时候,发现新浪微博的评论容器挺好玩的,上面有个小三角,用来指示这条评论是上面那条微博的。

    正好,在做网络监控的时候,点击一个物理机,底下也可以出现像新浪微博评论这样的容器,用来装这个物理机下面所有

    的虚拟机。家里停电了,就来朋友公司简单的写了个demo,欢迎各位朋友给出不同意见。

    运行后效果如下:

     主程序:  myApp.mxml

    <?xml version="1.0" encoding="utf-8"?>
    <!-- 
    * Created with IntelliJ IDEA.
    * User: DongYang
    * Date: 13-3-23
    * Time: 下午9:45
    * Progress every day a little more -->
    <s:Application 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" xmlns:item="item.*">
    
    <item:MySkinnable width="242" height="131" x="100" y="100">
        <s:Label x="31" y="51" width="214" height="34" fontSize="32" fontStyle="italic" fontWeight="bold"
                 text="I Love You!"/>
    </item:MySkinnable>
    </s:Application>

    容器:item/MySkinnable.as

    /**
     * Created with IntelliJ IDEA.
     * User: DongYang
     * Date: 13-3-23
     * Time: 下午9:41
     * Progress every day a little more.
     */
    package item
    {
        import spark.components.SkinnableContainer;
        
        public class MySkinnable extends SkinnableContainer
        {
            public function MySkinnable()
            {
                super();
            }
            
            override protected function updateDisplayList(unscaledWidth:Number, unscaledHeight:Number):void
            {
                this.graphics.clear();
                this.graphics.lineStyle(2,0xeff8fe,1);
                this.graphics.beginFill(0xADFF2F,1);
                this.graphics.moveTo(0,0);
                this.graphics.lineTo(20,0);
                this.graphics.lineTo(28,-8);
                this.graphics.lineTo(38,0);
                this.graphics.lineTo(width,0);
                this.graphics.lineTo(width,height);
                this.graphics.lineTo(0,height);
                this.graphics.lineTo(0,0);
                this.graphics.endFill();
                super.updateDisplayList(unscaledWidth, unscaledHeight);
            }
            
            
        }
    }
  • 相关阅读:
    Java程序开发必备的6种知识
    Java技术在多数据库系统中的应用研究
    解决J2EE系统应用性能问题常用方法
    在Java中如何跳出当前的多重嵌套循环?
    Java学习是由简入难的学习过程
    浅谈Java SE、Java EE、Java ME三者的区别
    J2ee的学习方法及步骤摘要
    IOS 使用GCD改善性能
    IOS Cell重用机制
    BUG--tomcat更改目录失败
  • 原文地址:https://www.cnblogs.com/yangpigao/p/2977792.html
Copyright © 2020-2023  润新知