ÔÆÄÏʦ·¶´óѧ¼ÆËã»ú¿ÆѧÓëÐÅÏ¢¼¼ÊõѧԺ½ÌÓý¼¼Êõѧ¡ª¡ªÑî½ðƽ
trace(\
trace(\
µÚ10Õ ¶¯Ì¬Îı¾
ÔÚÖÆ×÷ÓÎÏ·µÄʱºò£¬ÓÐʱÐèÒªÒ»¸öÎı¾¿òÀ´¼Ç¼Óû§µÄÓÎÏ·µÃ·Ö£¬Õâ¸ö·ÖÊýÊǸù¾ÝÓÎÏ·Çé¿ö¶¯Ì¬¸Ä±äµÄ¡£Õâʱºò£¬ÎÒÃǾÍÐèÒªÓõ½¶¯Ì¬Îı¾¡£
¶¯Ì¬Îı¾ÓëÊäÈëÎı¾µÄÇø±ðÔÚÓÚËü²»ÄÜÖ±½Ó½ÓÊÜÓû§ÊäÈë¡£ µ«ÊÇ£¬¶¯Ì¬Îı¾¿ÉÒÔÓÃÀ´ÏÔʾ²»Í¬ÑùʽºÍ×ÖÌåµÄÎı¾¡£ 10.1 ¶¯Ì¬Îı¾
ºÍÊäÈëÎı¾Ò»Ñù£¬Ê¹ÓÃÎı¾¹¤¾ß¿ÉÒÔ´´½¨¶¯Ì¬Îı¾¿ò£¬Ö»ÐèÔÚÊôÐÔÃæ°åÖÐÑ¡Ôñ¡°¶¯Ì¬Îı¾¡±¼´¿É ÒªÈö¯Ì¬Îı¾¿ò¶¯Ì¬µØÏÔʾÎı¾£¬¾ÍÐèÒªÔÚÊôÐÔÃæ°åÖÐΪÆäÉèÖñäÁ¿Ãû¡£½«¶¯Ì¬Îı¾µÄ±äÁ¿ÃûÉèΪ
myDynamicText¡£ÔÚFlashӰƬ²¥·Åʱ£¬Ö»Ðè¸Ä±ä¶¯Ì¬Îı¾±äÁ¿µÄÖµ£¬¾Í¿ÉÒԸı䶯̬Îı¾¿òÖÐÏÔʾµÄÎı¾¡£ ¶¯Ì¬Îı¾ÓÐ3ÖÖ»ù±¾¸ñʽ£ºµ¥ÐС¢¶àÐкͶàÐв»»»ÐУ¬ËüûÓÐÊäÈëÎı¾µÄÃÜÂë¸ñʽ¡£ ÊôÐÔÃæ°åÖмäÓÐ3¸ö°´Å¥£¬ÆäÖУº
= £º¿ÉÑ¡£¬Ëü¾ö¶¨ÁËÊÇ·ñ¿ÉÒÔ¶Ô¶¯Ì¬Îı¾¿òÖеÄÎı¾Ö´ÐÐÑ¡Ôñ¡¢¸´ÖÆ¡¢¼ôÇеȲÙ×÷£¬°´Ï±íʾ¿ÉÑ¡¡£Èç¹ûÊÇÊäÈëÎı¾£¬ËüÊÇĬÈÏ°´Ï²¢ÇÒ²»¿É¸Ä±äµÄ£¬ÒòΪÊäÈëÎı¾Ò»¶¨ÊÇ¿ÉÑ¡µÄ¡£
= £º½«Îı¾³ÊÏÖΪHTML£¬Ëü¾ö¶¨Á˶¯Ì¬Îı¾¿òÖеÄÎı¾ÊÇ·ñ¿ÉÒÔʹÓÃHTML¸ñʽ£¬¼´Ê¹ÓÃHTMLÓïÑÔΪÎı¾ÉèÖøñʽ¡£
= £ºÔÚÎı¾ÖÜΧÏÔʾ±ß¿ò£¬Ëü¾ö¶¨ÁËÊÇ·ñÔÚ¶¯Ì¬Îı¾¿òÖÜΧÏÔʾ±ß¿ò¡£
ÔõÑù²ÅÄÜÈö¯Ì¬Îı¾¿òÏÔʾÐèÒªµÄÎı¾ÄØ£¿ÈçÏÂËùʾµÄ½Å±¾¼´ÔÚ±äÁ¿ÃûΪmyDynamicTextµÄ¶¯Ì¬Îı¾¿òÖÐÏÔʾ¡°Welcome to ActionScript!¡±£º
myDynamicText = \ÉÏÃæµÄ½Å±¾ÊǼÓÔÚ¶¯Ì¬Îı¾ËùÔÚµÄʱ¼äÖáÉϵġ£
¶¯Ì¬Îı¾µÄʹÓÃËäÈ»ºÜ¼òµ¥£¬µ«ÊÇÓÃËü¿ÉÒÔ×öÐí¶àÊÂÇé¡£ 10.2 HTML¸ñʽ
HTML¼´³¬Îı¾ÖñêÓïÑÔ£¬ËüÊÇÍøÒ³¸ñʽµÄÒ»ÖÖÏÔʾ¹æ·¶¡£ÔÚä¯ÀÀÍøҳʱ£¬ä¯ÀÀÆ÷ͨ¹ý½â¶ÁHTML±ê¼Ç½«ÍøÒ³Öеĸ÷ÖÖÔªËØÏÔʾ³ÉÐèÒªµÄÑùʽ¡£ÔÚFlashÖпÉÒÔʹÓÃHTMLÀ´ÉèÖö¯Ì¬Îı¾µÄ¸ñʽ¡£ÒªÊ¹ÓÃHTML£¬Ê×ÏÈÐèÒª°´ÏÂÊôÐÔÃæ°åÖÐµÄ °´Å¥¡£ÔÚFlashÖÐʹÓÃHTML±ê¼ÇΪ¶¯Ì¬Îı¾ÉèÖøñʽµÄActionScriptÈçÏÂËùʾ£º myDynamicText = \´ÖÌå. \
myDynamicText += \бÌå. \
myDynamicText += \Ï»®Ïß. \
myDynamicText += \ÑÕÉ«. \
myDynamicText += \×ÖÌå. \
myDynamicText += \×ÖºÅ. \
myDynamicText += \http://www.sina.com.cn& #39;>A HREF:³¬Á´½Ó. \
49
ÔÆÄÏʦ·¶´óѧ¼ÆËã»ú¿ÆѧÓëÐÅÏ¢¼¼ÊõѧԺ½ÌÓý¼¼Êõѧ¡ª¡ªÑî½ðƽ
FlashÖÐʹÓõIJ¢²»ÊÇÍêÕûµÄHTML£¬¶øÖ»ÊÇHTMLÖеÄһЩ±ê¼Ç£¬Ê¹ÓÃÕâЩ±ê¼Ç¿ÉÒÔÇáËɵØΪ¶¯Ì¬Îı¾ÉèÖø÷ÖÖ¸ñʽ¡£
Flash MXÖпÉÓõÄËùÓÐHTML±ê¼ÇÈçÏÂËùʾ£º = £º´ÖÌå = £ºÐ±Ìå = £ºÏ»®Ïß
= £ºÉèÖÃ×ÖÌå = £ºÉèÖÃ×ֺŠ= £ºÍøÒ³³¬Á´½Ó = £º¶¨Òå¶ÎÂä = £º»»ÐÐ
10.3 ´ÓÎı¾ÎļþÖлñÈ¡±äÁ¿
ͨ¹ýActionScript¿ÉÒÔµ÷ÓÃFlashӰƬÍⲿÎı¾ÎļþÖеıäÁ¿¡£´ÓÍⲿÎļþÖлñÈ¡±äÁ¿µÄ·½·¨·Ç³£ÓÐÓã¬Ëü¿ÉÒÔÔÚ²»¸Ä±äFlashÎļþµÄ»ù´¡É϶ÔFlashӰƬµÄÄÚÈÝ×÷³öÐ޸ġ£ÀýÈçÒªÓÃFlashÖÆ×÷Ò»¸öÌìÆøÔ¤±¨¶¯»£¬Èç¹ûÿÌ춼¶ÔFlashÎļþ½øÐÐÐ޸ľÍÌ«Âé·³ÁË¡£¶øʹÓÃÍⲿ±äÁ¿¾ÍÖ»ÐèÒª¶ÔÎı¾Îļþ×÷³öÐ޸ġ£ Òª´ÓÍⲿÎļþÖлñÈ¡±äÁ¿ÐèÒªÓõ½µÄÃüÁîÊÇloadVariables£¬ÈçÏÂËùʾ£º loadVariables(\
ÆäÖУ¬µÚ1¸ö²ÎÊýÊÇFlashӰƬҪ»ñÈ¡±äÁ¿µÄÎļþλÖ㬵Ú2¸ö²ÎÊýÊÇÎı¾±äÁ¿Òª¼ÓÔص½µÄλÖ㬿ÉÒÔÊÇ_root£¬Ò²¿ÉÒÔÊÇij¸öӰƬ¼ô¼»òÉî¶È¼¶±ð¡£Flash½«À´×ÔÍⲿÎļþÖеıäÁ¿Öµ¼ÓÔص½ÓëÖ¸¶¨Î»ÖÃÖоßÓÐÏàͬ±äÁ¿ÃûµÄÎı¾×Ö¶ÎÖС£
ʹÓÃloadVariablesÃüÁîҪעÒâµÄÊÇ£¬Ö¸¶¨µÄÎı¾Ó¦ÒÔFlashӰƬÖеÄÎı¾±äÁ¿Ãû¿ªÊ¼£¬·ñÔò²»Äܱ»¼ÓÔØ¡£±¾Àýweather.txtÖеÄÄÚÈÝÈçÏÂËùʾ£º myDynamicText=Today is Friday,it's rainy!
´ò¿ªÎļþloadVariables.fla£¬ÔÚÖ÷ʱ¼äÖáÖÐÓÐÒ»¸ö¶¯Ì¬Îı¾¿ò£¬Æä±äÁ¿ÃûÓëweather.txtÖеÄÎı¾×Ö¶ÎÏàͬ£¬µ±ÔËÐÐÇ°ÃæµÄ½Å±¾Ê±£¬¸ÃÎı¾¿òÖÐÏÔʾ£º Today is Friday,it's rainy!
Èç¹ûÔÚÎı¾ÎļþÖÐΪ±äÁ¿Ö¸¶¨¶àÐÐ×Ö·û´®£¬Flash½«×Ô¶¯Ê¶±ð»»Ðзû£¬´Ó¶øʵÏÖ×Ô¶¯»»ÐС£ Äú¿ÉÒÔÐÞ¸ÄÎı¾ÎļþÖеÄÄÚÈÝ£¬FlashÖж¯Ì¬Îı¾ÏÔʾµÄÄÚÈÝÒ²½«×÷³öÏàÓ¦µÄ¸Ä±ä¡£ 10.4 Á·Ï°£º¹ö¶¯ÐÂÎÅ
£¨1£©Ð½¨Ò»¸öFlashÎĵµ²¢±£´æ¡£
£¨2£©ÔÚ³¡¾°ÖлæÖÆÒ»¸ö¶¯Ì¬Îı¾¿ò£¬ÔÚÊôÐÔÃæ°åÖн«Æä±äÁ¿ÃûÉèΪtext¡£
£¨3£©Ñ¡ÖÐÎı¾¿ò£¬°´F8¼ü½«Æäת»»ÎªÓ°Æ¬¼ô¼Ôª¼þ£¬ÔÚÊôÐÔÃæ°åÖн«¸ÃӰƬ¼ô¼ÊµÀýÃüÃûΪnews¡£ £¨4£©Ñ¡ÖÐӰƬ¼ô¼ÊµÀýnews£¬´ò¿ªÆ䶯×÷Ãæ°å£¬ÔÚÆäÖÐÌí¼ÓÈçÏÂActionScript£º onClipEvent (load) {
loadVariables(\v = 0; }
onClipEvent (enterFrame) { v++;
if (v == 1) {
text = text.substr(1, text.length-1)+text.substr(0, 1);
50