flash action实例学习笔记

合集下载

Action语句讲解 flash学习

Action语句讲解        flash学习

五、如何使用按钮控制跳转到某一场景的 某一帧:
1、鼠标右键单击按钮,然后右键菜单中选择动 作。 2、在语句窗口左侧展开全局函数,再展开影片 剪辑控制,双击on,再双击release,然后再展开左侧 全局函数下的时间轴控制,双击gotoandplay,括号 内输入半角的1,然后单击脚本助手按钮,选择场景 和填入帧数。
六、如何使用按钮控制声音的播放与停止:
1、鼠标单击按钮,然后右键菜单中选择动作。 2、在语句窗口左侧展开影片剪辑控制,再双击 on指令,再出现的选项中双击release选项,在出现 的两个语句中间回车加入一个空行。 3、如果按钮为停止播放按钮,则在中间行加入 代码“声音对象名.setVolume(0);”或“声音对象 名.stop();”。如果按钮为继续播放按钮,则在中间行 加入“声音对象名.setVolume(200);”或“声音对象 名.start();”。
1鼠标右键单击按钮然后右键菜单中选择动2在语句窗口左侧展开全局函数再展开影片剪辑控制双击on再双击release然后再展开左侧全局函数下的时间轴控制双击gotoandplay括号内输入半角的1然后单击脚本助手按钮选择场景和填入帧数
Flash常用脚本语言说明
(Actionscript)
一、如何使动画播放乐曲(或歌曲):
主要操作技巧总结
一、设置一些对象的大小或调整它们的位置时, 最好使用长、宽数值输入设定和坐标定位。
二、要养成使用复制与粘贴的好习惯,粘贴时注 意应粘贴到当前位置。
三、只有组件才可以针对的对象是图形,补间动画针对 的是组件。
五、在输入Action代码时,如果想使用脚本助手, 需要先在语句括号中输入一个数值。 六、按钮对应的Action代码必须放在on和 release之间。

自我学习笔记

自我学习笔记

•学习时间:2012年10月8日•学习内容:FLASH课程•参考资料:FLASH动漫创作技法•学习的具体内容记录:看了老师提供的flash网站,我觉得自己还有很多很多知识盲点。

还有很多东西需要花时间学习flash。

看到网站上有关flash的招聘信息,原来学好flash还有会很多工作机会提供。

Flash可以做很多事情,比如公益广告、MV、环保法制交通灯方面的公益广告、手机动画、贺卡、教学课件。

更可以做工作简历,以前只听说过视频、PPT简历,现在还有flash简历,我觉得对于教育技术专业的毕业生而言,把三维编程flash结合起来做成一个基于flash的简历,对于寻求工作会很有帮助,这个也可以作为教育技术毕业生最具体的展示实力的凭证。

口说无凭,实干才是真理。

用实物来证明自己才是王道。

Flash的功能中,我最喜欢的是公益广告、公司简介这方面的。

在flash网站我看到了一个很好的flash公益广告的案例,如果不是在flash模块里看见的估计我会认为它是用视频特效做出来的。

该flash展示了一段有关发生车祸时,2位男女主角身体上的伤害,它通过特写心脏、大脑、血管等器官在车祸中具体的变化即损伤,向每位观看者提供了一种视觉上、心里上的反应。

给人以最直观的感触,让人清醒的意识到超速、车祸带来的红色恐怖。

比任何口头上的描述疼痛都来得有效。

因此我觉得flash在公益广告方面会有很大的引导作用。

另一方面,flash一般以动画的形式表现出来,小朋友会很喜欢,对于中国下一代的教育有非凡的意义。

对于我自己的学习而言,我借了一本台湾编的flash教程书,我觉得这本书编的很好,对思维的切入,便于理解,上手很轻易。

我希望除了听老师课上的东西以外,听过自学能学习更多的东西。

在看到很多不错的flash时能细细想一下别人是怎么做出来这种效果的。

还有网上很多有关设计的内容,希望这些对以后的积累有所帮助。

自己慢慢的积累,以后也能参加短片制作大赛。

flash动画制作中的Action要点课件

flash动画制作中的Action要点课件

