 |
|
|  |
Ç÷¡½¬ ¾×¼Ç ½ºÅ©¸³Æ® flash action script |
|
|
 |
16³â Àü |
<< Ç÷¡½¬ ¾×¼Ç ½ºÅ©¸³Æ® flash action script >>
----------------------------------------------------------------------------
// ..... ÁÖ¼® ±âÈ£
/* ..... */ ÁÖ¼® ±âÈ£
----------------------------------------------------------------------------
\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(System.capabilities.language) // Flash Player°¡ Áö¿øÇÏ´Â ¾ð¾î. °á°ú´Â ko
trace(System.capabilities.hasVideoEncoder) // Áö¿øµÇ´Â ºñµð¿À ÀÎÄÚ´õ. °á°ú´Â true, false.
trace(System.capabilities.hasAudioEncoder ) // Áö¿øµÇ´Â ¿Àµð¿À ÀÎÄÚ´õ. °á°ú´Â true, false.
trace(System.capabilities.hasAudio) // ¿Àµð¿À ¼º´ÉÀÌ ÀÖ´ÂÁö ¿©ºÎ. °á°ú´Â true, false.
trace(System.capabilities.hasMP3) // MP3 µðÄÚ´õ°¡ ÀÖ´ÂÁö ¿©ºÎ. °á°ú´Â true, false.
----------------------------------------------------------------------------
escape("abc°¡³ª´Ù"); // URL¿¡ »ç¿ëÇϱâ À§ÇØ ÀÎÄÚµù.
// System.useCodePage= true; À϶§ °á°ú´Â abc%B0%A1%B3%AA%B4%D9
// System.useCodePage= false; À϶§ °á°ú´Â abc%EA%B0%80%EB%82%98%EB%8B%A4
----------------------------------------------------------------------------
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 = "<b> this is bold text </b>";
----------------------------------------------------------------------------
aa.html = true; // html ÅÂ±× »ç¿ë (table)
aa.htmlText = "";
aa.htmlText += " <table id='ttt' border='1'> <tr> <td> Å×À̺íÀÇ ÅؽºÆ®1 </td> ";
aa.htmlText += " <td> Å×À̺íÀÇ ÅؽºÆ®2 </td> </tr> </table> ";
aa.htmlText += " <a href=' ' > À̵¿ Çϱâ </a> ";
----------------------------------------------------------------------------
function Func(arg){ trace ("You clicked me! Argument was "+arg); };
aa.html = true; // html ÅÂ±× »ç¿ë (asfunction)
aa.htmlText = "<A HREF=\"asfunction:Func,Foo \"> Click </A>";
----------------------------------------------------------------------------
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.getBeginIndex(); // Æ÷Ä¿½º ½ÃÀÛÁ¡ ¹Ýȯ. °á°ú´Â 2
bbb.text = Selection.getEndIndex(); // Æ÷Ä¿½º ³¡Á¡ ¹Ýȯ. °á°ú´Â 5
bbb.text = Selection.getCaretIndex(); // ±ô¹ÚÀÌ´Â Ä¿¼ À§Ä¡ ¹Ýȯ. °á°ú´Â 5
bbb.text = Selection.getFocus(); // Æ÷Ä¿½º º¯¼ö À̸§ ¹Ýȯ. °á°ú´Â _level0.aaa
----------------------------------------------------------------------------
ccc.onRollOut = function () { Selection.setFocus("aaa"); } // ¸¶¿ì½º ¾Æ¿ô¶§ ¹®ÀÚ Æ÷Ä¿½º
----------------------------------------------------------------------------
// _root.var1 µ¿ÀûÅؽºÆ® ¿Í _root.var2 ÀÔ·ÂÅؽºÆ®¿¡ °¢°¢ aaa.txt ÆÄÀÏ µ¥ÀÌŸ ºÒ·¯¿À±â
// aaa.txt ³»¿ë (º¯¼ö¸íÀÌ °°¾Æ¾ß ÇÑ´Ù)
// &var1=aaa°¡³ª´Ùbbb¶ó¸¶¹Ùccc»ç&
// &var2=ddd°¡³ª´Ùeee¶ó¸¶¹Ùfff»ç&
System.useCodepage = true;
var var1 = "1", var2 = "2";
_root.loadVariables("aaa.txt"); // loadVariables ¸í·ÉÀ¸·Î aaa.txt ÆÄÀÏ ºÒ·¯¿À±â
trace(var1); trace(var2); // (ȸéÀº ¹Ù²îÁö¸¸ °ªÀº ¾È¹Ù²ï´Ù)
_root.var1.loadVariables("aaa.txt"); // À߸øµÈ ¸í·É¾î
loadVariables("aaa.txt",var1); // À߸øµÈ ¸í·É¾î
loadVariables("aaa.txt",var1ins); // À߸øµÈ ¸í·É¾î
loadVariablesNum("aaa.txt" , 0 ); // loadVariablesNum ¸í·ÉÀ¸·Î aaa.txt ÆÄÀÏ ºÒ·¯¿À±â
trace(var1); trace(var2); // (ȸéÀº ¹Ù²îÁö¸¸ °ªÀº ¾È¹Ù²ï´Ù)
mytxt = new LoadVars(); // load ¸í·ÉÀ¸·Î aaa.txt ÆÄÀÏ ºÒ·¯¿À±â
mytxt.load("aaa.txt");
mytxt.onLoad = function () {
var1 = String( "/" + mytxt.var1 + ".jpg");
var2 = String( "/" + mytxt.var2 + ".jpg");
trace(var1); trace(var2); // (onLoad ¾È¿¡¼´Â ȸ鵵 ¹Ù²î°í °ªµµ ¹Ù²ï´Ù)
};
trace(var1); trace(var2); // (onLoad ¹Û¿¡¼´Â ȸéÀº ¹Ù²îÁö¸¸ °ªÀº ¾È¹Ù²ï´Ù)
----------------------------------------------------------------------------
memodate = 1; // << ¸ÞÀÎ ¾×¼Ç >>
function jpgload() { // jpgÆÄÀÏ ·Îµå ÇÔ¼ö
this.createEmptyMovieClip("slidememo"+memodate, 1); // ºó ¹«ºñŬ¸³ ¸¸µé±â
this["slidememo"+memodate]._x = 48;
this["slidememo"+memodate]._y = 124;
this["slidememo"+memodate].loadMovie("c"+ memodate +".jpg"); // jpgÆÄÀÏ ·Îµå
this["slidememo"+memodate]._xscale = 150; // xÅ©±â º¯Çü(%)
this["slidememo"+memodate]._yscale = 150; // yÅ©±â º¯Çü(%)
};
function jpgunload() { // jpgÆÄÀÏ ¾ð·Îµå ÇÔ¼ö
this["slidememo"+memodate].unloadMovie(); // ¹«ºñŬ¸³¿¡ ·ÎµåµÈ ¹«ºñ¸¦ ¾ð·Îµå
this["slidememo"+memodate].removeMovieClip(); // ¹«ºñŬ¸³ »èÁ¦Çϱâ
};
jpgload();
on(press) { // << ´ÜÃß ¹«ºñŬ¸³ ¾×¼Ç >> // ¹öÆ° ´©¸£¸é jpg ÆÄÀÏ 1À徿 ·Îµå
jpgunload();
memodate +=1
if (memodate > 100 ) { memodate = 1; }
jpgload();
}
----------------------------------------------------------------------------
// ÅøÆÁ »ç¿ëÇϱâ
function tooltip(tool1,tool2,tool3) { // tooltip() ÇÔ¼ö
if (tool1==1) { createTextField ("daysssdisp", 202, -375, -210, 700, 420); };
if (tool1==2) { createTextField ("daysssdisp", 202, -350, -210, 700, 420); };
daysssdisp.type = "dynamic"; // ÅؽºÆ® ÇʵåÀÇ ¼Ó¼º
daysssdisp.border = true; // (Å׵θ®)
daysssdisp.borderColor = 0x00ffff; // (Å׵θ® »ö»ó)
daysssdisp.background = true; // (¹è°æ)
daysssdisp.backgroundColor=0xffffee; // (¹è°æ »ö»ó)
daysssdisp.textColor = 0x000077; // (±ÛÀÚ »ö»ó)
myformat = new TextFormat();
myformat.size = 12; // (ÅؽºÆ®ÀÇ Å©±â)
myformat.align = "left"; // (´Ü¶ôÀÇ Á¤·Ä )
myformat.indent = 20; // (µé¿©¾²±â Æ÷ÀÎÆ® ´ÜÀ§)
text000 = ""; // ÁÙ¹Ù²Þ ÄÚµå »èÁ¦ Çϱâ
text111 = tool2.length;
if (text111 >= 3000) { text111 = 3000; };
for (i=0; i<=text111; i++) {
text222 = tool2.charCodeAt(i);
if (text222 == 10) { text000 += "";
} else { text000 += tool2.substr(i,1); };
};
daysssdisp.text = " \n ( " + tool3 + " ) \n" + text000; // (±ÛÀÚ)
daysssdisp.setTextFormat(myformat);
};
sssdayboxmc1.onRollOver = function () { tooltip(1, d1, 1); }; // Ŭ¸³¿À¹ö½Ã ÅøÆÁ º¸ÀÓ
sssdayboxmc2.onRollOver = function () { tooltip(1, d2, 2); };
sssdayboxmc3.onRollOver = function () { tooltip(2, d3, 3); };
for (o=1;o<=3;o++) { // Ŭ¸³¾Æ¿ô½Ã ÅøÆÁ ¾Èº¸ÀÓ
this["sssdayboxmc"+o].onRollOut = function () { daysssdisp.removeTextField (); };
};
----------------------------------------------------------------------------
var fruits = ["oranges", "apples", "strawberries", "pineapples"]; // Á¤·Ä (¹®ÀÚ)
trace(fruits.join());
fruits.sort();
trace(fruits.join());
--------------------------------------------------------------------------
var myArray=[23,634,1,184,9,54]; // Á¤·Ä (¼ýÀÚ)
trace(myArray.join());
function order(a,b){ return a-b; };
myArray.sort(order);
trace(myArray.join());
----------------------------------------------------------------------------
this._x += 5; // sin °î¼±
v = this._x;
this._y = 50*Math.sin(v*Math.PI/180);
if (v >= 180) { this["ss"+ballcounter]._x *= -1; }; <¹Ýº¹>
----------------------------------------------------------------------------
RRR=270 // ¿ø
onEnterFrame = function () {
RRR=RRR+2;
if (RRR >= 720) { RRR = 0; };
this["ss"]._x = (180*Math.cos(RRR*Math.PI/180));
this["ss"]._y = (180*Math.sin(RRR*Math.PI/180));
};
----------------------------------------------------------------------------
this["ss"]._x = (180*Math.cos(RRR*Math.PI/180)); // Ÿ¿ø
this["ss"]._y = 60 + (60*Math.sin(RRR*Math.PI/180));
----------------------------------------------------------------------------
this["ss"]._x = (120*Math.sin(RRR*Math.PI/180)); // ´ë°¢¿ø
this["ss"]._y = (120*Math.sin(RRR*Math.PI/180)) + (120*Math.cos(RRR*Math.PI/180));
if (this["ss"]._x >= 100) { <½ºÄÉÀÏ º¯°æ>
this["ss"]._xscale -= 2; this["ss"]._yscale -= 2;
if (this["ss"]._xscale < 50) { this["ss"]._xscale = 50; this["ss"]._yscale = 50; };
} else {
this["ss"]._xscale += 2; this["ss"]._yscale += 2;
if (this["ss"]._xscale > 150) { this["ss"]._xscale = 150; this["ss"]._yscale = 150; };
};
----------------------------------------------------------------------------
this["ss"]._x = -(210*Math.cos(RRR*Math.PI/360)); // ³ª¼±
this["ss"]._y = (10*Math.sin(RRR*Math.PI/20)) ;
----------------------------------------------------------------------------
mczzz += 10; // ¹æ»ç¿ø
for (i=1; i<=360; i=i+10) {
this["mc" + i]._x = (mczzz*Math.cos(mcrrr*Math.PI/180));
this["mc" + i]._y = (mczzz*Math.sin(mcrrr*Math.PI/180));
mcrrr += 10;
};
----------------------------------------------------------------------------
lineStyle( 5, 0xff00ff, 100 ); // (±½±â,»ö±ò,¾ËÆÄ°ª) // ¼± ±×¸®±â
moveTo( 200, 200 ); lineTo( 300,300 ); lineTo( 100, 300 );
----------------------------------------------------------------------------
_root.createEmptyMovieClip( "triangle", 1 ); // »ï°¢Çü ±×¸®±â
with ( _root.triangle )
{
lineStyle( 5, 0xff00ff, 100 ); // (±½±â,»ö±ò,¾ËÆÄ°ª)
moveTo( 200, 200 ); lineTo( 300,300 ); lineTo( 100, 300 ); lineTo( 200, 200 );
}
----------------------------------------------------------------------------
_root.createEmptyMovieClip("nemo", -1); // »ç°¢Çü ±×¸®±â
nemo.lineStyle(1, 0xff9933, 10);
nemo.beginFill(0xff9933, 20); (»öÄ¥)
nemo.moveTo(100, 100);
nemo.lineTo(300, 100); nemo.lineTo(300, 300);
nemo.lineTo(100, 300); nemo.lineTo(100, 100);
nemo.endFill(); (»öÄ¥)
----------------------------------------------------------------------------
_root.createEmptyMovieClip( "circle", 1 ); // ¿ø ±×¸®±â (1)
with ( _root.circle ) {
lineStyle( 0, 0x0000FF, 100 );
beginFill( 0xFF0000 );
moveTo( 500, 500 );
curveTo( 600, 500, 600, 400 ); curveTo( 600, 300, 500, 300 );
curveTo( 400, 300, 400, 400 ); curveTo( 400, 500, 500, 500 );
endFill();
}
----------------------------------------------------------------------------
MovieClip.prototype.drawCircle = function(x, y, r) { // ¿ø ±×¸®±â (2)
this.moveTo(x+r, y);
var segment = Math.tan(22.5*Math.PI/180);
for (var angle = 45; angle<=360; angle += 45) {
var endx = r*Math.cos(angle*Math.PI/180);
var endy = r*Math.sin(angle*Math.PI/180);
var cx = endx+r*segment*Math.cos((angle-90)*Math.PI/180);
var cy = endy+r*segment*Math.sin((angle-90)*Math.PI/180);
this.curveTo(cx+x, cy+y, endx+x, endy+y);
};
}
_root.createEmptyMovieClip("mcmc",1);
this.mcmc.lineStyle( 15, 0xFF00FF, 100);
this.mcmc.drawCircle(300,300,200);
_root.mcmc.createEmptyMovieClip("mc",1);
this.mcmc.mc.lineStyle( 5, 0x00FFFF, 100);
this.mcmc.mc.drawCircle(300,300,100);
----------------------------------------------------------------------------
lineStyle(2, 0x000000, 50); // ¸¶¿ì½º·Î ¼± ±×¸®±â
onMouseDown = function () { toto=1; MoveTo(_xmouse, _ymouse); };
onMouseUp = function () { toto=0; MoveTo(_xmouse, _ymouse); };
onMouseMove = function () { if ( toto==1 ) { LineTo(_xmouse, _ymouse); }; };
----------------------------------------------------------------------------
ins.onMouseDown = function () { startDrag(this,true); }; // ¸¶¿ì½º·Î ±×¸² µå·¡±× Çϱâ (1)
ins.onMouseMove = function () { startDrag(this,false); };
ins.onMouseUp = function () { stopDrag(); };
----------------------------------------------------------------------------
ins.onMouseDown = function () { // ¸¶¿ì½º·Î ±×¸² µå·¡±× Çϱâ (2)
left = -ins._width + 80;
top = -ins._height + 80;
right = 940;
bottom = 580;
startDrag(this,false, left, top, right, bottom); // µå·¡±× ¿µ¿ª
};
ins.onMouseUp = function () { stopDrag(); };
----------------------------------------------------------------------------
startDrag(target,[true, false],left, top, right, bottom); // µå·¡±× ½ÃÀÛ
stopDrag(); // µå·¡±× ÁßÁö
----------------------------------------------------------------------------
// aaa ¹«ºñŬ¸³ °ú _root.bbb µ¿ÀûÅؽºÆ®Çʵ带 ¸¸µçÈÄ // ¸¶¿ì½ºÀÇ À§Ä¡¿¡ µû¸¥ ȸÀü°¢µµ ±¸Çϱâ
onEnterFrame = function() {
potx = getProperty(aaa, _x);
poty = getProperty(aaa, _y);
potmx = getProperty(_root, _xmouse);
potmy = getProperty(_root, _ymouse);
potx = Math.round(potx - potmx) / 2;
poty = Math.round(poty - potmy) / 2;
aaa._rotation = -Math.atan2(potx, poty) * (180/Math.PI)
bbb = Math.round(aaa._rotation)
if (bbb < 0) { bbb = 360 + bbb };
}
----------------------------------------------------------------------------
createTextField ("Name1", 1, 200, 50, 300, 50) // ¸¶¿ì½ºÀÇ À§Ä¡¿¡ µû¸¥ »ï°¢Çü°¢µµ ±¸Çϱâ
Name1.border = true; Name1.variable = "angle1";
createTextField ("Name2", 2, 510, 50, 300, 50)
Name2.border = true; Name2.variable = "angle2";
onEnterFrame = function() {
createEmptyMovieClip( "triangle", 3 );
with ( _root.triangle ) {
lineStyle( 5, 0xff00ff, 100 ); // (±½±â,»ö±ò,¾ËÆÄ°ª)
tx1 = 500; ty1 = 400;
tx2 = _xmouse; ty2 =_ymouse;
moveTo( tx1, ty1 ); lineTo( tx2,ty2 );
lineTo(tx1,ty2 ); lineTo( tx1,ty1 );
}
aaa = Math.abs(ty1 - ty2);
bbb = Math.abs(tx1 - tx2);
ccc = Math.sqrt( Math.pow(aaa,2) - Math.pow(bbb,2) )
angle1 = Math.round(Math.atan2(bbb, aaa) * (180/Math.PI));
angle2 = Math.round(Math.atan2(aaa, bbb) * (180/Math.PI));
if ( tx2 != _xmouse) { triangle.removeMovieClip (); };
}
----------------------------------------------------------------------------
// ball1 °ú ball2 ¹«ºñŬ¸³À» ¸¸µçÈÄ // µÎ°³ÀÇ ¹«ºñŬ¸³ÀÌ Ãæµ¹ÇÒ¶§ (hitTest)
ball1._x = 150; ball1._y = 100;
ball2._x = 450; ball2._y = 100;
onEnterFrame = function() {
ball2._x -= 1;
if(ball2.hitTest(ball1)) { // Ãæµ¹ÇÒ¶§
ball1._y = 50; delete onEnterFrame;
}
if(ball2.hitTest(300,100,true)) { // Áß½ÉÁ¡ÀÌ (300,100) À϶§
ball2._x = 250;
}
if(ball2.hitTest(400,100,false)) { // ¿Ü°ûÅ׵θ®°¡ (400,100) À϶§
ball1._x = 200;
}
if (ball2.hitTest(_root._xmouse, _root._ymouse, true)) { // ¸¶¿ì½º ¿À¹ö¶§
ball2._x += 1;
}
}
----------------------------------------------------------------------------
// µð·º·Î¸®¿¡ ÀÖ´Â sss.mp3 Àç»ý // »ç¿îµå Á¦¾îÇϱâ (1)
sond = new Sound();
sond.loadSound("sss.mp3", true);
----------------------------------------------------------------------------
// ¶óÀ̺귯¸®¿¡ ÀÖ´Â aaa.mp3 Àç»ý // »ç¿îµå Á¦¾îÇϱâ (2)
// 1. ÆÄÀϸ޴º - ¶óÀ̺귯·Î °¡Á®¿À±â (aaa.mp3)
// 2. â¸Þ´º - ¶óÀ̺귯¸® - aaa.mp3¿¡¼ ¿À¸¥ÂÊ ¸¶¿ì½º
// 3. ¸µÅ© - actionscript·Î ³»º¸³»±â üũ
snd = new Sound();
snd.attachSound("aaa.mp3");
snd.start();
lineStyle( 5, 0x0000ff, 100 ); // (±½±â,»ö±ò,¾ËÆÄ°ª) // À½¾Ç·Îµå Àüü¼± ±×¸®±â
a = 300 + ( Math.floor(snd.duration) / 100 );
moveTo( 300, 300 ); lineTo( a,300 );
onEnterFrame = function() {
lineStyle( 5, 0xff00ff, 100 ); // (±½±â,»ö±ò,¾ËÆÄ°ª) // À½¾Ç·Îµå »óż± ±×¸®±â
a = 300 + ( Math.floor( snd.position) / 100 );
moveTo( 300, 300 ); lineTo( a,300 );
};
----------------------------------------------------------------------------
// mp3 ÆÄÀÏ ¼ø¼´ë·Î Àç»ýÇϱâ // »ç¿îµå Á¦¾îÇϱâ (3)
for (a=1; a<=25; a++) {
_root["snd"+a] = new Sound();
_root["snd"+a].attachSound("piano"+a+".mp3");
};
k=1; _root["snd"+k].start();
for (a = 1; a <= 25; a++) {
_root["snd"+a].onSoundComplete=function(){
k++; _root["snd"+k].start();
};
};
----------------------------------------------------------------------------
snd.setVolume(200); // º¼·ý Á¶Àý (100 = ±âº» , 200 = 2¹è , 300 = 3¹è )
snd.setPan(100); // ¿ÞÂÊ ½ºÇÇÄ¿ ²û
snd.setPan(-100); // ¿À¸¥ÂÊ ½ºÇÇÄ¿ ²û
snd.setPan(0); // ¾çÂÊ ½ºÇÇÄ¿ ÄÔ
snd.start(0, 2); // À½¾Ç Àüü 2¹ø ¹Ýº¹ Àç»ý (attachSound À϶§)
snd.start(30, 5); // À½¾Ç 30 seconds ºÎÅÍ 5¹ø ¹Ýº¹ Àç»ý (attachSound À϶§)
soundtime=snd.position; snd.stop(); snd.start(soundtime/100); // Áß°£ºÎÅÍ Àç»ý
trace( snd.duration ); // À½¾Ç Àüü À½·®
trace( snd.position ); // À½¾Ç ÇöÀç À§Ä¡
trace( snd.getPan() ); // setPan °ª
trace( sond.getBytesLoaded() ); // À½¾Ç ·ÎµåµÈ ¹ÙÀÌÆ® ¼ö (loadSound À϶§)
trace( sond.getBytesTotal() ); // À½¾Ç Å©±âÀÇ ¹ÙÀÌÆ® ¼ö (loadSound À϶§)
sond.onLoad = function() { trace("Àç»ý"); }; // ¼Ò¸®Àç»ý ¶§ (loadSound À϶§, loadSound À§¿¡ Ç¥½Ã)
snd.onSoundComplete=function(){ trace("Àç»ý ¿Ï·á"); }; // ¼Ò¸®Àç»ý ¿Ï·á ¶§
snd.onSoundComplete=function(){ snd.start(20, 1); }; // ¼Ò¸®Àç»ý ¹«ÇÑ ¹Ýº¹
sond.onSoundComplete=function(){ sond.loadSound("sss.mp3", true); }; // ¼Ò¸®Àç»ý ¹«ÇÑ ¹Ýº¹
snd.stop(); // snd ¼Ò¸®Àç»ý ¸ØÃã
stopAllSounds (); // ¸ðµç ¼Ò¸®Àç»ý ¸ØÃã
----------------------------------------------------------------------------
startDrag("myClip", true); // ¸¶¿ì½º Ä¿¼¸¦ myClip À¸·Î ¹Ù²Ù±â
Mouse.hide();
----------------------------------------------------------------------------
Key.getCode( ); // °¡Àå ÃÖ±Ù¿¡ ´·ÁÁø Å°ÀÇ Å° ÄÚµå °ªÀ» ¹Ýȯ
Key.getAscii( ); // °¡Àå ÃÖ±Ù¿¡ ´·¯Áö°Å³ª ¸¶¿ì½º¿¡¼ ³õ¿©Áø Å°ÀÇ ASCII Äڵ带 ¹Ýȯ
Key.isDown( ); // ÁöÁ¤ÇÑ Å°°¡ ´·Á ÀÖ´ÂÁöÀÇ ¿©ºÎ
Key.isToggled( ); // Å°ÀÇ »óÅÂ
Key.ENTER (13)
Key.SPACE (32)
Key.CONTROL (17)
Key.SHIFT (16)
Key.TAB (9)
Key.BACKSPACE (8)
Key.CAPSLOCK (20)
Key.ESCAPE (27)
Key.PGUP (33)
Key.PGDN (34)
Key.END (35)
Key.HOME (36)
Key.LEFT (37)
Key.UP (38)
Key.RIGHT (39)
Key.DOWN (40)
Key.INSERT (45)
Key.DELETEKEY (46)
----------------------------------------------------------------------------
// Å°º¸µå ¹æÇâÅ°¸¦ ´·¶À»¶§
_root.onEnterFrame = function() {
if(Key.isDown(Key.RIGHT)) { // È¸é ¿À¸¥ÂÊ À̵¿
this._x=_x+10;
} else if (Key.isDown(Key.LEFT)) { // È¸é ¿ÞÂÊ À̵¿
this._x=_x-10;
} else if (Key.isDown(Key.UP)) { // ȸé À§ À̵¿
this._y=_y-10;
} else if (Key.isDown(Key.DOWN)) { // È¸é ¾Æ·¡ À̵¿
this._y=_y+10;
}
}
----------------------------------------------------------------------------
// º¯¼öÀ̸§ÀÌ _root.kcode ¶õ µ¿ÀûÅؽºÆ®¸¦ ¸¸µçÈÄ
someListener = new Object();
someListener.onKeyDown = function () {
kcode=Key.getCode();
if(kcode == 32){ trace("space"); } // space Å°¸¦ ´·¶À»¶§
if(kcode == 13){ trace("enter"); } // enter Å°¸¦ ´·¶À»¶§ (swf ÆÄÀÏ¿¡¼ ½ÇÇà)
if(kcode == 65){ trace(" A or a"); } // A or a Å°¸¦ ´·¶À»¶§ (´ë¼Ò¹®ÀÚ ¸ðµÎ 65)
if(kcode == 66){ trace(" B or b"); } // B or b Å°¸¦ ´·¶À»¶§ (´ë¼Ò¹®ÀÚ ¸ðµÎ 66)
if(kcode == 89){ trace(" Y or y"); } // Y or y Å°¸¦ ´·¶À»¶§ (´ë¼Ò¹®ÀÚ ¸ðµÎ 89)
if(kcode == 90){ trace(" Z or z"); } // Z or z Å°¸¦ ´·¶À»¶§ (´ë¼Ò¹®ÀÚ ¸ðµÎ 90)
};
Key.addListener(someListener);
----------------------------------------------------------------------------
// ASCII ÄÚµå
(48,49,50,51,52,53,54,55,56,57) 0 1 2 3 4 5 6 7 8 9
(65,66,67 ........... 88,89,90) A B C ....... X Y Z
(97,98,99 ........ 120,121,122) a b c ....... x y z
33 ! 34 " 35 # 36 $ 37 % 38 & 39 '
40 ( 41 ) 42 * 43 + 44 , 45 - 46 . 47 /
58 : 59 ; 60 < 61 = 62 > 63 ? 64 @
91 [ 92 93 ] 94 ^ 95 _ 96 `
123 { 124 | 125 } 126 ~
----------------------------------------------------------------------------
----------------------------------------------------------------------------
| |
|
̵̧ : 331 |
̵̧
¸ñ·Ï
|
|
|  |
|