zoukankan      html  css  js  c++  java
  • Flex入门笔记

    Test_01.mxml

    <?xml version="1.0" encoding="utf-8"?>
    
    <viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009"
    				   xmlns:s="library://ns.adobe.com/flex/spark"
    				   xmlns:mx="library://ns.adobe.com/flex/mx"
    				   xmlns:viewer="com.esri.viewer.*"
    				   xmlns:components="com.esri.viewer.components.*"
    				   widgetConfigLoaded="init()">
    	<fx:Script>
    		<![CDATA[
    			[Bindable]
    			//有了上面这句,text="{helloContent}"才能起作用
    			//this function called when the widget's configuration is loaded
    			private var helloContent:String;
    			
    			private function init():void
    			{
    				if (configXML) // checking for valid content in the configuration file
    				{
    					//读取配置文件
    					lbl.text = configXML.content || getDefaultString("helloContent");
    					helloContent = "你好你好!!!";
    //					lbl.text = "Success~~~~~~~~~~";
    //					lbl.text = getDefaultString("helloContent");
    				}
    			}
    			
    			protected function label1_clickHandler(event:MouseEvent):void
    			{
    				// TODO Auto-generated method stub
    				if(txt.text == ""){
    					txt.text = "God bless you!!";
    				}else{
    					txt.text = "";
    				}
    			}
    			
    		]]>
    	</fx:Script>
    	<viewer:WidgetTemplate id="helloWorld"
    						   width="557" height="419">
    		<viewer:layout>
    			<!--
    			<s:VerticalLayout horizontalAlign="center" verticalAlign="middle"/>
    			-->
    			<s:VerticalLayout horizontalAlign="left" verticalAlign="middle"/>
    			
    		</viewer:layout>
    		
    		<s:Label id="lbl"
    				 width="100%"
    				 fontSize="18"
    				 fontStyle="italic"
    				 fontWeight="bold"/>
    		<s:Label text="{helloContent}"/>
    		<s:Label id="txt"
    				 width="100%"
    				 fontSize="18"
    				 fontStyle="italic"
    				 fontWeight="bold"
    				 click="label1_clickHandler(event)"/>
    	</viewer:WidgetTemplate>
    </viewer:BaseWidget>

    Test_01.xml

    <configuration>
        <content>Hello World ! Successfully works!!!~~~@@@ </content>
    </configuration>

    运行效果

    wKiom1PZnSCzx7yjAAImLdHLp-g980.jpg



    垂直布局与Button

    	<viewer:WidgetTemplate id="test_02" width="300" height="200">
    		<s:Group>
    			<s:layout>
    				<s:VerticalLayout/>
    			</s:layout>
    			
    			<s:Button label="1"/>
    			<s:Button label="2"/>
    			<s:Button label="3"/>
    		</s:Group>
    	</viewer:WidgetTemplate>

    wKioL1PZrOeQP7XAAAEF1H3dhdY998.jpg

    <s:Button label="1"/><!-- Button大写表示Button是实例,label小写表示label是属性 -->
    <s:Button>
        <s:label>3</s:label>
    </s:Button><!-- 与上面的写法等价 -->


    滚动内容

    		<s:Scroller height="65">
    			<s:Group>
    				<s:layout>
    					<s:VerticalLayout/>
    				</s:layout>
    				
    				<s:Button label="1"/>
    				<s:Button label="2"/>
    				<s:Button label="3"/>
    			</s:Group>
    		</s:Scroller>

    wKioL1PZrqHwh-dCAACaZ0V-cwc439.jpg

    本文出自 “阿凡达” 博客,请务必保留此出处http://shamrock.blog.51cto.com/2079212/1533063

  • 相关阅读:
    让服务器可以下载apk和ipa文件
    MVC第一次访问比较慢的解决方案
    [C#]记录程序耗时的方法【转发】
    uploadify上传带参数及接收参数的方法
    uploadify上传之前判断一个input输入框是否为空
    jgGrid获得的id值是主键的id而不是jqGrid的行号值
    jqGrid删除多行数据问题
    Linux下的微秒级定时器: usleep, nanosleep, select, pselect
    Linux平台延时之sleep、usleep、nanosleep、select比较
    Linux 高精確的時序(sleep, usleep,nanosleep) from:http://blog.sina.com.cn/s/blog_533ab41c0100htae.html
  • 原文地址:https://www.cnblogs.com/umgsai/p/3908075.html
Copyright © 2011-2022 走看看