Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

Flash Tip: Bracket [] Syntax

It's been a while since I've posted any Flash tips. I recon it's
time that changed and I get back to spreading some of that knowledge that's
lofting up there in that big empty space I call a brain. This particular tip
comes from a recent post on the ActionScript.org forums
.
Brackets evaluates the string it contains and resolves a
variable reference for the object preceding the first [. So, for example,
_level0["Rect"]; is the same as _level0.Rect; _level0["Rect"+1]; is the same as
_level0.Rect1;
Arrays rely on this method of variable resolution since
array values are stored in variables whose names are numbers. Normally numbers
are not allowed as variable names because dot syntax cannot properly resolve
variables names starting with numbers as it assumes it to be a number value,
i.e. _level0.3something; screws up because Flash gets to the 3 and thinks the
number 3, not a variable name starting with 3. However, this naming restriction
can be averted using bracket syntax, _level0["3something"]; and in arrays'
cases, is required, someArray[3]. Note that bracket contents do not have to be
strings, though a string representation of the contents is used to resolve the
variable--this through the toString() method.
All variable types in Flash
have a toString method which determines what its value looks like as a string.
For numbers, its just a value conversion of number to string, visually not
really changing at all. Arrays show a string listing of their values separated
by commas and for basic objects, you've probably seen its default as "[object
Object]" in a trace in Flash. Bracket syntax uses this string representation for
evaluation so someArray[3];
is seen as someArray[(3).toString()];
or someArray["3"];
You can use this to your advantage with
other variable types like generic objects. See the following:
myNameObject = new Object();
myNameObject.toString =
func


Ïà¹ØÎĵµ£º

flash tools±à¼­¹¤¾ß¼¯


ÒªÕҺõÄflashÎļþ£¬ÒªÓõ½Ò»Ð©¹¤¾ß£¬ÕâÀïΪ´ó¼ÒÊÕ¼¯ÁËһЩºÃÓõŤ¾ß£¬Çë´ó¼ÒЦÄÉ£º
flash·´±àÒëÈí¼þ£¬ÓÃÓÚ´ÓflashÖе¼³öfla¸ñʽµÄÔ´Îļþ£¬µã»÷ÏÂÃæÏÂÔØ£º
swf to fla.exe 1,068KB
Swf2Fla.exe 1,243KB
ת»»¹¤¾ß£ºexe¡¢swf¡¢flaµÄÏ໥ת»»¹¤¾ß
Flash5°æ±¾       а汾
´ÓflashÖ ......

ÔÚflashÖÐÃüÃûµÄmcʵÀýÔÚflex±à¼­»·¾³Ï·ÃÎÊ

ÔÚflex¿ª·¢»·¾³Öбàдas3´úÂëÊǺܷ½±ãµÄ£¬½èÖúflex¿ª·¢»·¾³´úÂ붼ÓÐ×Ô¶¯Ìáʾ¹¦ÄÜ£¬µ«ÊÇÔÚ×öflashÓÎÏ·µÄʱºò£¬ÔÚÉæ¼°µ½¶Ô»°¿òµÄʱºò£¬ÎÒÓöµ½Ò»¸öºÜ¼¬ÊÖµÄÎÊÌ⣬¾ÍÊÇÔÚÃÀ¹¤ÓÃflash cs²¼¾ÖºÃÁ˵ĽçÃ棬ÎÒÔÚ½çÃæÉÏÃüÃûÁËʵÀý£¨ÈçtextfieldÀàÐÍ var nameText:String£©£¬ÔÚµ¼³öÕâ¸öÀࣨguestDialog£©µÄʱºò(Õâ¸öÀà¼Ì³Ð×ÔMovieClip ......

Flash ƽ̨¼¼Êõ FFA

   2010¼´½«À´ÁÙ£¬adobe½«»áÓ­À´Ò»¸öÖØÒªµÄÒ»Ä꣬Flash ƽ̨¼¼ÊõµÄ¹¹½¨£¬½«»áÈøü¶àѧϰFlash¼¼ÊõµÄÈ˵õ½Êܻݡ£Ñ§Ï°Õâ¸öƽ̨¼¼Êõ£¬¾ÍÐèÒªÎÒÃÇÖªµÀ¸Ã¼¼ÊõÊÇÔõÑùÒ»»ØÊ£¿Ñ§Ï°flash ±à³ÌµÄÈË»áÁ˽⵽£¬ adobe ºÜ¶à±à³ÌÏà¹ØµÄ²úÆ·¶¼ÔÚ¹¹½¨ÔÚ as ÉíÉÏ£¬°ÑÕâÃÅÓïÑÔ×÷Ϊһ¸ö¹µÍ¨µÄÇÅÁº£¬ÕâÊÇÒ»´óÌØÉ«¡£ºÜ¶àÈËÖÊÒÉa ......

Flash²¹¼äÒýÇæÓ¦ÓãºÍ¼Æ¬ÌØЧ£¨2£©

      ͨ¹ýÉÏһƪµÄ³õÊÔ£¬ÏÖÔÚÎÒÃǽèÓÃÉÏƪµÄÎÄÕÂ˼·ÖÆ×÷ÁíÍâÒ»ÖÖ²¹¼äÓ¦ÓÃ
  
ÏÂÔصØÖ·£ºÔÚÕâÀï
 ÏÂÃæ¾ÍÊÇչʾÁ˼¸ÖÖ²»Í¬²¹¼äÓ¦ÓÃЧ¹û½áºÏ£º
  
   ²ÉÓõ½»ù±¾ÖªÊ¶£ºÔ²µÄ¹ì¼££¬ÍÖÔ²µÄ¹ì¼££¬¶þάÕóÁеĸ´ÖÆ¡£
   ÖÆ×÷˼·¹Ø¼ü£ºÔÚÓÚʹÓÃÒ»Ö ......

flash ÓÎÏ·Éè¼Æ±Ê¼Ç£ºÈËÎïÐÐ×ßÒ»ÖÖ×ö·¨ (2)

flash ÓÎÏ·Éè¼Æ±Ê¼Ç£ºÈËÎïÐÐ×ßÒ»ÖÖ×ö·¨ (1) http://blog.csdn.net/hero82748274/archive/2009/12/16/5020328.aspx
½«ÉϴεÄÔ´Âë½øÐÐÐÞ¸Äһϣ¬¿ÉÒÔ·ÖÀë³öһЩ¹²ÓõĴúÂë¡£
Éè¼ÆÒ»¸öÖ÷½ÇÀ࣬Õâ¸öÖ÷½ÇÀàʵÏÖÁËÒ»¸ö·½ÏòµÄ½Ó¿Ú¡£
player ʵÏÖIDirection4 µÄ·½Ïò½Ó¿Ú £¬Òâ˼¾ÍÊÇ´ú±íÉÏÏÂ×óÓÒËÄÖÖ·½Ïò£¬ÒÔ¼°Õ¾Á¢²»¶¯µÄ½Ó¿Ú¡£¿É ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