ssc
接了一个ssc的小项目,却因为对方的不作答而半途而废。我写了一天的代码算是废了。
主程序
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="init()"
width="" height="" xmlns:cc="*"> <mx:Script>
<![CDATA[
import com.adobe.serialization.json.JSON;
import mx.controls.Alert;
import mx.formatters.DateFormatter; [Bindable]
public var t1:int;
[Bindable]
public var t2:int;
[Bindable]
public var t3:int;
[Bindable]
public var t4:int; [Bindable]
public var now:Date; [Bindable]
public var balls:Array = []; public static var INTERVAL:int = *; public static var BALL_COUNT:int = ; public var count:int; public function init():void { now = new Date();
var timer:Timer = new Timer();
timer.addEventListener(TimerEvent.TIMER, onTimer);
timer.start(); var ss:String = JSON.encode(null);
//getBalls(); var obj:Object = {};
obj.a = ;
obj.b = "asdf";
Alert.show(obj+"");
var xx:XML = <asfasf/>
xx.appendChild(obj);
Alert.show(xx.toXMLString()); } public function getBalls():void {
var center:Point = new Point(ballbox.width/, ballbox.height/-);
var radis:Number = ballbox.width/ - ;
trace(radis + " / " + ballbox.width/);
for(var i:int=;i<=BALL_COUNT;i++) {
balls[i] = (int)(Math.random()*);
trace(balls[i]); var btn:Button = new Button();
btn.width = ;
btn.height = ;
btn.setStyle("cornerRadius", );
btn.label = balls[i]+"";
btn.x = radis*Math.sin(*i/(BALL_COUNT-)) + center.x;
btn.y = radis*Math.cos(*i/(BALL_COUNT-)) + center.y;
ballbox.addChild(btn); trace("" + btn.x + " / " + btn.y);
} } public function onTimer(e:TimerEvent):void {
count ++;
if(count == INTERVAL) {
count = ;
t1 = ;
t2 = ;
t1 = ;
t2 = ;
// lottery
Alert.show("开奖了!");
}
var left:int = INTERVAL - count;
var minutes:int = left/;
var seconds:int = left%;
if(minutes>=) {
t1 = ;
t2 = ;
} else {
t1 = ;
t2 = minutes;
}
if(seconds>=) {
t3 = seconds/;
t4 = seconds%;
} else {
t3 = ;
t4 = seconds;
} } ]]>
</mx:Script>
<mx:Panel title="欢迎光临本店" width="100%" height="100%">
<mx:Button color="red" label=""/>
<mx:HBox horizontalAlign="right" width="100%">
<mx:Text text="距离本期销售截止,还有"/>
<mx:Button id="n1" label="{t1}" fontSize="" fontWeight="bold"/>
<mx:Button id="n2" label="{t2}" fontSize="" fontWeight="bold"/>
<mx:Text text="分"/>
<mx:Button id="n3" label="{t3}" fontSize="" fontWeight="bold"/>
<mx:Button id="n4" label="{t4}" fontSize="" fontWeight="bold"/>
<mx:Text text="秒"/>
</mx:HBox> <mx:Canvas id="ballbox" height="100%" width="100%">
</mx:Canvas> </mx:Panel>
<mx:HBox x="" y="" horizontalGap="">
<cc:RollableBall2 cW="" cH=""/>
<cc:RollableBall2 cW="" cH=""/>
<cc:RollableBall2 cW="" cH=""/>
<cc:RollableBall2 cW="" cH=""/>
<cc:RollableBall2 cW="" cH=""/>
</mx:HBox> <mx:HBox x="" y="" horizontalGap="">
<cc:RollableBall3 cW="" cH=""/>
<cc:RollableBall3 cW="" cH=""/>
<cc:RollableBall3 cW="" cH=""/>
<cc:RollableBall3 cW="" cH=""/>
<cc:RollableBall3 cW="" cH=""/>
</mx:HBox>
</mx:Application>
按钮控件
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="{this.cW}" height="{this.cH}" creationComplete="init()"
horizontalScrollPolicy="off" verticalScrollPolicy="off" fontSize="{this.cW/3}" fontWeight="bold" fontThickness="{this.cW/20}"
borderThickness="" borderColor="blue" borderStyle="outset"> <mx:Script>
<![CDATA[
import flash.utils.setTimeout;
import mx.controls.Button; public var TOTAL_INTERVAL:int = *; public var interval:int = ; public static var ROLL_COUNT:int = ; public var count:int = ; public var ecliipsedTime:int = ; public var y1:int = ;
public var y2:int = -; public var btn1:Button = new Button();
public var btn2:Button = new Button(); [Bindable]
public var cW:int;
[Bindable]
public var cH:int; public function init():void {
btn1.label = (int)(Math.random()*);
btn1.width = cW;
btn1.height = cH;
//btn1.setStyle("fontSize", 20);
btn2.label = (int)(Math.random()*);
btn2.width = cW;
btn2.height = cH;
btn2.y = -cH;
//btn2.setStyle("fontSize", 20);
this.addChild(btn1);
this.addChild(btn2);
start();
} public function start():void {
var delay:int = (int)(Math.random()*);
var t:Timer = new Timer(delay, );
t.addEventListener(TimerEvent.TIMER, doStart);
t.start();
} public function doStart(e:TimerEvent):void { goTimer();
} public function goTimer():void { flash.utils.setTimeout(function():void{
//Alert.show("sleep test ok");
onTimer();
},interval,null);
} public function newBtn():Button {
return null;
} // 开始滚动的时候要慢, 快要停止id时候也要慢!
public function onTimer():void {
ecliipsedTime += interval;
count ++; if(count>=ROLL_COUNT*/) {
interval += Math.random()*;
} // if(count>=ROLL_COUNT*9/10) {
// interval += 100;
// }
// if(count>=ROLL_COUNT*29/30) {
// interval += 200;
// }
// if(count>=ROLL_COUNT*49/50) {
// interval += 500;
// } // if(TOTAL_INTERVAL-ecliipsedTime<=1) {
// interval += 20;
// } if(count>ROLL_COUNT) {
return;
} y1 += ;
if(y1>=cH) {
y1 = -;
btn1.label = (int)(Math.random()*);
}
btn1.y = y1; y2 += ;
if(y2>=cH) {
y2 = -;
btn2.label = (int)(Math.random()*);
}
btn2.y = y2; goTimer();
} ]]>
</mx:Script>
</mx:Canvas>
按钮控件
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="{this.cW}" height="{this.cH*3}" creationComplete="init()"
horizontalScrollPolicy="off" verticalScrollPolicy="off" fontSize="{this.cW/3}" fontWeight="normal" fontThickness="{this.cW/20}"
borderThickness="" borderColor="blue" borderStyle="outset"> <mx:Script>
<![CDATA[
import flash.utils.setTimeout;
import mx.controls.Button; public var TOTAL_INTERVAL:int = *; public var interval:int = ; public static var ROLL_COUNT:int = ; public var count:int = ; public var ecliipsedTime:int = ; public var y1:int;
public var y2:int;
public var y3:int;
public var y4:int; public var btn1:Button = new Button();
public var btn2:Button = new Button();
public var btn3:Button = new Button();
public var btn4:Button = new Button(); [Bindable]
public var cW:int;// button 宽度
[Bindable]
public var cH:int;// button 高度 public function init():void { y1 = ;
y2 = cH*;
y3 = cH*;
y4 = -cH; btn1.label = (int)(Math.random()*);
btn1.width = cW;
btn1.height = cH;
btn1.y = y1;
//btn1.setStyle("fontSize", 20);
this.addChild(btn1);
btn2.label = (int)(Math.random()*);
btn2.width = cW;
btn2.height = cH;
btn2.y = y2;
this.addChild(btn2);
btn3.label = (int)(Math.random()*);
btn3.width = cW;
btn3.height = cH;
btn3.y = y3;
this.addChild(btn3);
btn4.label = (int)(Math.random()*);
btn4.width = cW;
btn4.height = cH;
btn4.y = y4;
this.addChild(btn4); start();
} public function start():void {
var delay:int = (int)(Math.random()*);
var t:Timer = new Timer(delay, );
t.addEventListener(TimerEvent.TIMER, doStart);
t.start();
} public function doStart(e:TimerEvent):void { goTimer();
} public function goTimer():void { flash.utils.setTimeout(function():void{
//Alert.show("sleep test ok");
onTimer();
},interval,null);
} public function newBtn():Button {
return null;
} public function onTimer():void {
ecliipsedTime += interval;
count ++; // if(count>=ROLL_COUNT*9/10) {
// interval += Math.random()*100;
// } // if(count>=ROLL_COUNT*9/10) {
// interval += 100;
// }
// if(count>=ROLL_COUNT*29/30) {
// interval += 200;
// }
// if(count>=ROLL_COUNT*49/50) {
// interval += 500;
// } // if(TOTAL_INTERVAL-ecliipsedTime<=1) {
// interval += 20;
// } if(count>ROLL_COUNT) {
btn2.setStyle("fontWight", "bold");
btn2.setStyle("fontSize", this.cW/);
btn2.setStyle("color", "red");
btn2.setStyle("fontThickness", this.cW/); btn2.invalidateProperties();
btn2.invalidateSize();
btn2.invalidateDisplayList();
return;
} y1 += ;
if(y1>=cH*) {
y1 = -cH;
btn1.label = (int)(Math.random()*);
}
btn1.y = y1; y2 += ;
if(y2>=cH*) {
y2 = -cH;
btn2.label = (int)(Math.random()*);
}
btn2.y = y2; y3 += ;
if(y3>=cH*) {
y3 = -cH;
btn3.label = (int)(Math.random()*);
}
btn3.y = y3; y4 += ;
if(y4>=cH*) {
y4 = -cH;
btn4.label = (int)(Math.random()*);
}
btn4.y = y4; goTimer();
} ]]>
</mx:Script>
</mx:Canvas>
ssc的更多相关文章
- 【转】一篇文章读懂人力资源三支柱体系(COE・BP・SSC)
通过人力资源转型,提升效率和效能 作者:Sharon Li,翰威特大中华区咨询总监. 杰克韦尔奇曾说过“人力资源负责人在任何企业中都应该是第二号人物”,但在中国,99%的企业都做不到.原因很简单, ...
- “智慧海绵城市”(SSC)监测评价体系整体解决方案
一.方案简介 无论是内涝防治.黑臭水体治理,还是海绵城市规划设计及建设.评估,乃至未来智慧城市的建设,都需要有全面.致密.大量的城市水文监测数据和先进模拟仿真技术作基础支撑,唯有如此,决策才有据可依, ...
- [ssc] 数据库管理工具——SQuirreL SQL Client使用入门
简单介绍: SQuirrel SQL Client是一个用Java写的数据库客户端,用JDBC统一数据库访问接口以后,可以通过一个统一的用户界面来操作MySQL PostgreSQL MSSQL Or ...
- 重庆/北京/江苏KS/快乐时时/七星/福运来菠菜电商开奖修复APP网站SSC网站程序开发php
网站制作是指使用标识语言(markup language),通过一系列设计.建模.和执行的过程将电子格式的信息通过互联网传输,最终以图形用户界面(GUI)的形式被用户所浏览.简单来说,网页设计的目的就 ...
- ssc项目Python爬虫心得
###今日心得 ####time.datetime 1.字符串格式到标准化格式:time.strptime(str, "%Y%m%d") 2.今天的标准化格式:today = da ...
- Spark踩坑记——Spark Streaming+Kafka
[TOC] 前言 在WeTest舆情项目中,需要对每天千万级的游戏评论信息进行词频统计,在生产者一端,我们将数据按照每天的拉取时间存入了Kafka当中,而在消费者一端,我们利用了spark strea ...
- 从netty-example分析Netty组件
分析netty从源码开始 准备工作: 1.下载源代码:https://github.com/netty/netty.git 我下载的版本为4.1 2. eclipse导入maven工程. netty提 ...
- Java中的Socket的用法
Java中的Socket的用法 Java中的Socket分为普通的Socket和NioSocket. 普通Socket的用法 Java中的 ...
- Java I/O and NIO [reproduced]
Java I/O and NIO.2---Five ways to maximize Java NIO and NIO.2---Build more responsive Java applicati ...
随机推荐
- C语言之数组,字符串,指针
一. 数组的定义 1. 数组初始化 初始化方式 int a[3] = {10, 9, 6}; int a[3] = {10,9}; int a[] = {11, 7, 6}; int a[4] = ...
- 【转】 71道经典Android面试题和答案,重要知识点都包含了
,,面试题1. 下列哪些语句关于内存回收的说明是正确的? (b ) A. 程序员必须创建一个线程来释放内存 B.内存回收程序负责释放无用内存 C.内存回收程序允许程序员直接释放内存 ...
- js 常见混乱
slice(begin.end) 复制出一个新的数组或是一个新的字符串,其中end 不包括end本身 splice(begin,howmany,item1....itemn) 更改原先的array 会 ...
- c++ chap1 to chap 3
#ifndef MAIN_H_INCLUDED#define MAIN_H_INCLUDED struct Course{ int id; std::string name;}; const int ...
- redis客户端连接异常
本文参考:http://mdba.cn/2015/04/02/redistwemproxy-%e5%ae%a2%e6%88%b7%e7%ab%af%e8%bf%9e%e6%8e%a5%e5%bc%82 ...
- easyui datagrid中关联combox
datagrid中列上关联combobox{ field: 'SysCode', title: '系统代码', width: 150, align: 'left', editor: { type: ' ...
- 了解及使用IPV6
1. 什么是 IPv6 IPv6指互联网协议(IP)第6版.目前大家上网主要使用互联网协议第四版,即IPv4. 在全球互联网高度发展的今天,IPv4 地址资源已经枯竭,互联网正在经历从IPv4网络向I ...
- rails4.2~devise邮箱测试
1.由于网站无需验证,只需一封欢迎邮件,在config/intiailzers/devise.rb里面配置 config.allow_unconfirmed_access_for = nil #2.d ...
- Bootstrap的安装
在了解了HTML和CSS.JS之后,我咨询了之前做过这一块的学长,得知了Bootstrap的存在. Bootstrap (Web前端CSS框架) Bootstrap,来自 Twitter,是目前很受欢 ...
- ok
第一个姑娘该是个爱你的人,出现在你没法区分爱和饥渴的时候.那时候你还在青春期的尾巴上,满脑子的性冲动混合着韩剧爱情幻想.你自尊脆弱而又怯懦无助,随便抓住哪一根稻草都当是救命的灵药. 她也许相貌平平,但 ...