|
首页 | 名片设计 CorelDRAW Illustrator AuotoCAD Painter 其他软件 Photoshop Fireworks Flash |
|
动画演示效果:
码贴出来,省得大家去下载原文件! display = "0";
stop(); function getdigit(digit) { if(clear){ clear = false; decimal = false; display = "0"; } if(length(display)<13){ if(display == "0" and digit != "."){ display = digit; } else { display = display+digit; } } } function getoperator(sign){ if(operator == "+") { display = Number(operand)+Number(display); symbol = operator; } if(operator == "-") { display = operand-display; symbol = operator; } if(operator == "*") { display = operand*display; symbol = "x"; } if(operator == "/") { display = operand/display; symbol = operator; } operator = "="; clear = true; symbol = " "; decimal = "false"; if(sign != null){ operator = sign; if(operator == "*"){ symbol = "x"; } else { symbol = operator;} operand = display; } } 按钮上的: "1" on(release,keyPress"1"){getdigit("1")} "2" on(release,keyPress"2"){getdigit("2")} "3","4","5",......,"0"同上! "+" on(release,keyPress"+"){getoperator("+")} "-" on(release,keyPress"-"){getoperator("-")} "X","/"同上. "M+" on(release){ memory = memory+Number(display); symbol = ""; mem = "M+"; } "MR" on(release){display = memory;} "MC" on(release){ memory = 0; mem = " "; display = "0"; operator = ""; operand = false; clear = false; decimal = false; } "C" 同上. 返回类别: Flash教程 上一教程: Flash制作一个精美的课件退出窗口 下一教程: Flex2 发现之旅:动态创建DataGrid列 您可以阅读与"Flash AS创作:计算器"相关的教程: · Flash制作一个简易的计算器教程 · Flash AS创作:实时时钟 · FLASH:《大话李白》创作全过程 · Flash视频教程:绘制窗户 · Flash游戏制作:点击可弹动的小球 |
快精灵印艺坊 版权所有 | 首页会员中心在线印刷在线编辑付款方式索取样品设计指南连锁门店 |