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>
运行效果
垂直布局与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>
<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>
本文出自 “阿凡达” 博客,请务必保留此出处http://shamrock.blog.51cto.com/2079212/1533063
Flex入门笔记的更多相关文章
- 每天成长一点---WEB前端学习入门笔记
WEB前端学习入门笔记 从今天开始,本人就要学习WEB前端了. 经过老师的建议,说到他每天都会记录下来新的知识点,每天都是在围绕着这些问题来度过,很有必要每天抽出半个小时来写一个知识总结,及时对一天工 ...
- ES6入门笔记
ES6入门笔记 02 Let&Const.md 增加了块级作用域. 常量 避免了变量提升 03 变量的解构赋值.md var [a, b, c] = [1, 2, 3]; var [[a,d] ...
- [Java入门笔记] 面向对象编程基础(二):方法详解
什么是方法? 简介 在上一篇的blog中,我们知道了方法是类中的一个组成部分,是类或对象的行为特征的抽象. 无论是从语法和功能上来看,方法都有点类似与函数.但是,方法与传统的函数还是有着不同之处: 在 ...
- React.js入门笔记
# React.js入门笔记 核心提示 这是本人学习react.js的第一篇入门笔记,估计也会是该系列涵盖内容最多的笔记,主要内容来自英文官方文档的快速上手部分和阮一峰博客教程.当然,还有我自己尝试的 ...
- redis入门笔记(2)
redis入门笔记(2) 上篇文章介绍了redis的基本情况和支持的数据类型,本篇文章将介绍redis持久化.主从复制.简单的事务支持及发布订阅功能. 持久化 •redis是一个支持持久化的内存数据库 ...
- redis入门笔记(1)
redis入门笔记(1) 1. Redis 简介 •Redis是一款开源的.高性能的键-值存储(key-value store).它常被称作是一款数据结构服务器(data structure serv ...
- OpenGLES入门笔记四
原文参考地址:http://www.cnblogs.com/zilongshanren/archive/2011/08/08/2131019.html 一.编译Vertex Shaders和Fragm ...
- OpenGLES入门笔记三
在入门笔记一中比较详细的介绍了顶点着色器和片面着色器. 在入门笔记二中讲解了简单的创建OpenGL场景流程的实现,但是如果在场景中渲染任何一种几何图形,还是需要入门笔记一中的知识:Vertex Sha ...
- unity入门笔记
我于2010年4月1日硕士毕业加入完美时空, 至今5年整.刚刚从一家公司的微端(就是端游技术+页游思想, 具体点就是c++开发, directX渲染, 资源采取所需才会下载)项目的前端主程职位离职, ...
随机推荐
- C++ 序列式容器之vector
什么是容器 容器,顾名思义,是用来容放东西的场所.C++容器容放某种数据结构,以利于对数据的搜寻或排序或其他特殊目的.众所周知,常用的数据结构不外乎:数组array, 链表list, 树tree ...
- 【BZOJ-1103】大都市meg 树状数组 + DFS序
1103: [POI2007]大都市meg Time Limit: 10 Sec Memory Limit: 162 MBSubmit: 2009 Solved: 1056[Submit][Sta ...
- 【BZOJ-4592】脑洞治疗仪 线段树
4592: [Shoi2015]脑洞治疗仪 Time Limit: 20 Sec Memory Limit: 256 MBSubmit: 69 Solved: 38[Submit][Status] ...
- jdbc实现事务
//conn需要自己获取,这里我用的时springjdbcTemplate Connection conn = null; PreparedStatement pstm = null; try { c ...
- 网易免费/付费163企业邮smtp服务器地址
免费:smtp.ym.163.com 25/pop.ym.163.com 110 付费:smtp.qiye.163.com 25/pop.qiye.163.com 110
- C#的图像处理方法--(作者:http://conner-wang.spaces.live.com转载)
使用C#进行图像处理的几种方法 本文讨论了C#图像处理中Bitmap类.BitmapData类和unsafe代码的使用以及字节对齐问题. Bitmap类 命名空间:System.Drawing 封装 ...
- Google Guava vs Apache Commons for Argument Validation
It is an established good practice to validate method arguments at the beginning of the method body. ...
- 解决Cookie乱码问题
写了一个cookie的定义和获取,结果我输入中文后,页面报错 报错信息如下: type Exception report message An exception occurred processin ...
- 打包jar文件 外部调用资源 so等
一个非常好的从jar文件中加载so动态库方法,在android的gif支持开源中用到.这个项目的gif解码是用jni c实现的,避免了OOM等问题. 项目地址:https://github.com/k ...
- Tomcat_Java Web_内存溢出总结
在抛出内存溢出错误的时候,一般都会提示内存泄露的种类,一般也都是按照区域进行划分: 1. 堆(heap)内存泄漏java.lang.OutOfMemoryError: Javaheap space:大 ...