四、look and see
◆ 基本语法规则 5.大小写字母 5.大小写字母
在ActionScript中,只有关键字区分大小写。对于其余的ActionScript, 可以使用大写或小写字母。如果在书写关键字时没有使用正确的大小写,你的脚 本将会出现错误。如: btn.onRelease = function() 如果写成 btn.onrelease = function() 就是错误的。 on 和 release 本来是两个英文单词,当写在一起组成事件时,第一个单 词无须大写,但后面的单词第一个字母一定要大写,否则会出错,再如 gotoAndPlay等。
四注释 6.注释
如果在用户创建脚本时加上注释,会使脚本易于理解: on(release) { // 建立新的日期对象 myDate = new Date (); currentMonth = myDate.getMonth (); // 把用数字表示的月份转换为用文字表示的月份 monthName = calcMonth(currentMonth); year = myDate.getFullYear (); currentDate = myDate.getDat (); }在脚本窗口,注释内容用灰色显示。它们的长度不限,且不影响导出文件的大 小。
五、数据类型
◆ 对象 对象是属性的集合。 对象是属性的集合。
对象数据类型包含大量而又复杂的信息。因此,该类型的变量不能存储实际值, 对象数据类型包含大量而又复杂的信息。因此,该类型的变量不能存储实际值,而只能 存储对值的引用。这种引用就象一个指向变量内容的别名。 存储对值的引用。这种引用就象一个指向变量内容的别名。当这个变量需要知道它的值 该引用就请求变量的内容,返回答案,但并不把值传递给变量。 时,该引用就请求变量的内容,返回答案,但并不把值传递给变量。这种通过引用获取 变量实际内容的方式称为传址。 变量实际内容的方式称为传址。 下面是一个传址的例子: 下面是一个传址的例子: var myArray = ["tom", "dick"]; var newArray = myArray; myArray[1] = "jack"; trace(newArray); 上面的代码创建一个数组对象, myArray,它有两个元素。 上面的代码创建一个数组对象,称为 myArray,它有两个元素。var newArray = myArray语句建立了变量newArray和对myArray的引用 当语句myArray[1] "jack"改变 语句建立了变量newArray和对myArray的引用。 myArray语句建立了变量newArray和对myArray的引用。当语句myArray[1] = "jack"改变 myArray数组的第二个元素的值时 引用该元素的所有变量的值都会跟着改变。 数组的第二个元素的值时, 了myArray数组的第二个元素的值时,引用该元素的所有变量的值都会跟着改变。trace 动作将把[" ["tom", "jack"]而不是["tom", "dick"]传送到输出窗口 而不是[" 传送到输出窗口。 动作将把["tom", "jack"]而不是["tom", "dick"]传送到输出窗口。

Flash笔记

Flash笔记

群组:动画打散:形状第一节、简介一、作用:是一个基于矢量的处理矢量图形和位图,为网络站点设计图形和动画,它早创建电影部分和播放器组成。

包括源文件(*.fla)和播放文件(*swf)二、组成:影片-场景-时间轴-图层-帧—台(用于放置构成动画的对象)三、帧分为静态帧和关键帧1、静态帧(F5):简单地重复前面帧的内容:2、关键帧(F6,F7):是内容的替换对象性质改变的地方,每个图层默认第一帧为关键帧四、动画:分为帧帧动画和渐变动画1、帧帧动画:将静态对象分布在不同的关键帧中,人百边缀成动画;2、渐变动画:由用户创建动画的首帧和末帧,然后由flash自动生成中间的过渡帧,变动画包括图形渐变(绿色)和移动渐变(蓝色)。

实例:写字效果●Ctrl+n(新建影片)●Ctrl+J(设置影片属性)●选定层1,输入文字●选择文字,ctrl+B(按两次)●选择层1的第二帧,插入关键帧(F6)●利用橡皮擦工具按照书写文字的相反方向擦除文字的一部分●选择层1的第三帧,然后F6,继续擦除●选择层1,在帧上:右击-翻转帧眨眼睛文字变换:●Ctrl+N●Ctrl+J●选定层1,输入文字,且编辑●选择文字,打散●选择层1的50帧,F7(插入空白帧),且输入文字并打散●在两帧之间创建形状动画烟花效果:●绘制无边框有填充的小圆●层1的10帧,按f6,且改变圆的位置●选定15帧,按F6,且绘制许多的小点●每两帧间创建形状动画翻书:●选定层1,绘制无边框有填充的矩形;且群组●将矩形的中心点,移至左侧●层1的30帧60帧分别F6●选择30帧中的矩形,ctrl+T(变形面板),垂直倾斜为-89度,●选择60帧中的矩形,垂直倾斜为了180度●每两帧之间创建运动动画钟:雨刷第二节、设置一、舞台的设置:●大小;ctrl+F3(属性面板),或ctrl+J或,双击fps●移动:滚动条,手形工具,按空格键后用鼠标移动●缩放:放大镜,ctrl+‘+’,缩放比例;●舞台的显示:是否锁定(ctrl+shift+W)●Ctrl+1(百分百显示舞台)或双击放大镜●Ctrl+2(刚好显示舞台)●Ctrl+3(显示当前对象占据的窗口)二、网格、标尺、辅助线注:捕捉舞台的中心:ctrl+2,然后选择对象后ctrl+C,ctrl+V三、场景的设置打开‚窗口‛-‚其他面板‛-‚场景‛(shift+F2)可以进行复制、新建、删除、改名及更改动画多个场景的播放顺序;新建场景:‚插入‛-‚场景‛场景的大小:默认值为550*400PX,最大为2880*2880px,最小为18*18px;四、更改动画播放速度1、调整帧频(fps,每秒钟的帧数,范围0.01-120)2、改变两帧间的跨度五、基于模板新建影片‚文件‛-‚新建‛,在类别中选择‚从模板新建‛如需要自定义模板,则将影片‚另存为模板‛六、时间轴●组成部分:帧、层、帧标题、播放磁头、帧视图菜单;●帧居中:使当前帧居中显示:●帧的显示:包括小、标准、预览、较短等;●帧的使命名:只能针对关键帧,通过属性面板设置;●关键帧的复制:选定关键帧后,按alt+托运flash(fl)第一节、简介一、作用1、flash是一个基于矢量的处理矢量图形和位图为网络站点设计图形和动画,它由创建电影部分和播放器组成;源文件为*.fla,播放器文件为*.swf;2、组成:影片——场景——舞台(时间轴——图层——帧)3、帧分为静态帧和关键帧:1)、静态帧(F5):简单重复前面的内容;2)、关键帧(F6,F7):是内容的替换和对象改变的地方,每个图层的第一帧默认为关键帧;4、动画:分为帧帧动画和渐变动画1)、帧帧动画:将静态图像分布在每一个帧中,从而连缀成动画;2)、渐变动画:由用户创建动画的首帧和末帧,然后由flash自动生成中间的过渡帧,包括移动渐变(蓝色)和形状渐变(绿色);二、实例:1、写字效果选择所以帆——选择翻转帧——ctrl+回车(做文字帧帧动画)。

