用as3纯代码制作人教版四年级上数学计算题题库.docx_第1页
用as3纯代码制作人教版四年级上数学计算题题库.docx_第2页
用as3纯代码制作人教版四年级上数学计算题题库.docx_第3页
用as3纯代码制作人教版四年级上数学计算题题库.docx_第4页
用as3纯代码制作人教版四年级上数学计算题题库.docx_第5页
已阅读5页,还剩5页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

用as3纯代码制作人教版四年级上数学计算题题库本人正在学习AS3,为了解决当前练习题来源问题,就试着用AS3制作了四年级上数学计算题题库,由于对AS3不太精通,代码不太精简,不过总体效果还可以。用AS3制作计算题题库,方法比较简单。首先用flash新建AS3文件,舞台大小设置为1024768像素,然后把Slider组件、Label组件、ColorPicker组件、Button组件拖入舞台,然后再全部删除,这时库里就有了这四个组件,然后把AS3代码粘贴到主场景第一帧,发布即可生成四年级上数学计算题题库。代码如下:stop();stage.displayState = StageDisplayState.FULL_SCREEN;import fl.events.ColorPickerEvent;import fl.controls.ColorPicker;import flash.events.MouseEvent;import fl.controls.Label;import fl.controls.Button;import flash.display.*;import flash.text.TextFormat;import fl.controls.Label;import fl.controls.Slider;import fl.events.SliderEvent;var ct1_txt:Label=new Label();var ct2_txt:Label=new Label();var ct3_txt:Label=new Label();var ct4_txt:Label=new Label();var ct5_txt:Label=new Label();var ct6_txt:Label=new Label();var ct7_txt:Label=new Label();var ct8_txt:Label=new Label();var ct9_txt:Label=new Label();var ct10_txt:Label=new Label();var ct11_txt:Label=new Label();var ct12_txt:Label=new Label();var ct13_txt:Label=new Label();var ct14_txt:Label=new Label();var ct15_txt:Label=new Label();var ct16_txt:Label=new Label();var ct17_txt:Label=new Label();var ct18_txt:Label=new Label();var ct19_txt:Label=new Label();var ct20_txt:Label=new Label();var hy1_txt:Label=new Label();var hy2_txt:Label=new Label();var cfjs_btn:Button=new Button();var cfjs2_btn:Button=new Button();var cfhh_btn:Button=new Button();var tc_btn:Button=new Button();var wbys:TextFormat=new TextFormat();var wbys1:TextFormat=new TextFormat();var ys:ColorPicker=new ColorPicker();var tdt:Slider=new Slider();addChild(ct1_txt);addChild(ct2_txt);addChild(ct3_txt);addChild(ct4_txt);addChild(ct5_txt);addChild(ct6_txt);addChild(ct7_txt);addChild(ct8_txt);addChild(ct9_txt);addChild(ct10_txt);addChild(ct11_txt);addChild(ct12_txt);addChild(ct13_txt);addChild(ct14_txt);addChild(ct15_txt);addChild(ct16_txt);addChild(ct17_txt);addChild(ct18_txt);addChild(ct19_txt);addChild(ct20_txt);addChild(hy1_txt);addChild(hy2_txt);addChild(cfjs_btn);addChild(cfjs2_btn);addChild(cfhh_btn);addChild(tc_btn);addChild(ys);addChild(tdt);tdt.visible = false;ct1_txt.move(50,20);ct2_txt.move(50,ct1_txt.y+ct1_txt.height+45);ct3_txt.move(50,ct2_txt.y+ct2_txt.height+45);ct4_txt.move(50,ct3_txt.y+ct3_txt.height+45);ct5_txt.move(50,ct4_txt.y+ct4_txt.height+45);ct6_txt.move(50,ct5_txt.y+ct5_txt.height+45);ct7_txt.move(50,ct6_txt.y+ct6_txt.height+45);ct8_txt.move(50,ct7_txt.y+ct7_txt.height+45);ct9_txt.move(50,ct8_txt.y+ct8_txt.height+45);ct10_txt.move(50,ct9_txt.y+ct9_txt.height+45);ct11_txt.move(600,20);ct12_txt.move(600,ct1_txt.y+ct1_txt.height+45);ct13_txt.move(600,ct2_txt.y+ct2_txt.height+45);ct14_txt.move(600,ct3_txt.y+ct3_txt.height+45);ct15_txt.move(600,ct4_txt.y+ct4_txt.height+45);ct16_txt.move(600,ct5_txt.y+ct5_txt.height+45);ct17_txt.move(600,ct6_txt.y+ct6_txt.height+45);ct18_txt.move(600,ct7_txt.y+ct7_txt.height+45);ct19_txt.move(600,ct8_txt.y+ct8_txt.height+45);ct20_txt.move(600,ct9_txt.y+ct9_txt.height+45);cfjs_btn.move(650,700);cfjs2_btn.move(450,700);cfhh_btn.move(250,700);tc_btn.move(900,700);ys.move(850,700);hy1_txt.move(50,200);hy2_txt.move(350,500);tdt.move(20,700);wbys.color = 0x0000ff;wbys.size = 40;wbys1.color = 0xff72f5;wbys1.size = 65;/*ct1_txt.setTextFormat(wbys);*/cfjs_btn.label = 点击随机出20道除法计算题;cfjs2_btn.label = 点击随机出20道乘法计算题;cfhh_btn.label = 点击随机出乘法与除法计算题;hy1_txt.text = 人教版四年级上数学计算题题库;hy2_txt.text = 请点击下面的按钮进入题库;tc_btn.label = 退出;/*ys.addEventListener(ColorPickerEvent.CHANGE,ysxz);function ysxz(event)wbys.color = ys.selectedColor;ct1_txt.setTextFormat(wbys);*/ct1_txt.setStyle(textFormat,wbys);ct2_txt.setStyle(textFormat,wbys);ct3_txt.setStyle(textFormat,wbys);ct4_txt.setStyle(textFormat,wbys);ct5_txt.setStyle(textFormat,wbys);ct6_txt.setStyle(textFormat,wbys);ct7_txt.setStyle(textFormat,wbys);ct8_txt.setStyle(textFormat,wbys);ct9_txt.setStyle(textFormat,wbys);ct10_txt.setStyle(textFormat,wbys);ct11_txt.setStyle(textFormat,wbys);ct12_txt.setStyle(textFormat,wbys);ct13_txt.setStyle(textFormat,wbys);ct14_txt.setStyle(textFormat,wbys);ct15_txt.setStyle(textFormat,wbys);ct16_txt.setStyle(textFormat,wbys);ct17_txt.setStyle(textFormat,wbys);ct18_txt.setStyle(textFormat,wbys);ct19_txt.setStyle(textFormat,wbys);ct20_txt.setStyle(textFormat,wbys);hy1_txt.setStyle(textFormat,wbys1);hy2_txt.setStyle(textFormat,wbys);ct1_txt.text = ;ct2_txt.text = ;ct3_txt.text = ;ct4_txt.text = ;ct5_txt.text = ;ct6_txt.text = ;ct7_txt.text = ;ct8_txt.text = ;ct9_txt.text = ;ct10_txt.text = ;ct11_txt.text = ;ct12_txt.text = ;ct1_txt.text = ;ct13_txt.text = ;ct1_txt.text = ;ct14_txt.text = ;ct15_txt.text = ;ct16_txt.text = ;ct17_txt.text = ;ct18_txt.text = ;ct19_txt.text = ;ct20_txt.text = ;ct1_txt.autoSize = left;ct2_txt.autoSize = left;ct3_txt.autoSize = left;ct4_txt.autoSize = left;ct5_txt.autoSize = left;ct6_txt.autoSize = left;ct7_txt.autoSize = left;ct8_txt.autoSize = left;ct9_txt.autoSize = left;ct10_txt.autoSize = left;ct11_txt.autoSize = left;ct12_txt.autoSize = left;ct13_txt.autoSize = left;ct14_txt.autoSize = left;ct15_txt.autoSize = left;ct16_txt.autoSize = left;ct17_txt.autoSize = left;ct18_txt.autoSize = left;ct19_txt.autoSize = left;ct20_txt.autoSize = left;hy1_txt.autoSize = left;hy2_txt.autoSize = left;cfjs_btn.width = 160;cfjs_btn.height = 30;cfjs2_btn.width = 160;cfjs2_btn.height = 30;cfhh_btn.width = 160;cfhh_btn.height = 30;cfjs_btn.addEventListener(MouseEvent.CLICK,cfjs);function cfjs(Event:MouseEvent)tdt.visible = true;hy1_txt.text = ;hy2_txt.text = ;ct1_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct2_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct3_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct4_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct5_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct6_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct7_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct8_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct9_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct10_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct11_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct12_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct13_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct14_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct15_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct16_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct17_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct18_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct19_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct20_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;cfjs2_btn.addEventListener(MouseEvent.CLICK,cfjs2);function cfjs2(Event:MouseEvent)tdt.visible = true;hy1_txt.text = ;hy2_txt.text = ;ct1_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct2_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct3_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct4_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct5_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct6_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct7_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct8_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct9_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct10_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct11_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct12_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct13_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct14_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct15_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct16_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct17_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct18_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct19_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct20_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;cfhh_btn.addEventListener(MouseEvent.CLICK,cfhh);function cfhh(Event:MouseEvent)tdt.visible = true;hy1_txt.text = ;hy2_txt.text = ;ct1_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct2_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct3_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct4_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct5_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct6_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct7_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct8_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct9_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct10_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct11_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct12_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct13_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct14_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct15_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct16_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct17_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct18_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct19_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;ct20_txt.text = + Math.round(Math.random() * 899 + 100) + + Math.round(Math.random() * 89 + 10) + =;tc_btn.addEventListener(MouseEvent.CLICK,tc);function tc(Event:MouseEvent)fscommand(quit);ys.addEventListener(ColorPickerEvent.CHANGE,cd);function cd(event)wbys.color = ys.selectedColor;ct1_txt.setStyle(textFormat,wbys);ct2_txt.setStyle(textFormat,wbys);ct3_txt.setStyle(textFormat,wbys);ct4_txt.setStyle(textFormat,wbys);ct5_txt.setStyle(textFormat,wbys);ct6_txt.setStyle(textFormat,wbys);ct7_txt.setStyle(textFormat,wbys);ct8_txt.setStyle(textFormat,wbys

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论