开发者

AS3 with(){} - any way to refer to the object in ()?

开发者 https://www.devze.com 2023-04-02 04:55 出处:网络
Can I refer the thing I just mentioned in with() with a reserved variable or something? Or do I have to write the entire thing out?

Can I refer the thing I just mentioned in with() with a reserved variable or something? Or do I have to write the entire thing out?

with(something){
someFunction(something)
}

In this example it's simple, but sometimes it's really long and I would like to avoid 开发者_运维知识库it if possible.


If it was javascript, then you could use valueOf(). I don't know if AS3 supports that.


Yes you can, see this actionscript reference page on help.adobe.com:

0

精彩评论

暂无评论...
验证码 换一张
取 消