gpt4 book ai didi

actionscript-3 - 是否首选导入类(例如 import flash.events.MouseEvent )而不是包的全部内容(例如 import flash.events.*)

转载 作者:行者123 更新时间:2023-12-05 00:02:42 25 4
gpt4 key购买 nike

在代码开头指定您打算使用的类、函数或命名空间是否有好处?

最佳答案

the reference says :

If you import a class but do not use it in your script, the class is not exported as part of the SWF file. This means you can import large packages without being concerned about the size of the SWF file; the bytecode associated with a class is included in a SWF file only if that class is actually used. One disadvantage of importing classes that you do not need is that you increase the likelihood of name collisions.


但是,(对我而言)有一个在后面的代码中使用的类的确切列表要方便得多

关于actionscript-3 - 是否首选导入类(例如 import flash.events.MouseEvent )而不是包的全部内容(例如 import flash.events.*),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7634019/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com