主题:  originalCode + reference ==?

千风子

职务:普通成员
等级:1
金币:0.0
发贴:18
注册:2001/7/28 20:30:27
#12002/3/10 23:05:05
originalCode + reference ==success !!!
Flashmx有很多地方借鉴了Dreamweaver
例如 Properties panel
但是我认为reference panel 的引入将使你
在编写actionScript中获得巨大的方便!!!
它的热键是shift+F1,但是我一般不是这样用的。
在看别人的原代码时,选中一个暗蓝色的保留字,
然后按那个位于Action panel右侧的小书本图标,
就会弹出关于你选中的xx的具体解释及用法。像这样:

duplicateMovieClip

Availability
Flash Player 4.

Usage
duplicateMovieClip(target, newname,depth)

Parameters

[target] The target path of the movie clip to duplicate.

[newname] A unique identifier for the duplicated movie clip.

[depth] A unique depth level for the duplicated movie clip. The depth level is a stacking order for duplicated movie clips. This stacking order is much like the stacking order of layers in the Timeline; movie clips with a lower depth level are hidden under clips with a higher stacking order. You must assign each duplicated movie clip a unique depth level to prevent it from replacing movies on occupied depths.

[Returns]

[Nothing.]

Description

Action; creates an instance of a movie clip while the movie is playing. The playhead in duplicate movie clips always starts at Frame 1, regardless of where the playhead is in the original (or "parent") movie clip. Variables in the parent movie clip are not copied into the duplicate movie clip. If the parent movie clip is deleted the duplicate movie clip is also deleted. Use the removeMovieClip action or method to delete a movie clip instance created with duplicateMovieClip.

Example

This statement duplicates the movie clip instance flower ten times. The variable i is used to create a new instance name and a unique depth for each duplicated movie clip.

on (release) {
    amount = 10;
    while (amount>0) {
        duplicateMovieClip (_root.flower, "mc"+i, i);
        setProperty ("mc"+i, _x, random(275));
        setProperty ("mc"+i, _y, random(275));
        setProperty ("mc"+i, _alpha, random(275));
        setProperty ("mc"+i, _xscale, random(50));
        setProperty ("mc"+i, _yscale, random(50));
        i++;
        amount--;
    }
}

See also

MovieClip.duplicateMovieClip
removeMovieClip
MovieClip.removeMovieClip


怎么样,很详细吧。



金山羊

职务:普通成员
等级:4
金币:10.0
发贴:827
注册:2002/1/6 14:44:13
#22002/3/11 8:15:21
yes! this is a very good function!


5d.cn
FLASHDEP
TECHNOLOGY SUPPORT
JAVA/ACTIONSCRIPT/javascript
CFML/JSP/COLDFUSION/FLASH REMOTING
JRUN/COLDFUSIONMX
FLASH/DREAMWEARER

5D荣誉斑竹

职务:普通成员
等级:3
金币:10.0
发贴:751
注册:2001/5/21 21:43:30
#32002/3/16 15:22:53
flash mx 有没有Generator。有人说G2开发的不成功,不知道是不是真的。