flash第1讲ActionScript基础

flash第1讲ActionScript基础

1.5.2 了解内置对象
1. 实例化对象 如果要创建动作脚本类的实例时,可使用new 运算符调用该类的构造函数。构造函数与类始终 具有相同的名称,并返回该类的实例,而用户通 常会将该实例分配给一个变量,例如: var song:Sound=new Sound(); 上述代码表示创建了一个新的Sound对象。
1.5.1 面向对象编程中的几个基本概念
“对象” 是指属性和方法的集合,每个对象都具有 其各自的名称,并且都是特定类的实例。相比较而言, 对象是一个形象具体的概念,如生活中所使用的笔、纸 张、书籍、计算机等,都可称之为对象。而对于每个对 象来说,它们都具有一些区别于其他对象的个体属性, 如大小、形状、颜色、使用方法等。Flash中使用的内置 对象都是在动作脚本语言中预先定义的。

1.5.2 了解内置对象
几种顶级类: (1)Key:Key类是不通过构造函数即可使用其方法和属性 的顶级类。使用Key类的方法可生成用户能够通过标准键盘控 制的界面,该类的属性是常量,表示控制游戏时最经常使用的 键。 (2)Mouse:使用Mouse类的方法可隐藏和显示SWF文件 中的鼠标指针(光标)。默认情况下鼠标指针是可见的,但是 用户可以将其隐藏并实现用影片剪辑创建的自定义指针。 (3)Math:使用Math类的方法和属性可以访问和处理数学 常数和函数。

1.5.2 了解内置对象
2. 需要绑定的类 在动作脚本中,还有一些对象类需要绑定到 【库】面板中的某个对象上,如MovieClip、 Sound等。

No Image
1.5.2 了解内置对象
3. 顶级对象类 有些内置动作脚本类,类成员(属性和方法)通 过类名本身来访问或调用的,而不是通过类的实 例,也就是说,不用创建类的实例即直接使用这 些属性和方法。

7个Flash常运用案例

7个Flash常运用案例

7个Flash常运用案例7个FLASH 实例实验一:名称:两小车相向运动目标:掌握补间动画的制作。

初步认识图层的应用。

实验步骤:1.在图层1第1帧,在舞台左下侧用矩形工具画车身,椭圆工具画俩车轮。

2.在图层1第30帧插入关键帧,将小车水平移动到舞台右下侧。

3.图层1第1帧和第30帧之间单击右键,选择“创建补间动画”。

4.锁定图层1。

单击图层1,选中其所有帧后右键复制帧。

5.创建图层2,在第1帧位置单击右键“粘贴帧”。

6.单击图层2,选中其所有帧。

在选种帧(黑色)上单击右键,选择“反转帧”。

7.分别修改图层2第1帧和30帧上小车的在位置。

实验二:名称:科技之光目的:掌握引导层的使用,了解引导层不可见,不可封闭两属性。

步骤:1.插入新元件,影片剪辑类型,随即进入元件编辑状态。

