Home | Login| Guest
¾×¼Ç½ºÅ©¸³Æ® | 2008-12-16 12:48:46
Hit : 1
/ .....       ÁÖ¼® ±âÈ£  
/* ..... */    ÁÖ¼® ±âÈ£  
----------------------------------------------------------------------------
\r        // ¸®ÅÏ Äڵ堠(ASC 13)
\n        // ÁÙ¹Ù²Þ ÄÚµå (ASC 10)
\r\n      // ÁÙ¹Ù²Þ Äڵ堠(2ÁÙ)
\t        // Tab ÄÚµå (ASC 9)
\b        // Backspce ÄÚµå (ASC 8)
&         // text ÆÄÀÏ µ¥ÀÌŸ ±¸ºÐ ÄÚµå
----------------------------------------------------------------------------
»ê¼ú¿¬»êÀÚ  +, -, *, /, %                 //  %  ³ª¸ÓÁö¸¦ ±¸ÇÑ´Ù
´ëÀÔ¿¬»êÀÚ  =, +=, -=, *=, /=, %=         //  i+=4 ¿Í  i=i+4 ´Â °°´Ù
Áõ°¨¿¬»êÀÚ  ++, --                        //  i++  ¿Í   i=i+1 ´Â °°´Ù  
ºñ±³¿¬»êÀÚ  ==, !=, >, <, >=, <=          //  !=  '°°Áö¾Ê´Ù' ·Î ÇØ¼®
ºñ±³¿¬»êÀÚ  ===                           //  ¼ýÀÚ ¿Í ¹®ÀÚ ±¸ºÐ
a = 5;    b = "5";                        //  ¼ýÀÚ 5 ¿Í ¹®ÀÚ "5"
(a == b)                                  //  ¼ýÀÚ 5 ¿Í ¹®ÀÚ "5"  ´Â °°´Ù (true)
(a === b)                                 //  ¼ýÀÚ 5 ¿Í ¹®ÀÚ "5" ´Â Ʋ¸®´Ù (false)
³í¸®¿¬»êÀÚ  &&, ||, !                     //  ±×¸®°í(AND), ¶Ç´Â(OR), ¾Æ´Ï¸é(NOT)
Á¶°Ç¿¬»êÀÚ  ?    ( a ) ? b : c ;          //  a Á¶°ÇÀÌ ¸ÂÀ¸¸é b Ʋ¸®¸é c ½ÇÇà
x=5;  y=10;  z=(x<6) ? x: y;   trace (z); //  z Àº 5 ÀÌ´Ù
¹®ÀÚ¿¬»êÀÚ  eq  ne  not  or  add          //  eq(==) ne(!=) not(!) or(||) add(+ ¹®ÀÚ¿­ÀÇ ¿¬°á)
( )                                       //  ¿¬»êÀÇ ¼ø¼­¸¦ Á¤ÇÑ´Ù
[ ]                                       //  ¹è¿­À» ÁöÁ¤ÇÑ´Ù
" "                                       //  ¹®ÀÚ¸¦ ÁöÁ¤ÇÑ´Ù
a=1+2;  trace(a);                         //  ¿¬»ê °á°ú Ãâ·Â.  °á°ú´Â 3
aaa=1;  set("ccc", aaa );  trace(ccc);    //  º¯¼ö¿¡ °ªÀ» ÁöÁ¤.  °á°ú´Â 1
aaa=1;  set("ccc", "aaa");  trace(ccc);   //  º¯¼ö¿¡ °ªÀ» ÁöÁ¤.  °á°ú´Â aaa
set("ooo", getProperty ("ppp", _x ));     //  ppp x ÁÂÇ¥¸¦  ooo ¿¡ ÁöÁ¤.
----------------------------------------------------------------------------
for (a=1; a<=10; a++)  { trace("a="+a); };             //  for  ¹Ýº¹¹®
for (i=1; i<=120;  i+=12) { continue; };               //  for step ¹Ýº¹¹®
while(true) {  if(a == 0) { break; }; };               //  while  ¹Ýº¹¹®
do { if(a == 0) { break; }; };  while(true);           //  do ¹Ýº¹¹®
if((n == 0) || (n >= 5)  &&  (n <= 55)  !(n=15)) {     //  if Á¶°Ç¹®
¡¡gotoAndPlay(1);
} else if (n == 2) {
¡¡gotoAndPlay(2);
} else {
¡¡gotoAndPlay(3);
};
num_ch = 3;                                             //  switch Á¶°Ç¹®
switch (num_ch) {                                                
      case 1:    trace ( " case 1 tested true " );  break;
      case 2:    trace ( " case 2 tested true " );  break;
      default:    trace ( " no case tested true " );
};
----------------------------------------------------------------------------
function sumnumber(a,b,c) {  return(aaa= a+b+c); };    // ÇÔ¼ö
sumnumber(1,2,3);
trace(aaa);
----------------------------------------------------------------------------
Math.abs(-1)              //  Àý´ë°ª.   °á°ú´Â 1
Math.sin(1)               //  sin °ª.   °á°ú´Â 0.841470984807897
Math.cos(1)               //  cos °ª.   °á°ú´Â 0.54030230586814
Math.tan(1)               //  tan °ª.   °á°ú´Â 1.5574077246549
Math.log(2)               //  log °ª.   °á°ú´Â 0.693147180559945
Math.exp(1)               //  Áö¼ö °ª.    °á°ú´Â 2.71828182845905
Math.sqrt(9)              //  Á¦°ö±Ù °ª.    °á°ú´Â 3
Math.pow(2 , 4)           //  °ÅµìÁ¦°ö °ª.    °á°ú´Â 16
Math.ceil(1.1)            //  °¡±î¿î Á¤¼ö·Î ¿Ã¸² °ª.    °á°ú´Â 2
Math.ceil(1.5)            //  °¡±î¿î Á¤¼ö·Î ¿Ã¸² °ª.    °á°ú´Â 2
Math.floor(1.2)           //  °¡±î¿î Á¤¼ö·Î ³»¸² °ª.    °á°ú´Â 1
Math.floor(1.7)           //  °¡±î¿î Á¤¼ö·Î ³»¸² °ª.    °á°ú´Â 1
Math.round(1.2)           //  °¡±î¿î Á¤¼ö·Î ¹Ý¿Ã¸² °ª.    °á°ú´Â 1
Math.round(1.5)           //  °¡±î¿î Á¤¼ö·Î ¹Ý¿Ã¸² °ª.    °á°ú´Â 2
Math.max(1 , 2)           //  µÎ Á¤¼ö Áß Å« Á¤¼ö°ª.    °á°ú´Â 2
Math.min(1 , 2)           //  µÎ Á¤¼ö Áß ÀÛÀº Á¤¼ö°ª.    °á°ú´Â 1
int(1.12 );               //  ¼öÄ¡¸¦ Á¤¼öÈ­.   °á°ú´Â 1    
int(1.82 );               //  ¼öÄ¡¸¦ Á¤¼öÈ­.   °á°ú´Â 1    
parseInt("3.2");          //  ¹®ÀÚ¿­À» Á¤¼öÈ­.  °á°ú´Â 3    
parseInt("3.7");          //  ¹®ÀÚ¿­À» Á¤¼öÈ­.  °á°ú´Â 3    
parseInt("5abc");         //  ¹®ÀÚ¿­À» Á¤¼öÈ­.  °á°ú´Â 5
parseInt("abc5");         //  ¹®ÀÚ¿­À» Á¤¼öÈ­.  °á°ú´Â NaN    
parseInt("3E8", 16);      //  16 Áø¼ö·Î º¯È¯.   °á°ú´Â 1000
parseInt("777", 8);       //  8 Áø¼ö·Î º¯È¯.   °á°ú´Â 511
parseInt("1010", 2);      //  2 Áø¼ö·Î º¯È¯.   °á°ú´Â 10
parseFloat("2")           // ¹®ÀÚ¿­À» ºÎµ¿Á¡ ¼ýÀÚ·Î º¯È¯.  °á°ú´Â 2
parseFloat("2.4")         // ¹®ÀÚ¿­À» ºÎµ¿Á¡ ¼ýÀÚ·Î º¯È¯.  °á°ú´Â 2.4
parseFloat("2.6abc")      // ¹®ÀÚ¿­À» ºÎµ¿Á¡ ¼ýÀÚ·Î º¯È¯.  °á°ú´Â 2.6
Number("11")              //  ¹®ÀÚ¿­À» ¼ýÀÚ·Î º¯È¯.   °á°ú´Â 11
Number("12.34")           //  ¹®ÀÚ¿­À» ¼ýÀÚ·Î º¯È¯.   °á°ú´Â 12.34
Number("12.34abc")        //  ¹®ÀÚ¿­À» ¼ýÀÚ·Î º¯È¯.   °á°ú´Â NaN
sss = 123;  uuu = sss.toString();      // ¼ýÀÚ¸¦ ¹®Àڷκ¯È¯.  °á°ú´Â 123
ord("abc");                            //  ASCII °ª.   °á°ú´Â 97
s = "abc";   sss = s.charCodeAt(0);    //  1¹øÂ° ASCII °ª .   °á°ú´Â 97
s = "abc";   sss = s.charCodeAt(1);    //  2¹øÂ° ASCII °ª.    °á°ú´Â 98
chr(65);                               //  ASCII Äڵ带 ¹®ÀÚÈ­.  °á°ú´Â A
String.fromCharCode(64,65,66);         //  ASCII Äڵ带 ¹®ÀÚÈ­.  °á°ú´Â @AB
Math.random();                         // ³­¼ö ¹ß»ý.  °á°ú´Â 0 - 1 »çÀÌÀÇ ¼Ò¼ýÁ¡ Æ÷ÇÔÇÑ °ª
random(5);                             // ³­¼ö ¹ß»ý.  °á°ú´Â 0,1,2,3,4 Áß Çϳª
----------------------------------------------------------------------------
// delete º¯¼ö ¶Ç´Â °´Ã¼ ;             // º¯¼ö¸¦ »èÁ¦  (var ·Î ¼±¾ðµÈ º¯¼ö´Â »èÁ¦ÇÒ ¼ö ¾ø´Ù)
account = 1;   trace (account) ;                      // °á°ú´Â 1  
account = 1;   delete account;    trace (account);    // °á°ú´Â undefined
delete onEnterFrame;                                  // ¹Ýº¹ ½ÇÇà ÁßÁö
----------------------------------------------------------------------------
typeof( );            // String, Number, MovieClip, Object, Boolean, Function ¿©ºÎ¸¦ ÁöÁ¤
trace (typeof(1));    // °á°ú´Â Number
trace (typeof("1"));  // °á°ú´Â String
trace (typeof(aaa));  // aaa°¡ ¹«ºñŬ¸³ À̶ó¸é  °á°ú´Â MovieClip
----------------------------------------------------------------------------
isFinite( );            // ¼ýÀÚ°¡ À¯ÇѼöÀ̸é true ¹«ÇѼö°Å³ª À½ÀÇ ¹«ÇÑ´ëÀ̸é false
trace (isFinite(aaa));  // aaa °ªÀÌ NaN À̶ó¸é °á°ú´Â false
----------------------------------------------------------------------------
Mouse.show();           // ¸¶¿ì½º º¸ÀÓ
Mouse.hide();           // ¸¶¿ì½º °¨Ãã
myClip.onMouseDown = function () {trace (" depth ¹«½Ã"); };     // ¸¶¿ì½º ´©¸¦ ¶§
myClip.onMouseUp = function () {trace ("depth ¹«½Ã"); };        // ¸¶¿ì½º ´­·¶´Ù ³õÀ» ¶§
myClip.onMouseMove = function () { trace ("depth ¹«½Ã"); };     // ¸¶¿ì½º À̵¿ÇÒ ¶§
myClip.onPress = function () { trace ("depth Àû¿ë"); };         // ¸¶¿ì½º ´©¸¦ ¶§
myClip.onRelease = function () { trace ("depth Àû¿ë "); };      // ¸¶¿ì½º ´­·¶´Ù ³õÀ» ¶§
myClip.onReleaseOutside = function () { trace ("Outside"); };   // ¸¶¿ì½º ³ª°¡¼­ ³õÀ» ¶§
myClip.onRollOver = function () { trace ("Over called"); };     // ¸¶¿ì½º ¿À¹ö ¶§
myClip.onRollOut = function () { trace ("Out called"); };       // ¸¶¿ì½º ¾Æ¿ô ¶§
----------------------------------------------------------------------------
// ´ÜÃß¹«ºñŬ¸³ Ŭ¸¯ÈÄ ¾×¼Ç ½ºÅ©¸³Æ®¸¦ ³Ö´Â´Ù
on (press){           }  // ¸¶¿ì½º ¹öưÀ» ´©¸¦ ¶§   };  x  }  o
on (release){         }  // ¸¶¿ì½º ¹öưÀ» ´­·¶´Ù ¶¿ ¶§
on (releaseOutside){  }  // ¸¶¿ì½º ¹öưÀ» ´©¸£°í ³ª°¡¼­ ¶¿ ¶§
on (rollOver){        }  // ¸¶¿ì½º Æ÷ÀÎÆ®°¡ À§·Î ¿Ã¶ó¿Ã ¶§
on (rollOut){         }  // ¸¶¿ì½º Æ÷ÀÎÆ®°¡ ¹ÛÀ¸·Î ³ª°¥ ¶§
on (dragOver){        }  // ´©¸¥ ä·Î ¹ÛÀ¸·Î ³ª°¬´Ù°¡ ´Ù½Ã µé¾î¿Ã ¶§
on (dragOut){         }  // ¸¶¿ì½º¹öưÀ» ´©¸£°í ¹Ù±ùÀ¸·Î µå·¡±×ÇÒ ¶§
on (keyPress){        }  // ÁöÁ¤ÇÑ Å°¸¦ ´©¸¦ ¶§
----------------------------------------------------------------------------
// ¹«ºñŬ¸³ Ŭ¸¯ÈÄ ¾×¼Ç ½ºÅ©¸³Æ®¸¦ ³Ö´Â´Ù
onClipEvent (load) {            }  // ½ÃÀÛ µÉ¶§  };  x  }  o  
onClipEvent (unload) {          }  // Á¦°Å µÉ¶§
onClipEvent (enterFrame) {      }  // Æ®¸®°Å µÉ¶§
onClipEvent (mouseMove) {       }  // ¸¶¿ì½º°¡ À̵¿ÇÒ ¶§
onClipEvent (mouseDown) {       }  // ¸¶¿ì½º Ŭ¸¯ ½Ã
onClipEvent (mouseUp) {         }  // ¸¶¿ì½º Ŭ¸¯ ÈÄ
onClipEvent (keyDown) {         }  // ۸¦ ´©¸¦ ¶§
onClipEvent (keyUp) {           }  // ۸¦ ´­·¶´Ù ³õÀ» ¶§
onClipEvent (data) {            }  // loadVariables ¶Ç´Â loadMovie ¾×¼Ç¿¡¼­ µ¥ÀÌÅͰ¡ ¼ö½ÅµÉ ¶§
----------------------------------------------------------------------------
TextField.onChanged = function () { trace ("onChanged called"); };
// ÅØ½ºÆ® ÇʵåÀÇ ³»¿ëÀÌ º¯°æµÉ ¶§
TextField.onSetFocus = function () { trace ("onSetFocus called"); };
// ÅØ½ºÆ® ÇʵåÀÇ ³»¿ë ºÎºÐ¿¡ ¸¶¿ì½º°¡ Ŭ¸¯ µÉ ¶§
TextField.onKillFocus = function () { trace ("onKillFocus called"); };
// ÅØ½ºÆ® ÇʵåÀÇ ³»¿ë ¹Ù±ù ºÎºÐ¿¡ ¸¶¿ì½º°¡ Ŭ¸¯ µÉ ¶§
TextField.onScroller = function () { trace ("onScroller called"); };
// ÅØ½ºÆ® ÇʵåÀÇ ³»¿ëÀÌ ½ºÅ©·Ñ µÉ ¶§
----------------------------------------------------------------------------
myMovieClip.onData = function () { trace ("onData called"); };  
// ¹«ºñ Ŭ¸³ÀÌ loadVariables ¶Ç´Â loadMovie È£Ãâ·ÎºÎÅÍ µ¥ÀÌÅ͸¦ ¹ÞÀ» ¶§
myMovieClip.onLoad =  function () { trace ("onLoad called"); };  
// ¹«ºñ Ŭ¸³ÀÌ load È£Ãâ·ÎºÎÅÍ µ¥ÀÌÅ͸¦ ¹ÞÀ» ¶§
myMovieClip.onUnLoad =  function () { trace ("onUnLoad called"); };  
// ¹«ºñ Ŭ¸³ÀÌ Unload ¶§
myMovieClip.stop()  
// ÀÛ¾÷ ÁßÁö
----------------------------------------------------------------------------
myDate = new Date();                               // ³¯Â¥ ·Îµå
myDate = new Date (³â,¿ù,ÀÏ,½Ã,ºÐ,ÃÊ);             // ³¯Â¥ ÁöÁ¤
yyyy = (myDate.getFullYear() + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate());
tttt = (myDate.getHours()+ " :" + myDate.getMinutes() + " :" +myDate.getSeconds());
----------------------------------------------------------------------------
_root.onEnterFrame = function() {   };             // ¸ÞÀÎÈ­¸é¿¡¼­ ÇÁ·¹ÀÓ ¹Ýº¹
onEnterFrame = function() {   };                   // ½Éº¼È­¸é¿¡¼­ ÇÁ·¹ÀÓ ¹Ýº¹
----------------------------------------------------------------------------
tmtm = getTimer();          
onEnterFrame = function() {
  if ( (getTimer()-tmtm) >= 500 ) { tmtm=getTimer(); trace (tmtm); };   // 0.5ÃÊÈÄ ¹Ýº¹½ÇÇà
  if ( (getTimer()-tmtm) >= 1000 ) { tmtm=getTimer(); trace (tmtm); };  // 1ÃÊÈÄ ¹Ýº¹½ÇÇà
  if ( (getTimer()-tmtm) >= 2000 ) { tmtm=getTimer(); trace (tmtm); };  // 2ÃÊÈÄ ¹Ýº¹½ÇÇà
};
----------------------------------------------------------------------------
onEnterFrame = function() {                                
   nr += 1;  if (nr > 5 )  {  delete  onEnterFrame;  };           // 5¹ø ¹Ýº¹½ÇÇàÈÄ ÁßÁö
   trace (nr);
};
----------------------------------------------------------------------------
createTextField ("ins", 1, 100, 100, 50, 50)
ins.border = true;
function callback() {
   ins._x += 5;
   if ( ins._x > 400 ) { clearInterval( intervalID );  };      // ÁßÁö (clearInterval)
}
var intervalID;
intervalID = setInterval( callback, 100 );             //  0.1ÃÊÈÄ ¹Ýº¹½ÇÇà (setInterval)
----------------------------------------------------------------------------
#include "script.as"         // script.as ÆÄÀÏ ³Ö±â (¾×¼Ç ½ºÅ©¸³Æ® txt ÆÄÀÏ)
----------------------------------------------------------------------------
System.useCodepage = true;   // ÇÑ±Û ±úÁü ¹æÁö
----------------------------------------------------------------------------
trace(targetPath(this));     // ´ë»ó ÆÐ½º¸¦ ¹Ýȯ.  °á°ú´Â _level0.instance1 ·Î Ç¥½Ã
trace(this.valueOf());       // °á°ú´Â _level0 ·Î Ç¥½Ã
----------------------------------------------------------------------------
trace(this.getBytesLoaded());  // ¹«ºñŬ¸³ÀÇ ·ÎµåµÈ ¹ÙÀÌÆ® ¼ö¸¦ ¾Ë·ÁÁØ´Ù.
trace(this.getBytesTotal());   // ¹«ºñŬ¸³ÀÇ Àüü¿ë·® ¹ÙÀÌÆ® ¼ö¸¦ ¾Ë·ÁÁØ´Ù.
----------------------------------------------------------------------------
getURL("C:/")                                          // Ž»ö±â ¿­±â
getURL("C:/Windows/NOTEPAD.EXE");   };                 // ¸Þ¸ðÀå ¿­±â
getURL("C:/Program Files/Accessories/WORDPAD.EXE");    // ¿öµåÆÐµå ¿­±â
getURL("C:/Program Files/Accessories/MSPAINT.EXE");    // ±×¸²ÆÇ ¿­±â
getURL("C:/Windows/CALC.EXE");                         // °è»ê±â ¿­±â
getURL ("aaa.exe");                                    // aaa.exe ÆÄÀÏ ¿­±â (message)
getURL ("aaa.txt", "_self");                           // aaa.txt ÆÄÀÏ ¿­±â
getURL ("movie.html", "_self");                        // movie.html ÆÄÀÏ ¿­±â
getURL ("http://www", "_blank");                    // http://www ¸¦ »õ·Î¿î âÀ¸·Î ¿­±â
----------------------------------------------------------------------------
Stage.showMenu = "true";        // ½ºÅ©¸° ¸Þ´º º¸ÀÓ
Stage.showMenu = "false";       // ½ºÅ©¸° ¸Þ´º °¨Ãã  
Stage.scaleMode = "noScale";    // È­¸éÀÇ »çÀÌÁ °íÁ¤
Stage.align = "TL";             // È­¸éÀÇ Á¤·ÄÀ» T(À§) L(¿ÞÂÊ)
           //  "T" À§ °¡¿îµ¥    "B" ¾Æ·¡ °¡¿îµ¥    "L" °¡¿îµ¥ ¿ÞÂÊ    "R" °¡¿îµ¥ ¿À¸¥ÂÊ
           //  "TL" À§ÂÊ ¿ÞÂÊ   "TR" À§ÂÊ ¿À¸¥ÂÊ   "BL" ¾Æ·¡ÂÊ ¿ÞÂÊ   "BR" ¾Æ·¡ÂÊ ¿À¸¥ÂÊ
