易截截图软件、单文件、免安装、纯绿色、仅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


相关文档:

NAND Flash的寻址方式

NAND Flash的寻址方式
这两天整理的,发出来和大家共享.
NAND Flash Addressing Mode
NAND Flash的寻址方式和NAND Flash的memory组织方式紧密相关。NAND Flash的数据是以bit的方式保存在memory cell,一般来说,一个cell中只能存储一个bit。这些cell以8个或者16个为单位,连成bit line,形成所谓的byte(x8)/word(x16),这 ......

FAT文件系统在NAND Flash存储器上的改进设计


FAT文件系统在NAND Flash存储器上的改进设计(2008-04-07 16:59:54)
标签:杂谈 
分类:技术天地
    嵌入式系统的大量数据都存储在其F1ash芯片上。根据Flash器件的固有特性,构建一个适合管理NAND Flash存储器的FAT文件系统,并阐述具体的设计思想。该系统改进了FAT表和FRT表的存储方式,延 ......

一段网页中插入flash的代码

举例子如下:
<<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="400" height="60">
<param name="movie" value="你的flash路径" />
<param name="quality" value="high" / ......

在flash中命名的mc实例在flex编辑环境下访问

在flex开发环境中编写as3代码是很方便的,借助flex开发环境代码都有自动提示功能,但是在做flash游戏的时候,在涉及到对话框的时候,我遇到一个很棘手的问题,就是在美工用flash cs布局好了的界面,我在界面上命名了实例(如textfield类型 var nameText:String),在导出这个类(guestDialog)的时候(这个类继承自MovieClip ......

关于Nand Flash的使用(针对三星K9F系列)

    前两天在搞Ch375(南京生产的USB解决方案芯片),读写都没有问题,也能完成初始化操作,就是不中断,用示波器测试1引脚(中断引脚)信号会跳变为低电平然后慢慢地返回到高电平,很奇怪!最后才发现是示波器的问题,设置成为侧交流分量造成的。最后检测PCB惊人的发现是PCB上这根线没有连上。
 &nbs ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号