接了一个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的更多相关文章

  1. 【转】一篇文章读懂人力资源三支柱体系(COE・BP・SSC)

    通过人力资源转型,提升效率和效能   作者:Sharon Li,翰威特大中华区咨询总监. 杰克韦尔奇曾说过“人力资源负责人在任何企业中都应该是第二号人物”,但在中国,99%的企业都做不到.原因很简单, ...

  2. “智慧海绵城市”(SSC)监测评价体系整体解决方案

    一.方案简介 无论是内涝防治.黑臭水体治理,还是海绵城市规划设计及建设.评估,乃至未来智慧城市的建设,都需要有全面.致密.大量的城市水文监测数据和先进模拟仿真技术作基础支撑,唯有如此,决策才有据可依, ...

  3. [ssc] 数据库管理工具——SQuirreL SQL Client使用入门

    简单介绍: SQuirrel SQL Client是一个用Java写的数据库客户端,用JDBC统一数据库访问接口以后,可以通过一个统一的用户界面来操作MySQL PostgreSQL MSSQL Or ...

  4. 重庆/北京/江苏KS/快乐时时/七星/福运来菠菜电商开奖修复APP网站SSC网站程序开发php

    网站制作是指使用标识语言(markup language),通过一系列设计.建模.和执行的过程将电子格式的信息通过互联网传输,最终以图形用户界面(GUI)的形式被用户所浏览.简单来说,网页设计的目的就 ...

  5. ssc项目Python爬虫心得

    ###今日心得 ####time.datetime 1.字符串格式到标准化格式:time.strptime(str, "%Y%m%d") 2.今天的标准化格式:today = da ...

  6. Spark踩坑记——Spark Streaming+Kafka

    [TOC] 前言 在WeTest舆情项目中,需要对每天千万级的游戏评论信息进行词频统计,在生产者一端,我们将数据按照每天的拉取时间存入了Kafka当中,而在消费者一端,我们利用了spark strea ...

  7. 从netty-example分析Netty组件

    分析netty从源码开始 准备工作: 1.下载源代码:https://github.com/netty/netty.git 我下载的版本为4.1 2. eclipse导入maven工程. netty提 ...

  8. Java中的Socket的用法

                                   Java中的Socket的用法 Java中的Socket分为普通的Socket和NioSocket. 普通Socket的用法 Java中的 ...

  9. 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 ...

随机推荐

  1. js 有用的代码

    1. 如何创建嵌套的过滤器: //允许你减少集合中的匹配元素的过滤器, //只剩下那些与给定的选择器匹配的部分.在这种情况下, //查询删除了任何没(:not)有(:has) //包含class为“s ...

  2. PHP二维数组排序

    $arrays   要排序的数组 $sort_key 根据排序的key $sort_order 升序降序    SORT_ASC/SORT_DESC $sort_type 排序key类型 SORT_N ...

  3. weblogic网页登录URL

    http://172.16.64.173:7001/console/login/LoginForm.jsp

  4. Java:switch语句例子

    1.输入一个名次,第1-4名,分别称为冠军.亚军.季军.殿军,5名及5名以上,称为其他名次. import java.util.Scanner; public class switch1 { publ ...

  5. checked属性

    使用checked属性,你可以设置复选按钮和单选按钮默认被选中. 为此,只需在input元素中添加属性checked <input type="radio" name=&qu ...

  6. HTML与CSS基础知识补遗(一)

    开始从零基础系统地学习前端知识了,虽说html和css多少了解一些,但是学着还是能发现很多新大陆.... 一. HTML中head标签 1. <meta>标签: meta标签里是一些基础的 ...

  7. 看来System.dll是没法剔除依赖了

    今天花了半天时间将System.Xml换成了Mono.Xml 想干掉System.dll发现不行了,System.Net以及System.IO都在这下面,还有protobuf-net也逃不掉这个 算啦 ...

  8. Xcode调用旧版本库出现Undefined symbols for architecture x86_64: ld: symbol(s) not found for architecture x86_64

    问题:Undefined symbols for architecture x86_64:   ld: symbol(s) not found for architecture x86_64 问题原因 ...

  9. mysql group_concat 使用 (按分组组合字段)

    语法: GROUP_CONCAT([DISTINCT] expr [,expr ...][ORDER BY {unsigned_integer | col_name | expr}[ASC | DES ...

  10. 影响Java EE性能的十大问题(转)

    本文作者是一名有10多年经验的高级系统架构师,他的主要专业领域是Java EE.中间件和JVM技术.他在性能优化和提升方面也有很深刻的见解,下面他将和大家分享一下常见的10个影响Java EE性能问题 ...