2.在第1帧上画一个只有边线没有填充的椭圆。

用对齐面板,令其相对舞台,水平/垂直居中。

锁定。

3.插入新图层,图层2上第1帧画一小圆。

第30帧位置插入关键帧。

创建补间动画。

锁定。

4.在图层2上插入引导层。

5.复制图层1第1帧,在引导层第1帧上单击右键“粘贴帧”。

6.用橡皮擦将引导层第1帧上的椭圆擦出一个小缝隙。

7.图层2解锁,将第1帧的圆吸附到引导层椭圆的一个端点上,然后选中第30帧,将圆吸附到引导层椭圆的另一个端点上。

8.单击场景1,返回主场景(目前空白)。

9.从库中将刚才制作完毕的影片剪辑元件拖到舞台中央。

10.利用变形面板(ctrl+T)调出。

旋转60度,单击右下角,复制并应用变形工具。

得出另外两个副本。

制作完毕。

注意:最后一步要用任意变形工具调整好旋转的轴心即为对象的中心。

实验三:内容:遮罩与元件的组合实例目的:进一步掌握影片剪辑元件的制作和应用,深层理解遮罩的原理和相关知识。

步骤:1、导入图片A到舞台,利用对齐面板将其居中,匹配宽高。

锁定图层1。

2、插入新图层,导入图片B到舞台,余下操作重复步骤1。

3、创建新元件为影片剪辑类型。

flash_action

Flash action script这里我只简单的介绍一下AS的基本常识。

首先我们要了解AS要写在什么地方,什么时候AS会被触发执行。

1、帧:写在关键帧上面的AS,当时间轴上的指针走到这个关键帧的时候,写在这个帧上面的AS就被触发执行了。

常见的例子有在影片结尾的帧写上stop() 等。

操作方法就是点选关键帧,然后打开AS面板。

2、按钮:不同于帧上面的AS,按钮上面的AS是要有触发条件的。

要把AS写在按钮上,操作方法是点选目标按钮,然后打开AS面板。

举个例子能说的更明白。

假设有一个动画,要让它在播放完同时停止,那么,你要做的就是在这个动画的最后一帧写ASstop();再假设有个按钮,效果是按下按钮后停止播放,那么步骤如下。

做一个按钮,放到主场景,点选按钮,然后打开AS面板。

现在如果也在按钮上写stop();那么,输出的时候就会提示错误。

正确的应该这样写on(release){stop();}这里要比帧的动画多这些代码: on(release){} , 整个代码翻译过来就是:当(松开){停止}这里用的是release 松开,鼠标的触发事件之一,按钮的常用事件:release 松开releaseOutside 在按钮外面松开press 按下rollOver 鼠标进入按钮的感应区rollOut 鼠标离开按钮的感应区现在很明确了:写在按钮上面的AS一定就是这种格式的:on(事件){要执行的代码}3、MC(电影剪辑)如果你看懂了上面的内容,那么写在MC上面的AS和写在按钮上的大同小异。

操作方法就是点选MC,然后打开AS面板。

看个例子onClipEvent(load){stop();}同样,MC需要一个事件来触发AS的执行。

翻译这段代码就是当剪辑(载入){停止}load表示一个事件。

MC的事件有下面这些:load 载入,当MC出现的时候执行。

也就是除非卸载这个MC,否则load事件内的代码只执行一次unload 卸载,当MC卸载的时候执行enterFrame 存在的每个帧。

《网页动画制作flash CS5基础案例与教程》模块8 ActionScript 3.0基础知识


总结与回顾
• 本模块主要简单介绍了ActionScript 3.0脚本语言 的一些基本语法,并通过三个具体任务,展现了 脚本语句在使用时的具体形式,以及具有实现一 些复杂效果的功能。
教育成就未来
– 1. ActionScript 3.0创建对象 格式:var 变量名:变量类型=值; – 2. ActionScript 3.0创建类
class 类名{ 声名变量 函数 }
必备知识
– 3.事件
事件是能够响应系统或用户特定操作的集合。包括事 件源、事件类型侦听、事件相应
– 4. ActionScript 3.0脚本的基本语法
元件”缩小”按钮从库中分别拖入场景中,并 依次设置元件的”实例名称”为”fdan”和 ”sxan”。 • 7. 新建”图层4”,在”动作—帧”面板中输入 脚本语言。
操作步骤
• 8.完成ActionScript 3.0控制图像放大缩小动画的制作 ,按【Ctrl+Enter】测试影片,并将影片保存。
任务2
所执行的动作 2.按钮动作的应用 • 要控制动画的播放以及用户与动画的交互,就必
须通过按钮来实现,给按钮添加动作的语法是: on (事件){ 执行动作;
}
必备知识
3. 按钮事件处理函数 按钮的实例名称.按钮事件处理函数 = function() { 执行的动作; }
4.onClipEvent()(影片剪辑事件) 格式:
操作步骤
• 13.事件触发10次,定义对象“pp”为影片剪辑元 件实例“paopao”,再通过“addChild”函数将 “pp”实例添加到场景中并将其保存于以变量“i” 为下标的数组对象“pao”中,再设置该对象实例 的坐标值与鼠标的坐标值一致,并让变量“i”增 加1。