Stage.height      // Çȼ¿·Î Ç¥½ÃµÈ ½ºÅ×ÀÌÁöÀÇ ³ôÀÌ
Stage.width       // Çȼ¿·Î Ç¥½ÃµÈ ½ºÅ×ÀÌÁöÀÇ ³ÐÀÌ
----------------------------------------------------------------------------
_root.createEmptyMovieClip("box",1);      // ½ºÅ×ÀÌÁö Å׵θ® ÁÖ±â
with (_root.box) {  moveto(1, 1);   linestyle(10, 0x00cc00, 100);
    lineto(stage.width, 1);     lineto(stage.width, stage.height);
    lineto(1, stage.height);    lineto(1, 1);   };
----------------------------------------------------------------------------
fscommand("showmenu", true);      // ½ºÅ©¸° ¸Þ´º º¸ÀÓ
fscommand("showmenu", false);     // ½ºÅ©¸° ¸Þ´º °¨Ãã
fscommand("allowscale", true);    // ½ºÅ©¸° Å©±â¿¡ µû¶ó ¹«ºñÀÇ Å©±âµµ º¯ÇÔ
fscommand("allowscale", false);   // ½ºÅ©¸° Å©±â¿¡ µû¶ó ¹«ºñÀÇ Å©±âµµ ¾Èº¯ÇÔ
fscommand("fullscreen", true);    // Ç® ½ºÅ©¸° (escŰ ´©¸£¸é ÇØÁ¦)
fscommand("fullscreen", false);   // Ç® ½ºÅ©¸°À» ¿ø·¡ÀÇ Å©±â·Î ¸¸µç´Ù
fscommand("trapallkeys", true); // Űº¸µå Ű »ç¿ëÇÒ ¼ö ¾øÀ½ (Ç® ½ºÅ©¸° À϶§ escŰ ¸ÔÅë)
fscommand("trapallkeys", false);  // Űº¸µå Ű »ç¿ëÇÒ ¼ö ÀÖÀ½
fscommand("quit");                // ½ºÅ©¸° ´Ý±â
fscommand ("exec", "a.exe");      // a.exe ÆÄÀÏ ½ÇÇà (no message)
   Ç÷¡½Ã ¹«ºñ(exe) °¡ À§Ä¡ÇÏ´Â Æú´õ¾È¿¡ fscommand ¶ó´Â ÇÏÀ§ Æú´õ¸¦ ¸¸µé°í
   fscommand µð·ºÅ丮¿¡  a.exe °¡ ÀÖÀ»¶§ Ç÷¡½Ã ¹«ºñ(exe)¸¦ ½ÇÇàÇϸé a.exeÆÄÀÏ ½ÇÇà
