Flex3.0入门课程:定时器与字体下拉框

稿件来源: 阳光企业网站管理系统   撰稿作者: 太阳光   发表日期: 2013-09-16   阅读次数: 49   查看权限: 游客查看

Flex3.0入门课程:定时器与字体下拉框

time_button.mxml

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" fontSize="12" creationComplete="init()">
<mx:Script>
	<![CDATA[
		import mx.controls.Alert;
		import flash.events.TimerEvent;
		import flash.utils.Timer;
		private const WAIT_NUM_SECONDS:int = 5;
		private var timer:Timer;
		private function init():void
		{
			timer = new Timer(1000,WAIT_NUM_SECONDS);
			timer.addEventListener(TimerEvent.TIMER, onTimer);
			timer.start();
			okButton.enabled = false;
			okButton.label = okButton.data + "("+ WAIT_NUM_SECONDS +")";
		}
		private function onTimer(evt:TimerEvent):void
		{
			var count:int = timer.repeatCount - timer.currentCount;
			if(count > 0){
				okButton.label = okButton.data + "("+count+")";
			}else{
				okButton.enabled = true;
				okButton.label = okButton.data.toString();
			}
		}
		private function reg():void
		{
			Alert.show("注册成功!","系统提示");
		}
	]]>
</mx:Script>
	<mx:Panel width="300" height="200" layout="vertical" title="实现定时按钮" horizontalAlign="center">		
		<mx:ApplicationControlBar width="100%" dock="true">
			<mx:Button label="重置" click="init()"/>
		</mx:ApplicationControlBar>
		<mx:TextArea width="98%" height="70" text="用户注册需知00000"/>	
		<mx:Button id="okButton" data="我已经阅读了" click="reg();" width="150" height="30"/>
	</mx:Panel>
	
	<mx:ArrayCollection id="arrColl" source="{Font.enumerateFonts(true)}">
		<mx:sort>
			<mx:Sort>
				<mx:fields>
					<mx:SortField name="fontName"/>
				</mx:fields>
			</mx:Sort>
		</mx:sort>
	</mx:ArrayCollection>
	<mx:Panel width="300" height="200" layout="vertical" title=" 实现字体下拉框" horizontalAlign="center">
		<mx:Label text="字体下拉框ComboBox" paddingTop="20" fontSize="20" id="label1"/>
		<mx:ComboBox width="160" id="comboBox" dataProvider="{arrColl}"
			labelField="fontName" fontSize="14"
			change="label1.setStyle('fontFamily',comboBox.selectedLabel);"
			open="comboBox.dropdown.variableRowHeight=true;">
			<mx:itemRenderer>
				<mx:Component>
					<mx:Label fontFamily="{data.fonName}"
						toolTip="{data.fontName}" />
				</mx:Component>
			</mx:itemRenderer>
		</mx:ComboBox>
		<mx:HSlider minimum="8" maximum="30" width="160" id="tt" change="label1.setStyle('fontSize',tt.value)" enabled="true" liveDragging="false" snapInterval="0"/>
	</mx:Panel>	
</mx:Application>

 

关键词: Flex3.0,入门课程,定时器   编辑时间: 2013-09-16 14:55:41

  • 感到高兴

    0

    高兴
  • 感到支持

    0

    支持
  • 感到搞笑

    0

    搞笑
  • 感到不解

    0

    不解
  • 感到谎言

    0

    谎言
  • 感到枪稿

    0

    枪稿
  • 感到震惊

    0

    震惊
  • 感到无奈

    0

    无奈
  • 感到无聊

    0

    无聊
  • 感到反对

    0

    反对
  • 感到愤怒

    0

    愤怒
0%(0)
0%(0)
共有0 条评论 发言请遵守【相关规定

网友评论

会员头像
发 表同步腾讯微博    验证码:  点击更新请先登陆
  • 暂无评论
关闭模块文章图片 article Pictrue
  • 我的妈妈爸爸
  • 基于koa2+mysql+vue2.0+Element阳光内容管理系统
  • 代码覆盖率工具 Istanbul 入门教程
  • 全栈工程师的武器——MEAN
  • 9款超炫的 CSS3 复选框(Checkbox)
  • 微信开发在线翻译功能
  • CSS3那些不为人知的高级属性
  • 给easyui的datebox添加清空事件
  • flash写字效果
  • kendoUI系列教程之DropDownList下拉菜单
  • kendoUI系列教程之datetimepicker日期时间选择
  • kendoUI系列教程之datepicker日期选择
  • kendoUI系列教程之combobox下拉列表框
  • kendoUI系列教程之colorpicker
  • kendoUI系列教程之calendar日历表
  • kendoUI系列教程之autocomplete自动补齐