·网站首页·联系我们·在线留言
东莞网站建设
东汇设计 网站建设 成功案例 网站优化 网站推广 网络营销 域名注册 虚拟主机 网站建设知识
 
  网站建设知识  
  东汇服务热线:13650104846  
  网站域名  

  虚拟主机  

  网站设计  

  网页配色  

  动画设计  

  网站维护  

  程序asp  

  程序asp.net  

  程序php  

  程序jsp  

  韩国网站分析  

 
 
  您现在位置:东汇东莞网络公司 >> 东莞网站建设知识 >> 动画设计 >> 正文
动画设计中#include 指令
发布日期:08-01-17 19:18:37  点击次数:[

动画设计中#include 指令
#include "[path]filename.as":String

包括指定文件的内容,就像该文件中的命令是调用脚本的一部分一样。#include 指令在编译时调用。因此,如果对外部文件进行了任何更改,则必须保存该文件,并重新编译任何使用它的 FLA 文件。

如果对包含 #include 语句的脚本使用"语法检查"按钮,则也会检查所包括文件的语法。

您可以在 FLA 文件和外部脚本文件中使用 #include,但不能在 ActionScript 2.0 类文件中使用。


您可以对要包括的文件不指定路径、指定相对路径或指定绝对路径。如果您不指定路径,则 AS 文件必须位于以下位置之一:

与 FLA 文件位于同一个目录。与包含 #include 语句的脚本位于同一个目录。
全局 Include 目录,该目录为以下目录之一:- Windows 2000 或 Windows XP:C:\Documents and Settings\用户\Local Settings\Application Data\Macromedia\Flash 8\语言\Configuration\Include- Macintosh OS X:Hard Drive/Users/Library/Application Support/Macromedia/Flash 8/语言/Configuration/Include
Flash 8 程序\语言\First Run\Include 目录;如果您在此目录中保存一个文件,则在下次启动 Flash 时,会将此文件复制到全局 Include 目录中。
若要为 AS 文件指定相对路径,请使用单个点 (.) 来指示当前目录,使用两个点 (..) 来指示父级目录,并使用正斜杠 (/) 来指示子目录。请参见以下示例部分。

若要为 AS 文件指定绝对路径,请使用您的平台(Macintosh 或 Windows)所支持的格式。请参见以下示例部分。(不建议使用此方法,因为此方法要求任一编译此脚本的计算机上均具备相同的目录结构。)

如果您将文件放在 First Run/Include 目录或全局 Include 目录中,请备份这些文件。如果您需要卸载或重新安装 Flash,可能会删除和覆盖这些目录。

不要将分号 (;) 放在包含 #include 指令的行的末尾。

可用性:Flash Player 4.0;ActionScript 1.0

参数
[path]filename.as:String - filename.as要添加到"动作"面板或当前脚本中的脚本的文件名和可选路径;.as 是推荐使用的文件扩展名。

示例
下列示例说明指定要包含在脚本中的文件的路径的各种方法:

// Note that #include statements do not end with a semicolon (;)
// AS file is in same directory as FLA file or script
// or is in the global Include directory or the First Run/Include directory
#include "init_script.as"

// AS file is in a subdirectory of one of the above directories
// The subdirectory is named "FLA_includes"
#include "FLA_includes/init_script.as"
// AS file is in a subdirectory of the script file directory
// The subdirectory is named "SCRIPT_includes"
#include "SCRIPT_includes/init_script.as"
// AS file is in a directory at the same level as one of the above directories
// AS file is in a directory at the same level as the directory
// that contains the script file
// The directory is named "ALL_includes"
#include "../ALL_includes/init_script.as"

// AS file is specified by an absolute path in Windows
// Note use of forward slashes, not backslashes
#include "C:/Flash_scripts/init_script.as"

// AS file is specified by an absolute path on Macintosh
#include "Mac HD:Flash_scripts:init_script.as"


上一页:    下一页: 

 
 
网站导航:
网站首页|东汇设计|网站建设|网页制作|成功案例|网站优化|网站推广|域名注册|虚拟主机|企业邮局|网络营销|网站建设知识|联系我们|在线留言|网页设计

东汇东莞网站建设公司 地址:东莞市旗峰路176号旗峰数码广场418# 版权所有:东莞网站建设服务商-东莞市百威软件科技·东汇设计网络公司
电话:076922332641 手机:13650104846 13559782770