----------------------------------------------------------------------------
// getURL ·Î javascript »ç¿ëÇϱâ
var hello = "Hello, World";
getURL("javascript:alert(\" "+ hello + "  \")");   // ¸Þ¼¼Áö ¶ç¿ì±â
getURL("javascript:window.self.close()");          // À©µµ¿ì⠴ݱâ
getURL("javascript:window.external.AddFavorite('http://','°¡')" );    //Áñ°Üã±â Ãß°¡
----------------------------------------------------------------------------
// fscommand ·Î javascript »ç¿ëÇϱâ
1.  fscommand ("messagebox", "This is a Flash.");   // aaa.swf flash script
2.  ÆÄÀϸ޴º - Á¦ÀÛ¼³Á¤ - Æ÷¸Ë (HTMLüũ) - HTML (ÅÛÇø´: with FSCommand üũ)
3.  ÆÄÀϸ޴º - Á¦ÀÛ (ÆÄÀϸíÀº aaa.swf) -  aaa.html ÆÄÀÏÀÌ µð·ºÅ丮¿¡ ¸¸µé¾î Áø´Ù
4.  aaa.html ÆÄÀÏÀ» ¿­°í  function aaa_DoFSCommand(command, args) {  ¾Æ·¡¿¡
      if (command == "messagebox") {  alert(args);  };   À» Àû°í ÀúÀå ÇÑ´Ù
5.  aaa.html ½ÇÇà (½ÇÇàÈÄ Á¦ÀÛ¼³Á¤ ÇØÁ¦)
----------------------------------------------------------------------------
// fscommand ·Î javascript ÀÇ º¯¼ö°ª ºÒ·¯¿À±â
1. fscommand ("search", TextFieldvar);     // aaa.swf flash script
2. if (command == "search") {              // aaa.html script
       EEEfind = "FFFFFFFF";
       window.document.aaa.SetVariable("TextFieldvar", EEEfind) ;
       return TextFieldvar;
    };
3. aaa.html ½ÇÇà
----------------------------------------------------------------------------
_root.loadMovie("a.swf");            // swf ÆÄÀÏ ºÒ·¯¿À±â
_root.bbb.loadMovie("a.swf")         // swf ¸¦ ¸ÞÀο¡ ÀÖ´Â bbb¹«ºñŬ¸³¿¡ ºÒ·¯¿À±â
_root.loadMovie("a.swf", 1);         // swf ¸¦ ·¹º§1·Î ºÒ·¯¿À±â (2 ´Â 1¸¦  screen over)
_root.loadMovie("aaa.jpg");          // jpg ÆÄÀÏ ºÒ·¯¿À±â
_root.bbb.loadMovie("aaa.jpg"); // jpg ÆÄÀÏÀ» ¸ÞÀο¡ ÀÖ´Â bbb¹«ºñŬ¸³¿¡ ºÒ·¯¿À±â
unloadMovie (1);                     // ·¹º§ 1¿¡ ·ÎµåµÈ ¹«ºñ¸¦ ¾ð·Îµå
unloadMovie ("a.swf");               // ÇöÀç ¹«ºñ¿¡ ·ÎµåµÈ a.swf ¹«ºñ¸¦ ¾ð·Îµå
_root.bbb.unloadMovie();    // ¸ÞÀΠŸÀÓ¶óÀÎÀÇ bbb ¹«ºñŬ¸³¿¡ ·ÎµåµÈ ¹«ºñ¸¦ ¾ð·Îµå
this["bbb"].unloadMovie();  // ÇöÀç ŸÀÓ¶óÀÎÀÇ bbb ¹«ºñŬ¸³¿¡ ·ÎµåµÈ ¹«ºñ¸¦ ¾ð·Îµå
sss.bbb.unloadMovie();   // sss ½Éº¼ ŸÀÓ¶óÀÎÀÇ bbb ¹«ºñŬ¸³¿¡ ·ÎµåµÈ ¹«ºñ¸¦ ¾ð·Îµå
----------------------------------------------------------------------------
button.onPress = function() { _root.loadMovie("aaa.swf"); }  // aaa.swf ½ÇÇàÁß ÃʱâÈ­ Çϱâ
----------------------------------------------------------------------------
_root["ball_"+counter]._x = 11;       //  ¸ÞÀÎ È­¸éÀÇ Å¬¸³ ÁÂÇ¥
this["ball_"+counter]._x = 11;        //  ÇöÀç È­¸éÀÇ Å¬¸³ ÁÂÇ¥
aaa["ball_"+counter]._x = 11;         //  aaa ½Éº¼ È­¸éÀÇ Å¬¸³ ÁÂÇ¥
----------------------------------------------------------------------------
this.createEmptyMovieClip("aaa", 1);             //  ¹«ºñŬ¸³ »ý¼º (2 ´Â 1¸¦ screen over)
this.duplicateMovieClip (aaa, bbb, 1);           //  aaa ¹«ºñŬ¸³  bbb ·Î º¹»ç
this.bbb.removeMovieClip();                      //  bbb ¹«ºñŬ¸³ »èÁ¦
myClip._visible = true;                   //  Å¬¸³ º¸ÀÓ
myClip._visible = false;                  //  Å¬¸³ °¨Ãã
myClip.swapDepths(100);               //  Å¬¸³ ±íÀÌ 100 À¸·Î ÁöÁ¤ (2 ´Â 1¸¦ screen over)
myClip.swapDepths(otherClip);                    //  Å¬¸³ ±íÀÌ otherClip °ú ¹Ù²Þ
for (i=1; i<=360; i++)  {                        //  Å¬¸³ º¹»ç
     duplicateMovieClip (ins1, "mc"+i, i);
     setProperty ("mc"+i, _x, random(300));
     setProperty ("mc"+i, _y, random(300));
     setProperty ("mc"+i, _alpha, random(300));
     setProperty ("mc"+i, _xscale, 150);
     setProperty ("mc"+i, _yscale, 150);
};  
for (i=1; i<=360; i++)  {                        //  Å¬¸³ º¹»ç
     duplicateMovieClip (ins1, "mc"+i, i);
     this["mc" + i]._x = i;
     this["mc" + i]._y = i;
};  
for (i=1; i<=50; i++)  {                          // Ŭ¸³ À̵¿
      this["mc_"+i]._x += 10;
      this["mc_"+i]._y += 10;
};  
for (i=1; i<=360; i++)  {                         // Ŭ¸³ »èÁ¦
     this["mc" + i].removeMovieClip ();
};  
----------------------------------------------------------------------------
setProperty ("mv", _x, 150);           // mv ¹«ºñŬ¸³ xÁÂÇ¥ ¼Ó¼º º¯°æ
myMovieX = getProperty( mv, _x);       // mv ¹«ºñŬ¸³ xÁÂÇ¥ ¼Ó¼º Àбâ
trace(myMovieX);
----------------------------------------------------------------------------
_alpha              ¾ËÆÄ°ª(%)
_currentframe       ÇöÀçÀç»ýÁßÀÎ ÇÁ·¹ÀÓ(#)
_droptarget         µå·¡±× ¾Øµåµå·Ó ÇÒ¶§ ³õ´Â Ÿ±êÀ§Ä¡(name)
_framesloaded       ·ÎµåµÈ ÇÁ·¹ÀÓ¼ö(#)
_height             ³ôÀÌ(#)
_name               ÀνºÅϽº(string)
_rotation           ȸÀü°ª(#)
_soundbuftime       »ç¿îµå¹öÆÛ¸µ ½Ã°£(±âº»°ª 5ÃÊ:#)
_totalframes        ÃÑÇÁ·¹ÀÓ¼ö(#)
_url                ´Ù¿î·ÎµåÇÑ URL(string)
_visible            º¸ÀδÙ,¾Èº¸Àδ٠(true,false)
_width              °¡·Î±æÀÌ(#)
_x                  xÁÂÇ¥(#)
_y                  yÁÂÇ¥(#)
_xmouse             ¸¶¿ì½ºxÁÂÇ¥(#)
_ymouse             ¸¶¿ì½ºyÁÂÇ¥(#)
_xscale             x¹èÀ²(%)
_yscale             y¹èÀ²(%)
----------------------------------------------------------------------------
_root.a.play;                    //  ¸ÞÀο¡ ÀÖ´Â a¹«ºñŬ¸³  ÇÁ·¹ÀÓ Àç»ý
_root.a.stop;                    //  ¸ÞÀο¡ ÀÖ´Â a¹«ºñŬ¸³  ÇÁ·¹ÀÓ ÁßÁö
play();                          //  stopÀ¸·Î Á¤ÁöµÈ ÇöÀçŸÀÓ¶óÀÎÀÇ ÇÁ·¹ÀÓ Àç»ý
stop();                          //  ÇöÀçŸÀÓ¶óÀÎÀÇ ÇÁ·¹ÀÓ ÁßÁö
gotoAndPlay(1);                  //  ÇöÀç SceneÀÇ 1ÇÁ·¹ÀÓ Àç»ý
gotoAndPlay("a");                //  ÇöÀç SceneÀÇ Label¸í a Àç»ý
gotoAndPlay("Scene 2", "c");     //  Scene 2ÀÇ Label¸í c Àç»ý
a.gotoAndPlay(1);                //  a¹«ºñŬ¸³ÀÇ 1ÇÁ·¹ÀÓ Àç»ý
gotoAndStop(1);                  //  ÇöÀç SceneÀÇ 1ÇÁ·¹ÀÓ ÁßÁö
nextScene();                     //  ´ÙÀ½ Àå¸éÀÇ ÇÁ·¹ÀÓ 1·Î º¸³»°í ÁßÁö
prevSecne();                     //  ÀÌÀü Àå¸éÀÇ ÇÁ·¹ÀÓ 1·Î º¸³»°í ÁßÁö
nextFrame();                     //  ´ÙÀ½ ÇÁ·¹ÀÓÀ¸·Î º¸³»°í ÁßÁö
prevFrame();                     //  ÀÌÀü ÇÁ·¹ÀÓÀ¸·Î º¸³»°í ÁßÁö
toggleHighQuality ();            //  ÀúÇØ»óµµ¿Í °íÇØ»óµµ °£À»  Àüȯ
updateAfterEvent();              //  È­¸éÀ» °»½Å (onClipEvent Çڵ鷯 ³»¿¡¼­¸¸ »ç¿ë)
                                  //  (onMouseDown,  onMouseUp,  onMouseMove)
----------------------------------------------------------------------------
tellTarget ("../a") { nextFrame(); } //  ../a ¹«ºñŬ¸³À» È£ÃâÈÄ ´ÙÀ½ ÇÁ·¹ÀÓ Àç»ý
if (_framesloaded = 10) {  }         // ¸¸¾à ¹«ºñÀÇ 10ÇÁ·¹ÀÓÀÌ ·ÎµåµÇ¸é
----------------------------------------------------------------------------
// with ¹®
for (i=0; i<1000; i++) {
    with (aaa[i]) {
       _x = Math.floor(Math.random() * 500);
       _y = random(500);
       _rotation = random(360);
   }
}
// tellTarget ¹® (¼Óµµºü¸§)
for (i=0; i<1000; i++) {
    tellTarget (aaa[i]) {
       _x = Math.floor(Math.random() * 500);
       _y = random(500);
       _rotation = random(360);
    }
}
----------------------------------------------------------------------------
aaa = new Array();              // ¹è¿­ ÃʱâÈ­    
aaa = new Array("1","2","3");   // ¹è¿­°ª ³Ö±â
bbb = ["Sun","Mon","Tue"];      // ¹è¿­°ª ³Ö±â
aaa[1] = "abc";                 // ¹è¿­°ª º¯È¯  ( "2" °¡ "abc" ·Î º¯È¯)
aaa[0] = "Jan" ;  aaa[1] = "Feb" ;  aaa[2] = "Mar" ;         // ¹è¿­°ª º¯È¯
aaa[3] = "Apr"                  // ¹è¿­ Ãß°¡ (aaa °ªÀº  "Jan,Feb,Mar,Apr" )
ccc = aaa.concat(bbb);          // ¹è¿­ ÇÕħ (ccc °ªÀº  "Jan,Feb,Mar,Apr,Sun,Mon,Tue" )
ddd = ccc.join("/");            // ,¸¦  /·Î º¯È¯  (ddd °ªÀº  "Jan/Feb/Mar/Apr/Sun/Mon/Tue" )
ddd = ccc.length;               // ¹è¿­°ª °¹¼ö (ddd °ªÀº  7 )
ddd = ccc.slice(2,4);           // ¹è¿­°ª Àбâ (ddd °ªÀº  "Mar,Apr" )
eee = ccc.push("z","zz");       // ¹è¿­Ãß°¡ÈÄ  ¹è¿­°ª °¹¼ö (eee °ªÀº  9 )
                                 //  (ccc °ªÀº "Jan,Feb,Mar,Apr,Sun,Mon,Tue,z,zz"   ·Î º¯ÇÔ)
eee = ccc.pop();                // ¸¶Áö¸· ¹è¿­ ºÐ¸®ÈÄ °ª  (eee °ªÀº  "zz" )
                                 //  (ccc °ªÀº  "Jan,Feb,Mar,Apr,Sun,Mon,Tue,z"   ·Î º¯ÇÔ)
eee = ccc.shift();              // ù¹øÂ° ¹è¿­ ºÐ¸®ÈÄ °ª (eee °ªÀº  "Jan" )
                                 //  (ccc °ªÀº  "Feb,Mar,Apr,Sun,Mon,Tue,z"   ·Î º¯ÇÔ)
eee = ccc.reverse();            // ¹è¿­°ª ¼ø¼­¹Ù²Þ (eee °ªÀº  "z,Tue,Mon,Sun,Apr,Mar,Feb" )
                                 //  (ccc °ªµµ  "z,Tue,Mon,Sun,Apr,Mar,Feb"   ·Î º¯ÇÔ)
eee = ccc.splice(2,5,"x","xx","xxx");  // ¹è¿­°ª ÀбâÈÄ  º¯È¯  (eee °ªÀº  "Mon,Sun,Apr,Mar,Feb" )
                                        //  (ccc °ªÀº  "z,Tue,x,xx,xxx"   ·Î º¯ÇÔ)
eee = ccc.unshift("1","2");     // ù¹øÂ° ¹è¿­Ãß°¡ÈÄ  °ª  (eee °ªÀº  "7" )
                                 //  (ccc °ªÀº  "1,2,z,Tue,x,xx,xxx"   ·Î º¯ÇÔ)
sss = new Array(1,2,3);         // ¼ýÀÚ ¹è¿­°ª ³Ö±â
uuu = sss.toString();           // ¹®Àڷκ¯È¯.  °á°ú´Â 1,2,3
vvv = uuu.toLowerCase();        // ´ë¹®ÀÚ¸¦  ¼Ò¹®ÀÚ·Î º¯È¯.  ¿ø·¡ °ªÀº º¯°æµÇÁö ¾ÊÀ½      
vvv = uuu.toUpperCase();        // ¼Ò¹®ÀÚ¸¦  ´ë¹®ÀÚ·Î º¯È¯.  ¿ø·¡ °ªÀº º¯°æµÇÁö ¾ÊÀ½  
xxx = Number("111")             //  ¼ýÀÚ·Î º¯È¯.   °á°ú´Â 111
xxx = Number("aaa")             //  ¼ýÀÚ·Î º¯È¯.   °á°ú´Â NaN
xxx = Number(true)              //  ¼ýÀÚ·Î º¯È¯.   °á°ú´Â 1
xxx = Number(false)             //  ¼ýÀÚ·Î º¯È¯.   °á°ú´Â 0
----------------------------------------------------------------------------
cliparray = new Array();                     // ¹«ºñŬ¸³À» ¹è¿­·Î ÀúÀåÇϱâ
for (a=1; a<=3; a++)  {
     cliparray[a] =  _root["clip"+a];
     cliparray[a].x =  _root["clip"+a]._x;
     cliparray[a].y =  _root["clip"+a]._y;
     trace(cliparray[a].x);
     trace(cliparray[a].y);
}
----------------------------------------------------------------------------
myString = new String();                           // ¹®ÀÚ º¯¼öÃʱâÈ­    
myString = new String("°¡³ª´Ù");                   // ¹®ÀÚ ³Ö±â
tet="°¡³ª´Ù";   myString = new String(tet);        // tet  º¯¼ö ³Ö±â
text0=myString.charAt(0);                          // text0 °ªÀº "°¡"  -  1°³ Àбâ
text1=myString.charAt(1);                          // text1 °ªÀº "³ª"  -  1°³ Àбâ
text2=myString.charAt(2);                          // text2 °ªÀº "´Ù"  -  1°³ Àбâ
text3=myString.concat("¶ó¸¶","¹Ù»ç","´Ù");     // text3 °ªÀº "°¡³ª´Ù¶ó¸¶¹Ù»ç´Ù"  -  Ãß°¡
text4=text3.substr(2,4);                           // text4 °ªÀº "´Ù¶ó¸¶¹Ù"  -  ¿©·¯°³ Àбâ
text5=text3.substring(2,4);                        // text5 °ªÀº "´Ù¶ó"  -  ¿©·¯°³ Àбâ
text6=text3.slice(2,4);                            // text6 °ªÀº "´Ù¶ó"  -  ¿©·¯°³ Àбâ
text7=myString.charCodeAt(1);                      // text7 °ªÀº  45208  - ¹®ÀÚ¸¦ ÄÚµåÈ­
text8="a" + String.fromCharCode(64) + "m";         // text8 °ªÀº "a@m"  - Äڵ带 ¹®ÀÚÈ­
text9= text3.indexOf("´Ù");                        // text9 °ªÀº 2  -  ¹®ÀÚÀ§Ä¡
text10= text3.lastIndexOf("´Ù");                   // text10 °ªÀº 7  -  ¸¶Áö¸· ¹®ÀÚÀ§Ä¡
text11= text3.length;                              // text11 °ªÀº 8  -  ¹®ÀÚ±æÀÌ
text12= text3.split("³ª");                         // text12 °ªÀº "°¡,´Ù¶ó¸¶¹Ù»ç´Ù"  -  ¹®Àںи®
text13= text6.concat(text3);                 // text13 °ªÀº "´Ù¶ó°¡³ª´Ù¶ó¸¶¹Ù»ç´Ù"  -  ¹®ÀÚÇÕħ
text14= text13.substr((text13.length-1),1);        // text14 °ªÀº "´Ù"  -  ¸¶Áö¸· ¹®ÀÚ Àбâ
sss = myDate.toString();  day = sss.substring(0,3);     // ¹®Àڷκ¯È¯        
----------------------------------------------------------------------------
// aaa ¹®ÀåÀ» bbb ¹è¿­·Î ÀúÀåÇϱ⠠                // ¹®ÀåÀ» ¹è¿­·Î ÀúÀåÇϱâ
// °á°ú´Â bbb[0]="a" bbb[1]="b" bbb[2]="c" bbb[3]="d" bbb[4]="e"
aaa = "a b c d e";
aaalen = aaa.length;
bbb = new Array();
for (a=0; a<=aaalen; a++)  { bbb[a] = "";  };
bbbno = 0;   bbbchr = "";
for (a=0; a<=aaalen; a++)  {
if ( aaa.charAt(a) == " " ) {  bbb[bbbno] = bbbchr;   bbbno += 1;   bbbchr = "";  
} else { bbbchr += aaa.charAt(a);   };
};
for (a=0; a<=bbbno; a++)  {  trace( "*" + bbb[a] + "*" )   };  
----------------------------------------------------------------------------
for (a=1; a<=22; a++) {                                       // ÅØ½ºÆ® ÇÊµå ±ÛÀÚ¼Ó¼º
        this["k"+(a)].textColor=0xff0000;
        this["k"+(a)].border=true;
        this["k"+(a)].borderColor=0xff0000;
        this["k"+(a)].background=true;
        this["k"+(a)].backgroundColor=0xffffff;
};
----------------------------------------------------------------------------
TextField.removeTextField();                                   // ÅØ½ºÆ® ÇÊµå »èÁ¦
----------------------------------------------------------------------------
createTextField ("instanceName", depth, x, y, width, height)   // ÅØ½ºÆ® ÇÊµå »ý¼º
      instanceName »õ ÅØ½ºÆ® ÇʵåÀÇ ÀνºÅϽº À̸§
      depth »õ ÅØ½ºÆ® ÇʵåÀÇ ±íÀ̸¦ ÁöÁ¤ÇÏ´Â ¾çÀÇ Á¤¼ö (2 ´Â 1¸¦  screen over)
      x »õ ÅØ½ºÆ® ÇʵåÀÇ x ÁÂÇ¥¸¦ ÁöÁ¤ÇÏ´Â Á¤¼ö
      y »õ ÅØ½ºÆ® ÇʵåÀÇ y ÁÂÇ¥¸¦ ÁöÁ¤ÇÏ´Â Á¤¼ö
      width »õ ÅØ½ºÆ® ÇʵåÀÇ ³ÐÀ̸¦ ÁöÁ¤ÇÏ´Â ¾çÀÇ Á¤¼ö
      height »õ ÅØ½ºÆ® ÇʵåÀÇ ³ôÀ̸¦ ÁöÁ¤ÇÏ´Â ¾çÀÇ Á¤¼ö
instanceName.type = "dynamic";      // ÅØ½ºÆ® ÇʵåÀÇ ±âº» ¼Ó¼º  (dynamic ¶Ç´Â input)
instanceName.autoSize = "false";

// (±ÛÀÚ¼ö¿¡ ¸Â°Ô Å׵θ® Å©±â ÀÚµ¿ Á¶Àý true false center right)
instanceName.border = false;                 // (Å׵θ®)  
instanceName.borderColor = 0xff0000;         // (Å׵θ® »ö»ó)  
instanceName.background = false;             // (¹è°æ)
instanceName.backgroundColor=0xffffff;       // (¹è°æ »ö»ó)
instanceName.textColor = 0xff0000;           // (±ÛÀÚ »ö»ó)
instanceName.multiline = false;              // (ÇÑÁÙ  ¶Ç´Â  ¿©·¯ÁÙ)
instanceName.selectable = true;              // (ÅØ½ºÆ® Çʵ带 ¼±ÅÃÇÒ ¼ö ÀÖ´ÂÁö ¿©ºÎ)
instanceName.maxChars = null; 

//(»ç¿ëÀÚ°¡ ÀÔ·ÂÇÒ ¼ö ÀÖ´Â ÃÖ´ë ¹®ÀÚ ¼ö) (null ÀÌ¸é ¹«ÇÑ´ë)
instanceName.length = 0;                     // (±ÛÀÚ ¼ö)
instanceName._name = "";                     // (ÀνºÅϽº À̸§)
instanceName.variable = "";                  // (º¯¼ö À̸§)
instanceName.html = false;                   // (html ÅÂ±× »ç¿ë ¿©ºÎ)
instanceName.htmlText = "";                  // (html ű×)
instanceName.wordWrap = true;                // (ÀÚµ¿ ÁÙ¹Ù²Þ )
instanceName._x = 0;                         // (x ÁÂÇ¥)
instanceName._y = 0;                         // (y ÁÂÇ¥)
instanceName._width  = 0;                    // (³ÐÀÌ)
instanceName._height = 0;                    // (³ôÀÌ)
instanceName._xscale = 100;                  // (³ÐÀÌ Á¶Àý %)
instanceName._yscale = 100;                  // (³ôÀÌ Á¶Àý %)
instanceName.restrict = "";                  // (ÀÔ·ÂÇÒ ¼ö ÀÖ´Â ¹®ÀÚ ¼¼Æ®)
instanceName.embedFonts = false;             // (ÀåÄ¡ ±Û²Ã »ç¿ë ¿©ºÎ)
instanceName.password = false;               // (****Ç¥½Ã)
instanceName._visible =  true;

 // (º¸ÀÓ/¾Èº¸ÀÓ.  false·Î ¼³Á¤µÈ ÅØ½ºÆ® Çʵå´Â »ç¿ëÇÒ ¼ö ¾øÀ½)
instanceName.scroll = 0;                     // (ÇöÀç ½ºÅ©·Ñ ¼öÁ÷ À§Ä¡)
instanceName.hscroll = 0;                    // (ÇöÀç ½ºÅ©·Ñ ¼öÆò À§Ä¡)
instanceName.maxscroll = 0;                  // (TextField.scrollÀÇ ÃÖ´ë°ª)
instanceName.maxhscroll = 0;                 // (TextField.hscrollÀÇ ÃÖ´ë°ª)
instanceName.text = "";                      // (±ÛÀÚ)

myformat = new TextFormat();                 // ÅØ½ºÆ® ÇʵåÀÇ ±âº» TextFormat ¼Ó¼º
myformat.align = "left";                     // (´Ü¶ôÀÇ Á¤·Ä )
myformat.blockIndent  = 0;                   // (¿ÞÂÊ ¿©¹é¿¡¼­ ºí·Ï µé¿©¾²±â. Æ÷ÀÎÆ® ´ÜÀ§)
myformat.indent  = 0;       // (¿ÞÂÊ ¿©¹é¿¡¼­ ´Ü¶ô µé¿©¾²±â. °¢ ´Ü¶ôÀÇ Ã¹ ÁÙ¿¡¸¸ Àû¿ë)
myformat.bold = false;                       // (ÅØ½ºÆ®°¡ ±½ÀºÃ¼·Î Ç¥½ÃµÇ´ÂÁö ¿©ºÎ)
myformat.bullet = false;                     // (ÅØ½ºÆ®°¡ ºÒ¸´ ¸ñ·Ï¿¡ ÀÖ´ÂÁö ¿©ºÎ * Ç¥½Ã)
myformat.color  = 0x000000;                  // (ÅØ½ºÆ®ÀÇ »ö»ó)
myformat.font = "Times New Roman";           // (ÅØ½ºÆ®ÀÇ ±Û²Ã)
myformat.italic = false;                     // (ÅØ½ºÆ®°¡ ±â¿ïÀÓü·Î Ç¥½ÃµÇ´ÂÁö ¿©ºÎ)
myformat.leading  = 0;                       // (ÁÙ »çÀÌÀÇ Çà°£ ¼¼·Î °£°Ý)
myformat.leftMargin  = 0;                    // (´Ü¶ôÀÇ ¿ÞÂÊ ¿©¹é Æ÷ÀÎÆ® ´ÜÀ§)
myformat.rightMargin  = 0;                   // (´Ü¶ôÀÇ ¿À¸¥ÂÊ ¿©¹é Æ÷ÀÎÆ® ´ÜÀ§)
myformat.tabStops = [ ];                      // (»ç¿ëÀÚ Á¤ÀÇ ÅÇ ÁßÁö¸¦ ÁöÁ¤ // (empty array))
myformat.target = "";                        // (ºê¶ó¿ìÀú¿¡¼­ ÇÏÀÌÆÛ¸µÅ©°¡ Ç¥½ÃµÇ´Â â)
myformat.size = 12;                          // (ÅØ½ºÆ®ÀÇ Å©±â)
myformat.underline = false;                  // (ÅØ½ºÆ®¿¡ ¹ØÁÙÀÌ ±×¾îÁ³´ÂÁö ¿©ºÎ)
myformat.url = "";                           // (ÅØ½ºÆ®°¡ ¸µÅ©µÇ´Â URL)

instanceName.text = "this is my test field \r aaa" + "bbb";    // ÅØ½ºÆ®¿¡ ³»¿ë ³Ö±â
instanceName.setTextFormat(myformat);        //  ÅؽºÆ® ÇʵåÀÇ TextFormat  º¯°æ
----------------------------------------------------------------------------
instanceName.restrict = "A-Z 0-9";           // ´ë¹®ÀÚ, °ø¹é, ¼ýÀÚ¸¸ ÀÔ·ÂÇÒ ¼ö ÀÖÀ½
instanceName.restrict = "^a-z";              // ¼Ò¹®ÀÚ¸¦ Á¦¿ÜÇÑ ¸ðµç ¹®ÀÚ¸¦ ÀÔ·Â
instanceName.restrict = "A-Z^Q";             // ´ë¹®ÀÚ Q¸¦ Á¦¿ÜÇÑ ´ë¹®ÀÚ¸¸ ÀÔ·Â
instanceName.restrict = "\\-"                // ¸¶À̳ʽº ºÎÈ£ (-) ¸¸ ÀÔ·Â
----------------------------------------------------------------------------
aa.html = true;                              // html ÅÂ±× »ç¿ë (b)
aa.htmlText = " this is bold text ";
----------------------------------------------------------------------------
aa.html = true;                              // html ÅÂ±× »ç¿ë (table)
aa.htmlText = "";
aa.htmlText += " Å×À̺íÀÇ ÅØ½ºÆ®1  ";
aa.htmlText += " Å×À̺íÀÇ ÅØ½ºÆ®2 ";
aa.htmlText += " À̵¿ Çϱâ ";
----------------------------------------------------------------------------
function Func(arg){  trace ("You clicked me!  Argument was "+arg);   };  
aa.html = true;                              // html ÅÂ±× »ç¿ë (asfunction)
aa.htmlText = " Click ";  
----------------------------------------------------------------------------
on (release) {TextField.hscroll += 1; }      // ÅØ½ºÆ®¸¦ ¼öÆòÀ¸·Î ½ºÅ©·Ñ
on (release) {TextField.scroll += 1;  }      // ÅØ½ºÆ®¸¦ ¼öÁ÷À¸·Î ½ºÅ©·Ñ
x = TextField.maxscroll;                     // ÃÑ ÁÙ¼ö¸¦ Ç¥½Ã
----------------------------------------------------------------------------
TextField.onSetFocus = function(){           // ÅØ½ºÆ® ÀÔ·Â (ÅØ½ºÆ®ÇÊµå ¼Ó¼ºÀÌ ÀÔ·ÂÀ϶§)
    this.text=" input data ";                 // ¸¶¿ì½º Ŭ¸¯½Ã ³»¿ë ÀÚµ¿ ÀÔ·Â
};
----------------------------------------------------------------------------
// aaa ¿Í bbb ¶õ µÎ°³ÀÇ ÅØ½ºÆ® Çʵ带 ¸¸µçÈÄ
aaa.text="1234567890"
Selection.setFocus("aaa");              // ÅØ½ºÆ® ¸ðµç ¹®ÀÚ Æ÷Ä¿½º. ¹®ÀÚ ¾øÀ¸¸é Ä¿¼­ ±ô¹Ú
Selection.setSelection(2,5);            // (½ÃÀÛÁ¡, ³¡Á¡).  °á°ú´Â "345" Æ÷Ä¿½º
bbb.text = Selection.getBeginInde

¾×¼Ç½ºÅ©¸³Æ® | 2008-04-29 14:12:38
Hit : 10

_url

 

swf ÆÄÀÏ , ¹«ºñŬ¸³, ·Îµå¹«ºñµÈ ¹«ºñŬ¸³ÀÌ ÀÖ´Â °æ·Î¸¦ ¾Ë ¼ö ÀÖ´Ù.

 

1.ÇöÀç Àç»ýµÇ°í ÀÖ´Â Ç÷¡½ÃÆÄÀÏÀÇ url ¶Ç´Â °æ·Î¸¦ °¡Á®¿Â´Ù.

 

 _root._url

 

2. ÇöÀç Àç»ýµÇ°í ÀÖ´Â ¹«ºñŬ¸³ÀÌ ¼ÓÇÑ url

 

movieclip_name._url

 

movieclip_name : ÀÓÀÇÀÇ ¹«ºñŬ¸³ ÀνºÅϽº³×ÀÓ

 

3. ·Îµå¹«ºñ¸¦ ÇßÀ» °æ¿ì  

 

movieclip_name._url

 

¾îµð¿¡¼­ ·Îµå¸¦ Çß´ÂÁö ±× °÷ÀÇ urlÀ» °¡Á®¿Â´Ù.

¾×¼Ç½ºÅ©¸³Æ® | 2008-03-28 09:55:24
Hit : 34
Ç÷¡½Ã as2.0À¸·Î ¸¸µç°Í
¾×¼Ç½ºÅ©¸³Æ® | 2008-03-15 22:29:53
Hit : 43
µ¿¿µ»ó °­ÀÇ À§Ä¡
¾×¼Ç½ºÅ©¸³Æ® | 2008-02-12 12:16:17
Hit : 15
// ¸Å ÇÁ·¹ÀÓ¸¶´Ù angma¿Í musikÀÇ Ãæµ¹¿©ºÎ °Ë»ç
_root.angma.onEnterFrame = function() {
if (this.hitTest(_root.musik)==true) {
this._alpha = 50;
} else {
this._alpha = 100;
}
};
¾×¼Ç½ºÅ©¸³Æ® | 2008-02-12 12:14:27
Hit : 48

##########ÁßÇб³ ¼öÇÐ ¾×¼Ç¿¡¼­ ¾²´Â°Å################

Àý´ë°ª Ç¥Çö

onClipEvent(enterFrame){

 distance = MAth.abs(this._y - _root._ymouse);

this._xscale = 100 - distance/4;

}

 

ÀÌÂ÷¿ø»óÀÇ Æò¸é»óÀÇ °Å¸®

ÇÇŸ°í¶ó½º °ø½Ä ÀÌ¿ë

c2 = a2+b2;

function distance(x1,x2,y1,y2)

{

     var diffx = x2-x1;

     var  diffy = y2-y1;

    var r =Math.sqrt(diffx*diffx + diffy*diffy);

return r;

}

 

»ï°¢ ÇÔ¼ö ¿ø¿îµ¿

onClipEvent(load)

{

  var t =0; //°¢µµ ÃʱⰪ

}

onClipEvent(enterFrame){

 this._x = 100 + 50*Math.cos(t);

 this._y = 100 + 50*Math.sin(t);

t = t+0.1; // + ½Ã°è¹æÇâ    - ¹Ý½Ã°è¹æÇâ

}

Áß½ÉÀÌ (100,100 ) ÀÌ°í ¹ÝÁö¸§ÀÌ 50ÀÎ ¿ø

¾×¼Ç½ºÅ©¸³Æ® | 2007-12-07 10:56:37
Hit : 132

//¼Ò½ºÁ¡ ó¸®
function number_format(_text)
{
 b=_text+"c";
 c=b.length;
 a=b.substr(0,c-1);
 b=a.length ;
 c=b/3 ;
 f=Math.floor(b/3) ;
 d=Math.round((c-f)*3) ;
 e=Math.round((c-f)*3)
 f=new Array;
 for (i=0;i<=c;i++)
 {
  if(i==0){
   ds=a.substr(0,d)
  }
  else if(i==1){
   ds=a.substr(e,d)
  }
  else {
   e=e+3 ;
   ds=a.substr(e,d)
  }
 f[i]=ds ;
 d=3;
 }
 str=f.join(",");
 str2=str.substr(0,1) ;
 if (str2==","){
  str=str.substr(1,b+c) ;
 }
 return str;

}


function view_tooltip(_xpos, _ypos, id, _text)
{
    _root.tooltip._visible = true;
    _root.tooltip._x = _xpos;
    _root.tooltip._y = _ypos - 30;
    for (i = 1; i <= 7; i++)
    {
        if (id._name == this["g" + i]._name)
        {
            this["g" + i]._alpha = 100;
            continue;
        } // end if
        this["g" + i]._alpha = 30;
    } // end of for
    _root.tooltip.tooltip_text.text = number_format(_text);
} // End of the function
function hidden_tooltip()
{
    _root.tooltip._visible = false;
    for (i = 1; i <= 7; i++)
    {
        this["g" + i]._alpha = 100;
    } // end of for
} // End of the function
for (i = 1; i <= 7; i++)
{
    this["g" + i]._height = 1;
} // end of for
var hei_temp = _graph_height;
var _xtext_temp = _graph_x;
var val_text_temp = _graph_tooltip;
var _ytext_temp = _graph_y;
var hei = hei_temp.split(",");
var _xtext = _xtext_temp.split(",");
var val_text = val_text_temp.split(",");
var _ytext = _ytext_temp;
var old_max = 0;
for (i = 0; i < 6; i++)
{
    k = i + 1;
    var max_hei = Math.max(hei[i], hei[k]);
    if (old_max < max_hei)
    {
        old_max = max_hei;
    } // end if
    max_heis = Math.max(old_max, max_hei);
} // end of for
var view_rate = Math.round(34 * max_heis / _ytext);
for (i = 0; i < 5; i++)
{
    var j = _ytext - _ytext * (i / 4);
    this["_y" + i].text = Math.ceil(_ytext - j);
} // end of for
this.onEnterFrame = function ()
{
    for (i = 1; i <= 7; i++)
    {
        var _loc3 = i - 1;
        var _loc4 = Math.ceil(136 * hei[_loc3] / _ytext);
        if (_loc4 > 160)
        {
            _loc4 = Math.ceil(_loc4 / 160);
        }
        else
        {
            _locs = Math.ceil(_loc4);
        } // end else if
        if (this["g" + i]._height >= _loc4)
        {
            this["g" + i]._height = _loc4;
        }
        else
        {
            this["g" + i]._height = this["g" + i]._height + 10;
        } // end else if
        this["_x" + i].text = _xtext[_loc3];
        this["g" + i].onRollOver = function ()
        {
            var _loc3 = substring(this._name, 2, 1) - 1;
            view_tooltip(this._x, _root._ymouse, this, val_text[_loc3]);
        };
        this["g" + i].onRollOut = function ()
        {
            hidden_tooltip();
        };
    } // end of for
};

¾×¼Ç½ºÅ©¸³Æ® | 2007-11-26 18:26:25
Hit : 127

function create_movieClip(id,hei,_xpos,tit)
{
 //¹«ºñŬ¸³ »ý¼º
 var mc = this.createEmptyMovieClip(id,this.getNextHighestDepth());
 //¼­ºê ¹«ºñŬ¸³ »ý¼ºÇؼ­ ±×·¡ÇÁ·® ÃøÁ¤
 var sub_mc = this.createEmptyMovieClip(id+"_sub",this.getNextHighestDepth());
  sub_mc.beginFill(0x000000,50);
  sub_mc.moveTo(_xpos,300);
  sub_mc.lineTo(_xpos+50,300); 
  sub_mc.lineTo(_xpos+50,300-hei); 
  sub_mc.lineTo(_xpos,300-hei);  
  sub_mc.lineTo(_xpos,300); 
  sub_mc.endFill();
  sub_mc._xscale = 20;
 //ÅØ½ºÆ® ÇÊµå »ý¼º  
 mc.createTextField("text_field",1,(_xpos/5)-10,300,50,30); 
 //ÅØ½ºÆ® Çʵ忡 À̸§ ÀÔ·Â
 mc.text_field.text =tit; 
}

 var temp_a = a.split(",");
 var temp_b = b.split(",");
 var temp_c = c.split(",");
var movie_name = temp_a;//new Array("em_a","em_b","em_c");
var movie_height = temp_b;//new Array("em_a","em_b","em_c");
var movie_title_name = temp_c;//new Array("em_a","em_b","em_c");


var pos = 0;
//this.onEnterFrame = function() {
 for(var i =0; i {
  pos = pos + 200;
  create_movieClip(movie_name[i],movie_height[i],pos,movie_title_name[i]);
 }

//}

<script>
var a = new Array("t1","t2","t3","t4","t5","t6","t7","t8","t9","t10");
var b = new Array("100","100","130","32","54","100","100","130","32","54");
var c = new Array("µð¾Ø¼¥","ÇÑ2","ÇÑ3","ÇÑ4","ÇÑ5","ÇÑ1","ÇÑ2","ÇÑ3","ÇÑ4","ÇÑ5");
//var a =30;
//var b = 40;
//var c= 50;


document.write("<embed src='test2.swf?a="+a+"&b="+b+"&c="+c+"' width=1000 height=500></embed>");
</script>

¾×¼Ç½ºÅ©¸³Æ® | 2007-05-18 00:12:20
Hit : 175

Flash 8¿¡¼­ ExternalInterface »ç¿ëÇϱâ

±èÁ¤Çå

Macromedia Korea, User Interface Architect

¼Ò°³

¸¹Àº Ç÷¡½Ã À¥»çÀÌÆ®¿¡¼­ Ç÷¡½Ã ÀÚüÀûÀ¸·Î ÇØ°á ÇÒ ¼ö ¾ø´Â ºÎºÐµéÀ» ¼­¹ö»çÀ̵å ÇÁ·Î±×·¥ÀÇ µµ¿òÀ» ¹Þ¾Æ¼­ ÇØ°áÇÕ´Ï´Ù. ¼­¹ö»çÀ̵å ÇÁ·Î±×·¥ÀÇ µµ¿òÀ» ¹ÞÀ»·Á¸é Ç÷¡½Ã¿¡¼­ Javascript À» È£ÃâÀ» Çϰųª Javascript ¿¡¼­ Flash¸¦ È£ÃâÇÏ¿© Javscript ¿Í Flash °¡ ¼­·Î Åë½ÅÀ» ÇÏ¿© ¹®Á¦¸¦ ÇØ°á ÇÏ¿´½À´Ï´Ù. Flash mx2004 ¹öÀü±îÁö´Â Flash ¿¡¼­ getURL() ¶Ç´Â fscommand()·Î Javascript °ú Åë½Å ÇÏ¿´°í Javascript ¿¡¼­´Â SetVariable(), callFrame(), callLable() µîÀ» ÅëÇØ Flash¿Í Åë½ÅÀ» ÇÏ¿´½À´Ï´Ù.

Flash 8 ¿¡¼­´Â Flash ¿Í ¿ÜºÎ ÇÁ·Î±×·¥°£¿¡ Á÷Á¢ Åë½ÅÀ» °¡´ÉÇÏ°Ô ÇÏ´Â ¿ÜºÎ API(ÀÀ¿ë ÇÁ·Î±×·¡¹Ö ÀÎÅÍÆäÀ̽º)ÀÎ ExternalInterface Ŭ·¡½º°¡ »õ·ÎÀÌ Ãß°¡ µÇ¾ú½À´Ï´Ù. ´ÙÀ½¿¡¼­´Â ExternalInterface Ŭ·¡½º¿¡ ´ëÇØ¼­ ÀÚ¼¼È÷ ¾Ë¾Æº¸°Ú½À´Ï´Ù.

¿ä±¸ »çÇ×

ÀÌ ÀÚ½À °úÁ¤À» ¼öÇàÇÒ·Á¸é ´ÙÀ½°ú °°Àº ¼ÒÇÁÆ®¿þ¾î¿Í ÆÄÀÏÀÌ ÇÊ¿äÇÕ´Ï´Ù.

Macromedia Flash Professional 8

ÀÚ½À¼­ ¹× »ùÇà ÆÄÀÏ


ÇÊ¿äÇÑ ¹è°æ Áö½Ä

JavaScript¿¡ ´ëÇÑ »çÀüÁö½ÄÀÌ ÇÊ¿äÇÕ´Ï´Ù.

Flash 8 Ç÷¡À̾ º¯°æµÈ º¸¾È »çÇ×

Ç÷¡½Ã Ç÷¡À̾î 8 ¿¡¼­´Â Ç÷¡À̾î 7 ¹öÀü°ú ´Ù¸¥ ´ÙÀ½°ú °°Àº Á¦ÇÑ »çÇ×ÀÌ ÀÖ½À´Ï´Ù.

  • ·ÎÄà »÷µå¹Ú½º

    ±âº»ÀûÀ¸·Î ·ÎÄà SWF´Â ´õ ÀÌ»ó ÀÎÅͳݿ¡ ¿¬°áÇϰųª, HTTP Åë½ÅÀ» ¼öÇàÇϰųª ·ÎÄà HTML ÆÄÀϰú Åë½ÅÇÒ ¼ö ¾ø½À´Ï´Ù. SWF 7 ÀÌÀü ¹öÀü¿¡¼­ ÀÌ¿Í °°Àº ÀÛ¾÷À» ¼öÇàÇÏ·Á°í ½ÃµµÇÏ¸é °æ°í ´ëÈ­ »óÀÚ¿¡ ÇØ´ç ÀÛ¾÷À» ¼öÇàÇÒ ¼ö ¾ø´Ù´Â ¸Þ½ÃÁö°¡ Ç¥½ÃµË´Ï´Ù. ÀÌ ´ëÈ­ »óÀÚÀÇ ¸ð¾çÀ̳ª ±âÁ¸ ³»¿ë¿¡¼­ ±úÁø ºÎºÐÀº ÃÖÁ¾ »ç¿ëÀÚ³ª Flash °³¹ßÀÚ°¡ ¾Ë¸ÂÀº ±ÇÇÑÀ» ºÎ¿©Çؼ­ ¼öÁ¤ÇÒ ¼ö ÀÖ½À´Ï´Ù.

  • ·Îµå Á¦ÇÑ »çÇ×

    ÀÌÁ¦ ·ÎÄÃÀÌ ¾Æ´Ñ URLÀÇ SWF ¹× HTML ³»¿ë¿¡¼­ ·ÎÄà °æ·ÎÀÇ ³»¿ë(SWF, HTML, PNG µî)À» ·ÎµåÇÒ ¼ö ¾ø½À´Ï´Ù.

  • Ÿ»ç ÀúÀå¼Ò

    ÀÌÁ¦ Flash Player »ç¿ëÀڴ Ÿ»ç SWF(ºê¶ó¿ìÀúÀÇ ÁÖ¼Ò Ç¥½ÃÁÙ¿¡ Ç¥½ÃµÈ µµ¸ÞÀΰú ´Ù¸¥ µµ¸ÞÀÎÀÇ SWF)¿¡¼­ ¿µ±¸ °øÀ¯ °´Ã¼¸¦ Àаųª ¾²Áö ¸øÇϵµ·Ï ¼±ÅÃÇÒ ¼ö ÀÖ½À´Ï´Ù. ÀÌ Á¦ÇÑ »çÇ×Àº ±âº»ÀûÀ¸·Î Àû¿ëµÇÁö ¾ÊÀ¸¹Ç·Î »ç¿ëÀÚ°¡ Àû¿ë ¿©ºÎ¸¦ ¹Ì¸® °áÁ¤ÇØ¾ß ÇÕ´Ï´Ù.

  • allowScriptAccess ±âº»°ª

    SWF 8 ÀÌ»ó ¹öÀü¿¡¼­ HTML allowScriptAccess ¸Å°³ º¯¼öÀÇ ±âº»°ªÀº "always"°¡ ¾Æ´Ï¶ó "sameDomain"ÀÔ´Ï´Ù. À̰ÍÀº SWF 7 ÀÌÀü ¹öÀü¿¡´Â Àû¿ëµÇÁö ¾Ê½À´Ï´Ù. allowScriptAccess ¸Å°³ º¯¼ö´Â SWF¿¡¼­ HTML ÆäÀÌÁöÀÇ JavaScript¸¦ È£ÃâÇÒÁö ¿©ºÎ¸¦ Á¦¾îÇÕ´Ï´Ù.

À§ÀÇ 4°¡Áö Á¦ÇÑ »çÇ× Áß Flash – Javascript ÀÇ Åë½Å°ú °ü·ÃÇØ¼­´Â allowScriptAccess ºÎºÐÀÌ ¹ÐÁ¢ÇѰü°è°¡ ÀÖ½À´Ï´Ù.

allowScriptAccess ÀÇ ¼¼ÆÃÀº ´ÙÀ½°ú °°½À´Ï´Ù.

  • allowScriptAccess°¡ "never"ÀÌ¸é ¾Æ¿ô¹Ù¿îµå ½ºÅ©¸³ÆÃÀº Ç×»ó ½ÇÆÐÇÕ´Ï´Ù. 
  • allowScriptAccess°¡ "always"ÀÌ¸é ¾Æ¿ô¹Ù¿îµå ½ºÅ©¸³ÆÃÀº Ç×»ó ¼º°øÇÕ´Ï´Ù. 
  • allowScriptAccess°¡ "sameDomain"(¹öÀü 8ºÎÅÍ SWF ÆÄÀÏ¿¡¼­ Áö¿ø)ÀÎ °æ¿ì SWF ÆÄÀÏÀÌ È£½ºÆÃÇÏ´Â À¥ ÆäÀÌÁö¿Í °°Àº µµ¸ÞÀο¡ ÀÖÀ¸¸é ¾Æ¿ô¹Ù¿îµå ½ºÅ©¸³ÆÃÀÌ Çã¿ëµË´Ï´Ù. 
  • HTML ÆäÀÌÁö¿¡ allowScriptAccess°¡ ÁöÁ¤µÇ¾î ÀÖÁö ¾ÊÀ¸¸é ±âº»°ªÀº ¹öÀü 8 SWF ÆÄÀÏÀÇ °æ¿ì "sameDomain"ÀÌ°í ±× ÀÌÀü ¹öÀüÀÇ SWF ÆÄÀÏÀÇ °æ¿ì "always"ÀÔ´Ï´Ù.

µû¶ó¼­ À¥¿¡¼­´Â °°Àº µµ¸ÞÀÎÀÇ °æ¿ì¸¸ Javascript ÇÔ¼ö°¡ È£Ãâ µÇ°í ´Ù¸¥ µµ¸ÞÀΰú ·ÎÄÿ¡¼­ Å×½ºÆ® ÇÒ ½Ã¿¡´Â allowScriptAccess = "always" ·Î º¯°æÀ» ÇØ ÁÖ¼Å¾ß ÇÕ´Ï´Ù.

Flash ¿¡¼­ HTML À» Publish ÇÏ¸é ´ÙÀ½°ú °°Àº Äڵ尡 »ý¼ºÀÌ µË´Ï´Ù.

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr" />
<title>allowScriptAccess</title>
</head>
<body bgcolor="#ffffff">
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="550" height="400" id="allowScriptAccess" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="movie" value="allowScriptAccess.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /><embed src="allowScriptAccess.swf" quality="high" bgcolor="#ffffff" width="550" height="400" name="allowScriptAccess" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</body>
</html>

À§ÀÇ ÄÚµå Áß ÇÏÀ̶óÀÌÆ®ÇÑ ÄÚµåÀÎ allowScriptAccess="sameDomain" ¸¦ allowScriptAccess = "always" ·Î º¯°æÀ» ÇØ ÁÖ¼Å¾ß ÇÕ´Ï´Ù.

Flash 8 ÀÌÀü ¹öÀü¿¡¼­ÀÇ Åë½Å¹æ¹ý

Ç÷¡½Ã 8 ÀÌÀü ¹öÀü¿¡¼­ Falsh – Javascript °£ÀÇ Åë½Å ¹æ¹ýÀº getURL() , fscommand() ¸¦ »ç¿ëÇÏ¿´°í,. Javascript- Flash °£ÀÇ Åë½Å¹æ¹ýÀº SetVariable() À» »ç¿ë Çß½À´Ï´Ù.

getURL

Ç÷¡½Ã¿¡¼­ Javascript ¸¦ È£ÃâÇÏ´Â °¡Àå ½¬¿î ¹æ¹ýÀº getURL() À» ÀÌ¿ëÇÏ´Â °ÍÀÔ´Ï´Ù. Ç÷¡½Ã¿¡¼­ Javaccript ÀÇ callJavascript() ÇÔ¼ö·Ñ È£ÃâÇÏ´Â ´ÙÀ½ÀÇactinoscript ¸¦ ÀÛ¼ºÇÕ´Ï´Ù.

var msg:String = "'¾È³çÇϼ¼¿ä. ^^'";
var callJas:String = 'javascript:callJavascript('+msg+')';
getURL(callJas);

HTML ¿¡¼­´Â <head> ¿Í<body> »çÀÌ¿¡ ´ÙÀ½°ú °°ÀÌ Javaccript ÇÔ¼ö¸¦ ÀÛ¼ºÇÕ´Ï´Ù.

Ç÷¡½Ã¿¡¼­ JavscriptÀÇ ÇÔ¼ö callJavascript ¸¦ È£ÃâÇÏ°í ¸Å°³º¯¼ö·Î msg ÀÎ ¡°¾È³çÇϼ¼¿ä.^^¡± ¹®ÀÚ¿­À» º¸³À´Ï´Ù. µû¶ó¼­ °á°ú´Â ´ÙÀ½ ±×¸² 1°ú °°½À´Ï´Ù.

<script language="JavaScript">
function callJavascript(str){
alert(str)
}
</script>

Ç÷¡½Ã¿¡¼­ JavaScriptÀÇ ÇÔ¼ö callJavascript ¸¦ È£ÃâÇÏ°í ¸Å°³º¯¼ö·Î msg ÀÎ ¡°¾È³çÇϼ¼¿ä.^^¡± ¹®ÀÚ¿­À» º¸³À´Ï´Ù. µû¶ó¼­ °á°ú´Â ´ÙÀ½ ±×¸² 1°ú °°½À´Ï´Ù.

alert â

±×¸² 1. alert â

getURL() À» ÀÌ¿ëÇÑ Javascript È£ÃâÀº ¹®¹ý»óÀ¸·Î ¾ÆÁÖ ½¬¿î ¹Ý¸é Ç÷¡½Ã Ç÷¡À̾ Æ÷ÇÔµÈ ºê¶ó¿ìÀúÀÇ È¯°æÀ» °Çµå·Á¼­ gif ¿¡´Ï¸ÞÀ̼ÇÀÌ ¸ØÃß´Â Çö»óÀ» ¹ß»ý ½Ãŵ´Ï´Ù.

ÁÖÀÇ: ·ÎÄÿ¡¼­ Å×½ºÆ® ÇÒ ¶§ ¿¡´Â Ç÷¡½Ã Ç÷¡À̾î 8ÀÇ È¯°æ¿¡¼­´Â allowScriptAccess="sameDomain" À» allowScriptAccess="always" ·Î º¯°æ ÇØ¾ß ÇÕ´Ï´Ù. ¶ÇÇÑ Àü¿ª º¸¾È ¼³Á¤ ÆÐ³Î¿¡¼­ swf ÆÄÀÏ¿¡ ´ëÇÑ Á¢±ÙÀ» Çã¿ëÇÏ¿©¾ß Á¤»óÀûÀ¸·Î º¸ÀÔ´Ï´Ù.

fscommand

fscommand() ´Â SWF ÆÄÀÏÀÌ Flash Player³ª À¥ ºê¶ó¿ìÀú °°ÀÌ FlashPlayer¸¦ È£½ºÆÃÇÏ´Â ÇÁ·Î±×·¥°ú Åë½ÅÇÒ ¼ö ÀÖµµ·Ï ÇÕ´Ï´Ù. Ç÷¡½Ã¿¡¼­ Javaccript ÀÇ callJavascript() ÇÔ¼ö·Ñ È£ÃâÇÏ´Â ´ÙÀ½ÀÇactinoscript ¸¦ ÀÛ¼ºÇÕ´Ï´Ù.

var msg:String = "'¾È³çÇϼ¼¿ä. ^^'"; var callJas:String = "callJavascript"; fscommand(callJas, msg);

Ç÷¡½ÃÀÇ Publish Setting ¼³Á¤(ctrl+shift+ F12) ¿¡¼­ ±×¸² 2¿Í °°ÀÌ HTML ÅÇÀ» ¼±ÅÃÇϰí Template ¿¡¼­ Flash with FSCommand ¸¦ ¼±ÅÃÇϰí Publish ÇÕ´Ï´Ù.

Publish Setting ¼³Á¤

±×¸² 2. Publish Setting ¼³Á¤

Publish ÇÑ HTML ÆäÀÌÁö¸¦ º¸¸é ´ÙÀ½°ú Javascript °¡ ¼³Á¤ÀÌ µÇ¾î ÀÖ½À´Ï´Ù.

<script language="JavaScript">
<!--
var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the FSCommand messages in a Flash movie.
function fscommand_DoFSCommand(command, args) {
var fscommandObj = isInternetExplorer ? document.all.fscommand : document.fscommand;
//
// Place your code here.
//
}
// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
document.write('<script language=\"VBScript\"\>\n');
document.write('On Error Resume Next\n');
document.write('Sub fscommand_FSCommand(ByVal command, ByVal args)\n');
document.write(' Call fscommand_DoFSCommand(command, args)\n');
document.write('End Sub\n');
document.write('</script\>\n');
}
//-->
</script>

À§ÀÇ Äڵ忡¼­ Ç÷¡½Ã À¯Àú°¡ ´Ù·ç¾î¾ß ÇÒ ºÎºÐÀº ÇÏÀ̶óÀÌÆ®ÇÑ ÄÚµå ºÎºÐ Áß Place your code here ºÎºÐÀÔ´Ï´Ù.

Áï ÇÔ¼ö ¾È¿¡¼­ Command ¿Í args ¸¦ ¹Þ¾Æ¼­ ó¸®ÇÏ¸é µË´Ï´Ù.

¾Æ·¡´Â command ¿Í args ¸¦ ¹Þ¾Æ¼­ alert âÀ» ¶Ù¿ì´Â ÄÚµå ÀÔ´Ï´Ù.

function fscommand_DoFSCommand(command, args) {
var fscommandObj = isInternetExplorer ? document.all.fscommand : document.fscommand;
//
if(command=="callJavascript") {
alert(args)
}
//
}

fscommand ´Â VBScript¸¦ ÀÌ¿ëÇÏ¿© Åë½ÅÀ» Çϱ⠶§¹®¿¡ ´Ù¸¥ VBScript¿Í Ãæµ¹ÀÌ ³¯ È®·üÀÌ ÀÖ°í, ¸Å°³º¯¼ö¸¦ 1°³¸¸ Àü´Þ ÇÒ ¼ö Àֱ⠶§¹®¿¡ 2°³ ÀÌ»óÀÇ ¸Å°³º¯¼ö¸¦ Àü´ÞÇϱâ À§Çؼ­´Â Javascript ÇÔ¼ö¿¡¼­ split ¸¦ ÀÌ¿ëÇÏ¿© ó¸® ÇÏ¿©¾ß ÇÕ´Ï´Ù.

´ÙÀ½ÀÇ ÄÚµå´Â 2°³ ÀÌ»óÀÇ ¸Å°³º¯¼ö¸¦ Àü´Þ ÇÏ´Â fscommand ÀÇ »ç¿ë ¿¹ ÀÔ´Ï´Ù.

Ç÷¡½Ã¿¡¼­´Â ´ÙÀ½°ú °°Àº Äڵ带 ÀÛ¼ºÇÕ´Ï´Ù.

var msg:String = "'¾È³çÇϼ¼¿ä. ^^'#¹Ý°©½À´Ï´Ù.*^^*";
var callJas:String = "callJavascript";
fscommand(callJas, msg);

¿©±â¼­ # Àº ±¸ºÐÀÚÀÇ ¿ªÇÒÀ» ÇÕ´Ï´Ù.

Javascript ÀÇ fscommand_DoFSCommand () ÄÚµå´Â ´ÙÀ½°ú °°½À´Ï´Ù.

function fscommand2_DoFSCommand(command, args) {
var fscommand2Obj = isInternetExplorer ? document.all.fscommand2 : document.fscommand2;
//
if(command=="callJavascript") {
arg = args.split("#")
alert(arg[0]+'\n'+arg[1])
}
//
}

À§ Äڵ忡¼­ º¸¸é #ÀÇ ±¸ºÐÀÚ·Î ¹®ÀÚ¿­À» ºÐ¸®Çؼ­ alert â¿¡ \n À» ÀÌ¿ëÇÏ¿© ÁٹٲÞÀ» Çϰí ù¹øÂ° ÀÎÀÚ¿Í µÎ¹øÂ° ÀÎÀÚ¸¦ ÁÙ¹Ù²Þ ÇÏ¿© ±×¸² 3°ú °°ÀÌ alert âÀ¸·Î º¸¿©ÁÝ´Ï´Ù.

2°³ÀÇ ¸Å°³º¯¼öÀÇ °ªÀ» È®ÀÎ ÇÏ´Â alert â

±×¸² 3. 2°³ÀÇ ¸Å°³º¯¼öÀÇ °ªÀ» È®ÀÎ ÇÏ´Â alert â

ÁÖÀÇ: ·ÎÄÿ¡¼­ Å×½ºÆ® ÇÒ ¶§ ¿¡´Â Ç÷¡½Ã Ç÷¡À̾î 8ÀÇ È¯°æ¿¡¼­´Â allowScriptAccess="sameDomain" À» allowScriptAccess="always" ·Î º¯°æ ÇØ¾ß ÇÕ´Ï´Ù.

 

SetVariable

Javaccript ¿¡¼­ Flash ¿Í Åë½ÅÇÏ´Â ¹æ¹ýÀº ¸¹Àº ¸Þ½îµå¸¦ ÅëÇØ¼­ ÇÒ ¼ö ÀÖÁö¸¸ ±× Áß¿¡¼­ SetVariable() ÀÌ °¡Àå ¸¹ÀÌ ¾²ÀÔ´Ï´Ù. SetVariable()Àº Javascript ¿¡¼­ Ç÷¡½Ã¿¡¼­ÀÇ Á¤ÀÇÇÑ º¯¼öÀÇ °ªÀ» Ç÷¡½Ã·Î ³Ñ°ÜÁÖ´Â ¸Þ½îµå ÀÔ´Ï´Ù. Ç÷¡½Ã´Â º¯¼ö°¡ º¯°æÀÌ µÇ¸é À̺¥Æ®¸¦ ¹ß»ý½ÃŰ´Â watch() ¸Þ½îµå¸¦ ÅëÇØ¼­ °ªÀÌ º¯°æ µÉ ¶§¸¶´Ù callback ÇÔ¼ö¸¦ È£ÃâÇÏ¿© Åë½ÅÀ» ÇÕ´Ï´Ù.

´ÙÀ½ÀÇ Äڵ带 Flash ¿¡ ÀÛ¼ºÇÕ´Ï´Ù.

var testValue:String = "";
// º¯¼ö°¡ º¯°æµÇ¸é ½ÇÇàµÇ¾îÁú callback ÇÔ¼ö
watchCallback = function (id, oldval, newval):String {
//º¯°æµÈ °ªÀº newval À» ÅëÇØ ¹Þ½À´Ï´Ù.
result_txt.text = newval;
return newval;
};
_root.watch("testValue", watchCallback);

À§ÀÇ ÄÚµå´Â testValue ¶ó´Â °ªÀÌ º¯°æÀÌ µÉ ¶§¸¶´Ù watchCallback ÇÔ¼ö¸¦ È£ÃâÇÏ´Â ÄÚµåÀÔ´Ï´Ù. Callback ÇÔ¼ö°¡ È£ÃâÀÌ µÇ¸é _root ¿¡ ÀÖ´Â result_txt ÅØ½ºÆ®¿¡ º¯°æµÈ °ªÀ» º¸¿© ÁÝ´Ï´Ù.

´ÙÀ½ÀÇ ÄÚµå´Â body ¾È¿¡ µé¾î°¡´Â ÄÚµåÀÔ´Ï´Ù.

<input type=button value="Ç÷¡½Ã·Î º¯¼ö ³Ñ±â±â" onClick="callJavascript()">
<form name="inputValue">
Value <input type="text" name="vars" size="10" >
</form>

HTML ÀÇ ÀÎÇ²ÅØ½ºÆ®¿¡ ÀÔ·ÂµÈ °ªÀ» inputValueÀÇ vars ¶ó´Â ¼Ó¼ºÀ¸·Î ÀúÀåÀ» ÇÏ°í ¡°Ç÷¡½Ã·Î º¯¼ö ³Ñ±â±â¡± ¹öưÀ» Ŭ¸¯Çϸé callJavascript() ÇÔ¼ö¸¦ È£ÃâÇÕ´Ï´Ù.

´ÙÀ½ÀÇ ÄÚµå´Â Javascript ÄÚµåÀÔ´Ï´Ù.

<script language="JavaScript">
function callJavascript(){
var sendText = inputValue.vars.value
   window.document.setVariable.SetVariable("testValue", sendText);
}
</script>

ÇÏÀ̶óÀÌÆ®ÇÑ ºÎºÐÀÇ Äڵ带 »ìÆìº¸¸é
window.document.FlashID.SetVariable(º¯¼ö, °ª) ÀÇ ±âº»Çü½Ä¿¡¼­ callJavascript() ÇÔ¼ö´Â SetVariable ¸Þ½îµå¸¦ ÅëÇØ testValue ÀÇ °ªÀ» sendText ·Î º¸³»±â À§ÇØ ¾Æ·¡¿Í °°Àº ÄÚµå·Î ÀÛ¼ºÀÌ µÇ¾ú½À´Ï´Ù.

window.document.setVariable.SetVariable("testValue", sendText);
HTML ¿¡¼­ Javascript À» ÅëÇØ¼­ Ç÷¡½Ã·Î °ªÀ» Àü´Þ

±×¸² 4. HTML ¿¡¼­ Javascript À» ÅëÇØ¼­ Ç÷¡½Ã·Î °ªÀ» Àü´Þ

ExternalInterface class

ExternalInterface class´Â ActionScript¿Í Flash Player ÄÁÅ×À̳Ê(¿¹: JavaScript HTML ÆäÀÌÁö ¶Ç´Â Flash Player¸¦ Æ÷ÇÔÇÑ µ¥½ºÅ©Åé ÀÀ¿ë ÇÁ·Î±×·¥) »çÀÌÀÇ Á÷Á¢ Åë½ÅÀ» °¡´ÉÇÏ°Ô ÇÏ´Â ¿ÜºÎAPI(ÀÀ¿ë ÇÁ·Î±×·¡¹Ö ÀÎÅÍÆäÀ̽º)ÀÔ´Ï´Ù.

ExternalInterfaceÀÇ ±â´ÉÀº fscommand(), CallFrame() ¹× CallLabel() ¸Þ¼­µå¿Í ºñ½ÁÇÏÁö¸¸ º¸´Ù À¯¿¬ÇÏ°í º¸´Ù ÀϹÝÀûÀÎ Àû¿ëÀÌ °¡´ÉÇÕ´Ï´Ù. JavaScript-ActionScript Åë½Å¿¡´ÂExternalInterface¸¦ »ç¿ëÇÏ´Â °ÍÀÌ ÁÁ½À´Ï´Ù.

ActionScript¿¡¼­ HTML ÆäÀÌÁöÀÇ ¸ðµç JavaScript ÇÔ¼ö¸¦ È£ÃâÇÏ¿© ¸ðµç µ¥ÀÌÅÍ À¯ÇüÀÇ Àμö¸¦ ¼ö Á¦ÇÑ ¾øÀÌ Àü´ÞÇϰí È£Ãâ¿¡¼­ ¹Ýȯ°ªÀ» ¹ÞÀ» ¼ö ÀÖ½À´Ï´Ù.

HTML ÆäÀÌÁöÀÇ JavaScript¿¡¼­ Flash PlayerÀÇ ActionScript ÇÔ¼ö¸¦ È£ÃâÇÒ ¼ö ÀÖ½À´Ï´Ù. ActionScript ÇÔ¼ö´Â °ªÀ» ¹ÝȯÇÒ ¼ö ÀÖ°í JavaScript´Â È£ÃâÀÇ ¹Ýȯ°ªÀ» Áï½Ã ¼ö½ÅÇÕ´Ï´Ù. ExternalInterface¸¦ Áö¿øÇÏ´Â ºê¶ó¿ìÀú¿Í ¿î¿µ üÁ¦ÀÇ Á¶ÇÕÀº ´ÙÀ½°ú °°½À´Ï´Ù.

ºê¶ó¿ìÀú ¿î¿µÃ¼°è
Internet Explorer 5.0 ÀÌ»ó Windows  
Netscape 8.0 ÀÌ»ó Windows Macintosh
Mozilla 1.7.5 ÀÌ»ó Windows Macintosh
Firefox 1.0 ÀÌ»ó Windows Macintosh
Safari 1.3 ÀÌ»ó   Macintosh

À¥Ç¥ÁØÀÌ ´ëµÎ µÇ°í ÀÖ´Â Áö±ÝÀÇ ½ÃÁ¡¿¡¼­ ´Ù¾çÇÑ ºê¶ó¿ìÀú¸¦ Áö¿øÇÏ´Â ExternalInterface class ´Â Á¤¸» À¯¿ëÇÑ class ÀÔ´Ï