flash AS脚本学习笔记

【写在前面】本学习笔记只研究AS语言(AS2.0)。

不涉及动画制作部分。

所有实例均在Flash CS6中制作并测试通过,中文多使用微软雅黑字体(实例【填空题】Ctrl+Enter测试时无法输入中文】,但发布swf格式后没有问题,可能是CS6对中文支持不好)。

AS包含大量函数,受本人能力和精力限制,只能尽可能以基本函数和制作课件时会用到的函数为实例,进行整理。

实例中没有逐条解释,但课件实例前知识点和课件思路都已写下来。

AS2.0语法不是很严格,本人在实例中所写代码有些部分可能不是很规范(可运行不代表规范),一个问题也可以有多种写法,大家共同研究、讨论、提高。

第一部分脚本基础知识FLASH脚本-AS概念:■Action Script是Flash的脚本语言, 具有强大的交互功能,通过脚本应用,用户对动画元件的控制得到加强。

目前提供了AS2.0和AS3.0两个版本。

■动作面板是Flash提供的运行编程的专用环境——F9打开动作面板;动作面板界面动作面板工具栏几个基本概念:动作:动作是在播放SWF文件时指示SWF文件执行某些任务的语句。

对象:是面向对象程序设计的核心和基本元素,对象把一系列的数据和操作该数据的代码封装在一起,从而使得程序设者在编程时不必关心对象内部的设计。

属性:用于定义对象的特性,如是否可见、颜色和尺寸等。

方法:是与对象相关的函数,通过这些函数可操纵对象或了解与对象相关的一些信息。

事件:触发作用的事情,如鼠标移动,按下。

Action Script的基本语法点语法:动作脚本中,点(.)通常用于指定对象或影片剪辑相关联的属性或方法,或者标识影片剪辑、变量、数对象的目标路径。

点语法表达式是以对象或影片剪辑的名称开始,后跟一个点,最后以要指定的元素结束。

小括号:定义函数中的相关参数;大括号:{ }形成一个完整的语句块;分号:每条语句以;结束;注释://后可跟上注释;字母大小写:关键字要区分大小写;在AS2中,ActionScript代码可以添加到关键帧(Keyframe)、按钮(Button)或影片剪辑(Movie Clips)中,并分别称之为帧动作、按钮动作及影片剪辑动作。

flash学习笔记(flash学习笔记)

