語法:    <EMBED src=http://img86.imageshack.us/img86/4452/jsqgu5.swf width=160 height=350 type=application/x-shockwave-flash quality="high" wmode="transparent"></EMBED>


 


type='application/x-shockwave-flash' width=300 height=200>


 


码贴出来,省得大家去下载原文件!



帧上的AS:


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"


 


禁:此文章小物及代碼,都由*^appleの蜂窩^* 整理完成。


轉載請注明出處或保留LOGO,謝謝!



 

 

歡迎朋友們加入appleの小圈“巴斯光年”!

 
【FLASH教程】计算器的制作

欢迎加入~巴斯光年~

 

引用:http://blog.sina.com.cn/s/blog_4976d87a01000dl4.html
arrow
arrow
    全站熱搜

    ★﹏企鵝﹏★ 發表在 痞客邦 留言(0) 人氣()