- 请你在心里默想一个两位数的数字(比方说54)
- 用你刚才想到的数字分别减去其十位数和个位数得到结果(比方说54 - 5 - 4 = 结果45)
- 在表格中查到你得出的结果,看看结果右边的符号是什么
- 请集中精力在你查到的符号上面(不要把鼠标指到上面)至少5秒钟,然后点击水晶球,看看预测结果吧
-
fla第一帧代码:
1 stop();
2 var notice:TextField =new TextField();
3 notice.text="请输入正确密码!";
4 this.mima.addEventListener(FocusEvent.FOCUS_IN,del);
5 function del(e):void {
6 this.contains(notice)? removeChild(notice):0;
7 }
8
9 this.mima.enter_btn.addEventListener(MouseEvent.MOUSE_DOWN,test_pass2);
10 function test_pass2(e:MouseEvent):void {
11 if (this.mima.password_txt.text=="n%2") {
12 go_pass();
13 } else {
14 addChild(notice);
15 notice.x=mima.x;
16 notice.y=mima.y;
17 this.mima.password_txt.text="";
18 }
19 }
20 function go_pass():void {
21 stage.focus=null;
22 this.mima.enter_btn.removeEventListener(MouseEvent.MOUSE_DOWN,test_pass2);
23 this.mima.password_txt.text="合法用户";
24 SoundMixer.stopAll( );
25 gotoAndStop(2);
26 }
fla第二帧代码:
-
1 import com.*;
2 var lister:Lister;
3 var mysound:Sound;
4 var sp:Sprite =addChild(new Sprite())as Sprite;
5 sp.x=120;
6 sp.y=135;
7 var key:TextField;
8 var lq:MovieClip ;
9 var btn:SimpleButton;
10 var map_format:TextFormat=new TextFormat();
11 map_format.color=0x990000;
12 map_format.size=18;
13 map_format.align=TextFormatAlign.LEFT;
14 map_format.font="Wingdings";
15 var oldStar:moveStar=new moveStar(80,60);
16 addChild(oldStar);
17 oldStar.x=120;
18 oldStar.y=120;
19 function init() {
20 lister=new Lister();
21 addChild(lister);
22 lister.x=350;
23 lister.y=20;
24 }
25 init();
26 myball.addEventListener(MouseEvent.CLICK ,clicker);
27 function clicker(e):void {
28 var newstar:Firework=new Firework(30,3,0.01,false);
29 addChild(newstar);
30 newstar.x=120;
31 newstar.y=135;
32 key=new TextField();
33 key.defaultTextFormat=map_format;
34 key.text=Lister.select;
35 trace(key.width,key.height);
36 key.selectable=false;
37 key.autoSize=TextFieldAutoSize.LEFT;
38 key.x=- key.width/2;
39 key.y=- key.height/2;
40 sp.addChild(key);
41 sp.addEventListener(Event.ENTER_FRAME ,EnterFrame);
42 trace(Lister.select);
43 this.contains(lister)?removeChild(lister):0;
44 mysound=new Sud();
45 mysound.play()
46 myball.removeEventListener(MouseEvent.CLICK ,clicker);
47
48
49 }
50 function EnterFrame(e):void {
51 sp.scaleX=sp.scaleY+=0.1;
52 if (sp.scaleX>5) {
53 sp.removeEventListener(Event.ENTER_FRAME ,EnterFrame);
54 lq=new bit();
55 addChild(lq);
56 lq.x=375;
57 lq.y=100;
58 btn=new Btn();
59 addChild(btn);
60 btn.x=445;
61 btn.y=335;
62 btn.addEventListener(MouseEvent.CLICK ,reset);
63 }
64 }
65 function reset(e):void {
66 sp.scaleX=sp.scaleY=1
67 sp.removeChild(key);
68 key=null;
69 removeChild(lq);
70 removeChild(btn);
71 myball.addEventListener(MouseEvent.CLICK ,clicker);
72 btn.removeEventListener(MouseEvent.CLICK ,reset);
73 init();
74 }
751 /* ---------------------------------------
2 |Firework.as |
3 |这个类表示每一个烟花 |
4 ---------------------------------------*/
5 //eg:
6 //import com.Firework;
7 //var a:Firework=new Firework(100,3,0.01,false);
8 //100表示粒子数目,3表示每个粒子最大半径,0.01影响粒子消失快慢
9 //false表示随机颜色,true表示颜色取0xc03000
10 //addChild(a);
11 package com{
12 import flash.events.Event;
13 import flash.display.Sprite;
14 import flash.display.Graphics;
15 public class Firework extends Sprite {
16 private var m_data:FireworkData;//private类内可见
17 private var m_canvas:Graphics;
18 private var m_num:int;
19 private var m_color:uint;
20 private var m_R:Number;
21 private var m_step:Number ;
22 public function Firework(num:int=100,R:Number=3,step=0.01,color:Boolean=false):void {
23 m_num=num;
24 m_R=R;
25 m_step=step
26 color?m_color=0xc03000:0
27 m_data=new FireworkData(m_num,m_R,m_color);
28 m_canvas=this.graphics;
29 addEventListener(Event.ENTER_FRAME,whenEnterFrame);
30 }
31 private function whenEnterFrame(evt:Event):void {
32 m_canvas.clear();
33 m_canvas.beginFill(m_data.color);
34 //m_canvas.beginGradientFill("radial",[0xffffff,m_data.color],[1,1],[0,127])
35 for (var i=0; i<m_num; i++) {
36 m_canvas.drawCircle(m_data.data[i].sx,m_data.data[i].sy,m_data.data[i].r);
37 //根据FireworkData类里面数组记录的每个元素的数值绘出各个粒子
38 }
39 m_canvas.endFill();
40 m_data.next();//让FireworkData类把它自身记录的数据更新到下一帧
41 alpha-=m_step;//每一帧都让自己的alpha减m_step,影响粒子消失快慢
42 if (alpha<=0) {
43 removeEventListener(Event.ENTER_FRAME,whenEnterFrame);
44 //如果自身的alpha数值小于等于0就把自身的帧循环事件去掉
45 }
46 }
47 }
48 }
49 /* ----------------------------------------------------
50 |FireworkData.as |
51 |这个类的作用是记录每个烟花相关的数据 |
52 ----------------------------------------------------*/
53 internal class FireworkData {
54 //internal 包内可见
55 private var m_ary:Array;//数组存放这个烟花各个粒子的数据
56 private var m_color:uint;//这个烟花的颜色
57 private var m_num:int;
58 private var m_R:Number;
59 public function FireworkData(num:int=100,R:Number=3,color:uint=0):void {
60 color==0?m_color=Math.random()*0xffffff:m_color=color;//随机决定这个烟花的颜色
61 m_num=num;
62 m_R=R;
63 m_ary=new Array();//初始化数组
64 for (var i=0; i<m_num; i++) {
65 m_ary.push({sx:0,sy:0,vx:Math.random()*15*(Math.random()-Math.random()),vy:Math.random()*15*(Math.random()-Math.random()),r:Math.random()*m_R});
66 //每个元素以Object为类型,sx,sy表示粒子当前的位置,都初始化为0,vx,vy分别为粒子在x轴,y轴方向的加速度
67 //vx,vy的数值随机生成,Math.random()*15规定了数值的范围,后面再*(Math.random()-Math.random())则是
68 //决定数值的正负符号,也就决定了粒子往正半轴运动还是负半轴运动,r变量决定了每个粒子的半径
69 }
70 }
71 public function get color():uint {
72 return m_color;
73 }
74 public function get data():Array {
75 return m_ary;
76 }
77 public function next():void {
78 //这个函数会把m_ary的各个元素的数值处理成下一帧的
79 for (var i=0; i<m_num; i++) {
80 m_ary[i].sx+=m_ary[i].vx;
81 m_ary[i].sy+=m_ary[i].vy;
82 }
83 }
84 }
1 package com{
2 import flash.display.Sprite;
3 import flash.text.TextFormat;
4 import flash.text.TextFieldType;
5 import flash.text.TextFieldAutoSize;
6 import flash.text.TextField;
7 import flash.text.TextFormatAlign;
8 public class Lister extends Sprite {
9 private var num_format:TextFormat;
10 private var map_format:TextFormat;
11 private var letter:Vector.<String>;
12 public static var select:String;
13 public function Lister():void {
14 letter=Vector.<String>(["a","d","f","i","{","[","%","v","z","A","B","C","J","L","M","N","O","Q","R","T","&","X","Y","Z"]);
15 select=letter[letter.length*Math.random()>>0];
16 //======初始化文本框默认格式=======
17 num_format=new TextFormat ;
18 num_format.color=0x000000;
19 num_format.size=12;
20 num_format.bold=true;
21 num_format.align=TextFormatAlign.RIGHT;
22 num_format.font="Times New Roman";
23 //--------------------------------
24 map_format=new TextFormat ;
25 map_format.color=0x990000;
26 map_format.size=18;
27 map_format.align=TextFormatAlign.CENTER
28 map_format.font="Wingdings";
29 init();
30 }
31 private function init() {
32 for (var i:int=0; i<20; i++) {
33 for (var j:int=0; j<5; j++) {
34 var num_TextField:TextField=new TextField();
35 num_TextField.defaultTextFormat=num_format;
36 num_TextField.width=20 ;
37 num_TextField.height=20 ;
38 num_TextField..selectable=false;
39 //num_TextField.border=true;
40 //num_TextField.borderColor=0xffffff;
41 num_TextField.text=String(99-i*5-j)+".";
42 addChild(num_TextField);
43 num_TextField.x=j*50;
44 num_TextField.y=i*20;
45 //--------------------------------------------
46 var map_TextField:TextField=new TextField();
47 map_TextField.defaultTextFormat=map_format;
48 map_TextField.width=30;
49 map_TextField.height=20;
50 map_TextField..selectable=false;
51 //map_TextField.border=true;
52 //map_TextField.borderColor=0xffffff;
53 if((99-i*5-j)%9==0){
54 map_TextField.text=select;
55 }else{
56 map_TextField.text=letter[letter.length*Math.random()>>0];
57 }
58 addChild(map_TextField);
59 map_TextField.x=j*50+15;
60 map_TextField.y=i*20;
61 }
62 }
63 }
64 }
65 }
66