flash学习笔记(flash学习笔记)Ctrl+shift+v paste to the original locationTwo, the pen toolStraight line (line)Curve (curve points, click the down on drag, similar to the AutoCAD line)The shape (part selection tool, to change the node)Add and delete nodes (with the appropriate tool pen tool)The conversion of straight lines and curves (also can directly convert anchor point tool, drag)Conversion between closed graphics and closed graph (without the use of magnets)Window colorOpen scale drawing auxiliary linesHold ALT copyCtrl+c, ctrl+shiftDelete shift+F5 frameF5 frameThree, the layer (bottom left) (similar to PS)1,create a new layer and delete layer, hidden layer, lock the layer, display mode (contour, entity)((ALT click eyes, said to hide or show other layers)Layer Folder2,library (ctrl+1): used to store the elements and sounds, repeated callElement (Library) and examples (in the scene, the relationship between components and examples can be understood as the base and derived class in C++)Copy the element in the library (right)3,ctrl+F8 creates a new elementDrawing sub profile, instance attribute exchange4,flash file formatFla (save) and SWF (EXE, derived films) (create player) Four, the text tool1,static text (text: attribute operation is similar to the word, links to write the web address, making three-dimensional characters is similar to the word is a copy)Modify the shape of the line becomes filled, soften fill edges. Hold the ALT drag is copied, the text first into parts to outlineDouble click on the contour is fullModify: vertical flipTo be good at using a magnifying glassDistributed to every layer3,any deformation toolsShift zoom ratioALT symmetric zoomAlt+shift from the center to the periphery such as zoom ratioCTRL free deformationCtrl+shift PerspectiveThe deformation of the panel (ctrl+t) Five, the combination of tools bination object (ctrl+G)The first combination of objects in the bottomDirect drawing objects2,alignment panelAfter selection by ctrl+k (each time to choose the object now button) 3,import picturesHold the ALT only side of the size adjustmentSix, deformation and animation (object parts)1,the so-called deformation animation refers to the change of the shape of the animationDeformation animation requirements: must be the object parts (graphics); create a shape Tween2,can be a file database directly onto another file.3,the deformation gradient tool4,modify the shape, add shape hint (can be defined in terms of shape deformation process has been created under the ctrl+shift+h shape tween)View display shape prompt (shape tip position should be off a little to let them know what is on the edge of the point at the intersection)5,the traditional complement can set rotationSeven, frame animation (any type of object can be)Refers to each frame is the key frame1,the eyedropper tool (I) : learn the fill color and the border color (according to shift at the same time learn from both), equivalent to word in the format of the brush (can make the same color graphics)2,flip the frame (right): select the reverse play animation3,the import can automatically create a sequence of pictures of key framesEdit multiple frames4,the transform and registration pointChange point: that is referenced by a series of operations on the object of the transformation: Mobile, rotating, zoom, tiltThe registration point: the position of the object to the specified point (parts: default registration point in the upper left corner, element: registration)5,the lasso tool (similar to PS):! ! ! Eight, movie clips (one element): refers to the so-called movie clip may contain an animation1 different points, movie clips and graphics is a movie clip animation player has nothing to do with the main scene in time frames, and broadcast graphics animation is associated with the main scene of the time frames.Synthesis of movie clips and the main motion in the sceneConvert 2, movie clips and graphics3,element - properties - cycle - (single frame display control is single frame playback or loop)4,the movie clip can be nested movie clips5,the graphics generation method perspective: arbitrary deformation tool (ctrl+shift) or selection toolNine, the animation path1,the path on the guiding layer, guided layer deposited object (element or movie clip), guide layer object will not be displayedRight click to add layer: traditional guide layer (new guide layer, this layer is guided into the original layer), guiding layer (the original layer becomes the guide layer)The starting point must be alignedThe frame is always along the shortest path, so to element along a closed path, this path is either a small gap, or build several key frames2,for non symmetrical objects (inter - attribute adjustment path), makes the object in moving along the path while rotating, note the gap position3,use the eraser tool.The 4 line is formed, the animation frame by frame animation, to each frame are made complete, then for each frame modification5, a guide layer can lead to multiple layers6,if the main scene frames less than the number of frames in the video clip, the movie clip will not play all.Ten, button1,built-in flash button: the window of Public Library - button2,graphics into the button (F8)3,direct the new button (ctrl+f8) 4 buttons, each frame: bounce, pointer after press, click(mouse response area)5, press the space bar can pan the view; view 一close! 6, restore the panel parameters: the first graphical break up, then can be combined7,pay attention to the different options for various tools, such as whether to allow the filling voids, various forms of rectangular8,line style9,with a single frame (easy to repeat, only need to modify the content)10,voice: - Import - import files into the library! ! ! Eleven, mask animation (with shape animation, movie clips can do wonders)1,masking layer and the mask layer with pattern mask layer in shape (note,Just like shape and PS) to display the image of the mask layerRight click the layer: the mask layer (layer into the original mask layer, the lower layer as mask layer)2,learn to use the mask layer, the mask layer when text3,some graphics can be formed through the combination of arc offset4,the magic wand is choose the same color (only applicable to bitmap after scatter)5,F6 can be tween into key framesTwelve, animation script (with the code statement to achieve interactive animation, similar to visual c++)1,Action Script2.0 and Action Scripts.02,add ActionScript object:Key frames, buttons, movie clips3,the selected object: open the actions panel (F9 or window or right-click)*4, in the key frame to add the script only when playing to the frame when the code is executed(directly in the frame, can also add a new layer)5,when the program is casesensitive handwriting6,the property - frame label to add frame name (which can not choose the frame number and frame label to write code)7,new scene: insert the sceneThe goto statement can jump to the sceneIn an animation if multiple scene animation is played according to the scene of the order8,dynamic text, variable name*9, button script format:On (mouse){}10,getURL: link to an address.Links: http:\\Email link: mailto:11,random random function:Random (13) from 0 to 12 any12,fscommand function:Fullscreen (true\false)QuitShowmenuAllowscale13,loadmovie:Loading swf files or pictures and other elements to the movie All SWF files must be placed in the same folder.*14, video editing script format:OnClipEvent (video clip events){}15,attribute - name16,the default button to add the script only plays the role of the button is located in the scene.Grammar point (. ) said "............................. In"_root. said at the scene ofthe LordThis said the current。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

动作脚本属性:是在flash内部创建的样式表属性textAlignfontSizetextDecorationmarginLeftmarginRightfontWeightfontStyletextindentfontFamilycolordisplay定义的外部css属性需要加上-号例如:text-align align 的a 不需要大写实例:mycar.play() 播放电影剪辑_width 宽度、事件处理函数:对事件作出响应的程序段on(realse){ //单击按钮时播放动画play();}_x _y _alpha 横坐标纵坐标透明度Date.getHours()Math.abs()常数Math.PI常数:Key.HOME Key.CONTROL Key.ENTER 分别表示home,ctrl键enter 键Ationscript 的关键字Break case class continue default deleteIf implements import in instanceof interfaceDynamic else extends for function getIntrinsic new private public return setStatic switch this typeof var voidWhile with\f 换页符\n 换行符\r 回车符var a=99;var b=88;If (a>b) {trace(“a>b”);}else if {trace(“a<b”);}计算绝对值var x= Math.abs(“-4”);myMovieClip.startDrag(true)将影片剪辑设置为可拖动myMovieClip._x 可获取横坐标属性值TextFiled.StyleSheet类getStyle()getStyleNames()load()parseCSS()setStyle()gotoAndStopgotoAndPlay(9);gotoAndPlay(“scene2”,2)场景2的第二帧nextFrame prevFramenextScene prevScene按钮对事件作出的反应pressreleaserollOverrollOutdragOverdragOutkeyPress(“key”)on (release,keyPress “<Right>”){_root.car.gotoAndPlay(12);_root.bus.nextFrame();car._x +=5;}for (var I in _root){_root[i]._rotation +=35;}指路行驶:on (keyPress "<Left>"){car._x -= 5;}on (keyPress "<Right>"){car._x +=5;}on (keyPress "<Up>") {car._y -=5;}on (keyPress "<Down>") {car._y +=5;}还可加入方向car. rotation -=90;小球回旋影片剪辑onClipEvent (load) {var width = _root._width;var height = _root._height;var deltaX = deltaY=10;_x = _root._width/100;_y = _root._height/100;}onClipEvent (enterFrame) {_x += deltaX;_y += deltaY;if (_x>=width-10 || _x<=10) {deltaX *=-1;}if (_y>=height-10 || _y<=10) {deltaY *= -1;}}影片剪辑事件;loadunloadenterFramemouseMovemouseDownmouseUpkeyDownkeyUpdata星星下落程序自定义事件处理函数stop();var flag = 1;_root.onMouseDown = function() {flag *= -1;};for (var i in _root) {_root[i].onEnterFrame = function() {if (flag == 1) {this._y += 10;this._alpha -= 2;this._xscale = this._yscale -= 1; //_xscale 横坐标缩放if (this._y>=430) {this._y = -30;this._xscale = this._yscale=this._alpha=100;}}};}鼠标右键错误:var my_cm = new ContextMenu();my_cm.customItems.push(new ContextMenuItem()("旋转", rotate));my_cm.customItems.push(new ContextMenuItem()("下落", drop));my_cm.customItems.push(new ContextMenuItem()("缩放", zoom));my_cm.hideBuiltInItems();function rotate(obj, item) {obj.onEnterFrame = function() {this._rotation += 15;};}function drop(obj, item) {obj.onEnterFrame = function() {this._y = (this._y+8)%400;};}function zoom(obj, item) {obj.onEnterFrame = function() {this._xscale = this._yscale -= 5;if (this._xscale<=-100) {this._xscale = this._yscale=100;}};}for (var i in _root) {_root[i].menu = my_cm;}游动的死鱼:total = 100;var headV el = 13;var bodyV el = 1.1;var scaleDelta = 3;var xpos = new Array();var ypos = new Array();for (i=1; i<=total; i++) {if (i == 1) {attachMovie("head", "fish"+i, total+1-i);} else if ((i == 2) || (i == 13)) {attachMovie("fin", "fish"+i, total+1-i);} else {attachMovie("body", "fish"+i, total+1-i);}with (_root["fish"+i]) {_xscale -= scaleDelta*i;_yscale -= scaleDelta*i;_alpha = 100-(100/total)*i;}}_root.onEnterFrame = function() {xpos[0] += (_xmouse-xpos[0])/headV el;ypos[0] += (_ymouse-ypos[0])/headV el;for (i=1; i<=total; i++) {xpos[i] += (xpos[i-1]-xpos[i])/bodyV el;ypos[i] += (ypos[i-1]-ypos[i])/bodyV el;}for (i=1; i<=total; i++) {with (_root["fish"+i]) {_x = (xpos[i-1]+xpos[i])/2;_y = (ypos[i-1]+ypos[i])/2;_rotation = 90+180/Math.PI*Math.atan2((ypos[i]-ypos[i-1]), (xpos[i]-xpos[i-1]));}}};删除动态生成的实例;var i = j=0;_root.onMouseDown = function() {attachMovie("star", "star"+i, i);_root["star"+i]._x = _xmouse;_root["star"+i]._y = _ymouse;i++;};_root.onKeyDown = function() {if (_root["star"+j]._visible) {removeMovieClip(_root["star"+j]);j++;}};Key.addListener(_root);深度的应用:attchMovie getDepth getNextHighestDepthgetInstanceAtDepth()//返回指定深度的实例swapDepth()for (var i=0;i<6;i++){attachMovie("shape","shape"+i,i);_root["shape"+i]._x=80*i;_root["shape"+i]._y=80*i;_root["shape"+i].onRelease=function(){while(this.getDepth()!=_root.getNextHighestDepth ()-1){for(var m=this.getDepth();//当前实例深度值m<_root.getNextHighestDepth ()-1;m++){//依次比较当前深度与最大深度,并确保当前深度为最大_root.getInstanceAtDepth (m).swapDepths(_root.getInstanceAtDepth (m+1));}}};}碰撞试验但不能完成所有操作:var vel = new Array();for (var i = 0; i<3; i++) {attachMovie("ball", 2*i+1, 2*i+1);attachMovie("ball", 2*i, 2*i);with (_root[2*i]) {_x = _width/2;_y = _height/2;vel[2*i] = 5+i*5;}_root[2*i].onEnterFrame = function() {var id = (this._y-50)/100;this._x += _root.vel[2*id];this._rotation += 360*_root.vel[2*id]/(2*Math.PI*(this._width/2));if (this.hitTest(0, this._y, false)) {vel[2*id] *= -1;}};with (_root[2*i+1]) {_x = 400-_width/2;_y = 50+i*100;vel[2*i+1] = 10+i*2;}_root[2*i+1].onEnterFrame = function() {var id = (this._y-50)/100;this._x -= _root.vel[2*id+1];this._rotation -= 360*_root[2*id+1]/(2*Math.PI*(2*this._width/2));if (this.hitTest(_root[2*id]) || this.hitTest(400, this._y, false)) {vel[2*id+1] *= -1;}};}startDrag(true,left,top,right,bottom)stopDrag()的用法onClipEvent(load){x=_x;y=_y;}on(press ){this.startDrag(true,x,y,x,y+300);}on(release, releaseOutside){this.stopDrag();}动态遮罩的应用:this.removeMovieClip()__.setMask(---)_root.createEmptyMovieClip("mask", 1);picture.setMask(mask);_root.mask.onMouseMove = function() {var i = this.getNextHighestDepth();this.attachMovie("circle", i, i);this[i]._x = this._xmouse;this[i]._y = this._ymouse;};mc的绘图功能:var drag = false;_root.createEmptyMovieClip("square", 0);with (square) {lineStyle(0, 0xFF0000, 100);moveTo(-5, -5);beginFill(0xDDDDDD);lineTo(-5, 5);lineTo(5, 5);lineTo(5, -5);lineTo(-5, -5);endFill();}square._visible = false;for (var i = 1; i<=5; i++) {_root.square.duplicateMovieClip("square"+i, i);_root["square"+i]._x = 550*Math.random();_root["square"+i]._y = 400*Math.random();_root["square"+i].onPress = function() {this.startDrag(true);drag = true;};_root["square"+i].onRelease = function() {this.stopDrag();drag = false;drawlines();};}function drawlines() {for (var i =1; i<5; i++) {_root.createEmptyMovieClip("line"+i, i+5);with (_root["line"+i]) {_x = _root["square"+5]._x;_y = _root["square"+5]._y;lineStyle(1, 0xffff00, 50);lineTo(_root["square"+i]._x-_root["square"+5]._x, _root["square"+i]._y-_root["square"+5]._y);}}}drawlines();_root.onMouseMove = function() {if (drag == true) {drawlines();}updateAfterEvent();};html标签的使用_root.createTextField("myTxt",0,50,50,400,300);myTxt.html=true;myTxt.text="String.fromCharCode(26*Math.random()+65)";with(myTxt){textColor=0xff0dbf;backgroundColor =0xdddddd;}myTxt.htmlText="<br><br><br> <img src='a.jpg'>";math类的应用:var radius=150;var x0=300;var y0=200;var i=0;var color0=0x885533;_root.createEmptyMovieClip("circle",0)with(circle){_x=x0;_y=y0;moveTo(radius,0);}_root.circle.onEnterFrame=function(){this.lineStyle(6,color0,100,7);this.lineTo(radius*Math.cos(i*Math.PI/180),-radius*Math.sin(i*Math.PI/180));i++;if(i==360){i=0;color0 ^=0xffffff;}};Math类的属性:EPISQRT2SQRT1_2LN2………………Math类的方法:abs()random()round()exp()log()atant2()floor()ceil()pow()sqrt()max()min()sin()cos()tan()acos()acos()atan()11。

相关文档
最新文档