Adobe® Flash® 的 Adobe® ActionScript® 3.0 程式設計

Similar documents
(Microsoft Word - \261M\303D\263\370\247i\247\3572.doc)

KillTest 质量更高 服务更好 学习资料 半年免费更新服务

Microsoft Word - 01.DOC

设 计 竞 赛 内 容 和 评 分 标 准, 旨 在 引 导 职 业 学 校 电 子 商 务 计 算 机 市 场 营 销 等 相 关 专 业 的 教 学 改 革, 展 示 职 业 院 校 电 子 商 务 相 关 专 业 的 建 设 成 果, 推 动 电 子 商 务 职 业 教 育 的 发 展 和 创

中國文化大學第五屆畢業製作-論文組寫作格式樣本

ebook111-4

詞 彙 表 編 號 詞 彙 描 述 1 預 約 人 資 料 中 文 姓 名 英 文 姓 名 身 份 證 字 號 預 約 人 電 話 性 別 2 付 款 資 料 信 用 卡 別 信 用 卡 號 信 用 卡 有 效 日 期 3 住 房 條 件 入 住 日 期 退 房 日 期 人 數 房 間 數 量 入

1. 2. Flex Adobe 3.

Adobe AIR 安全性

coverage2.ppt

<4D F736F F F696E74202D20332D322E432B2BC3E6CFF2B6D4CFF3B3CCD0F2C9E8BCC6A1AAD6D8D4D8A1A2BCCCB3D0A1A2B6E0CCACBACDBEDBBACF2E707074>

Strings

一 引 言 目 的 内 容 系 统 软 件 插 件 配 置... 3 二 系 统 介 绍 系 统 主 要 功 能 系 统 角 色 权 限 申 请 流 程 说 明... 4 三 企 业 申 请

影視後製全攻略 Premiere Pro After Effects Encore 自序 Adobe Premiere Pro After Effects Encore 2008 Adobe CS Adobe CS5 Adobe CS4 Premiere Pro After Effect

FIT1改1.FIT)

关于开展党员组织关系集中

使用 Scene7 Media Portal

广 东 省 高 等 职 业 教 育 品 牌 专 业 建 设 方 案 ( 惠 州 城 市 职 业 学 院 _ 电 子 商 务 专 业 ) 目 录 一 建 设 目 标... 4 ( 一 ) 总 体 目 标... 4 ( 二 ) 具 体 目 标... 4 二 实 施 方 案... 5 项 目 一 全 面

河 南 蓝 皮 书 文 化 (2008) 网 络 文 学 主 要 是 指 在 网 上 原 创 的 文 学 作 品 作 为 网 络 文 化 的 主 力 部 分, 网 络 文 学 的 发 展 在 近 年 来 势 不 可 挡 作 为 凭 借 新 兴 媒 介 兴 起 的 文 学, 网 络 文 学 与 传 统

21 flash

《將進酒》

Chapter 9: Objects and Classes

基于ECO的UML模型驱动的数据库应用开发1.doc

RUN_PC連載_10_.doc

用户大会 论文集2.2.doc

Java java.lang.math Java Java.util.Random : ArithmeticException int zero = 0; try { int i= 72 / zero ; }catch (ArithmeticException e ) { // } 0,

Microsoft PowerPoint - FlexTraining_by_RIAMeeting.pptx

嘉義市政府暨附(所)屬機關電話禮貌測試實施要點

2D Asset Demo Rain Snow SteamSpray VolumeSteam Waterfall Demo Unity Asset store 7.3 2D example\practice\ch07 Unity ch07 MissileExplosion Wall 7-8

RunPC2_.doc

【主持人】:给大家介绍一下,这次的培训是我们画刊部的第三次培训,当然今天特别有幸请来著吊的摄影家李少白老师给我们讲课


untitled


<4D F736F F D B0EABB79A4E5B8D5C344BBBCB065AAA9>


康體藝術

公共圖書館利用教育方案規劃之研究

Microsoft Word SRS - 軟體需求規格.doc

Chapter 9: Objects and Classes

VB程序设计教程

1.5招募说明书(草案)

javaexample-02.pdf

untitled

EJB-Programming-4-cn.doc

石家庄~3

2009 數 位 設 計 創 意 國 際 研 討 會 2009 International Conference on Digital Design & Creativity 論 文 集 論 文 排 序 按 下 列 類 別 : (1) 文 化 創 意 產 業 相 關 之 學 術 論 文 或 實 務

Strings

(TestFailure) JUnit Framework AssertionFailedError JUnit Composite TestSuite Test TestSuite run() run() JUnit

软件工程文档编制

Microsoft Word - 04.doc

XP11067_內文.pdf


3-1 Wii ( )

ebook60-13

RUN_PC連載_8_.doc

4-4

p.2 1 <HTML> 2 3 <HEAD> 4 <TITLE> </TITLE> 5 </HEAD> 6 7 <BODY> 8 <H3><B> </B></H3> 9 <H4><I> </I></H4> 10 </BODY> </HTML> 1. HTML 1. 2.

untitled


DATE 和 DATETIME 資 料 行 相 似 性 與 AIR 測 試 版 不 相 容...8 資 料 行 相 似 性 的 行 為 方 式 與 AIR 測 試 版 不 相 容...9 在 Mac OS 全 螢 幕 模 式 下, 重 疊 視 窗 未 能 隱 藏 停 駐 列 及 選 單 列...9

Microsoft Word - ch04三校.doc

OOP with Java 通知 Project 4: 5 月 2 日晚 9 点

2009年3月全国计算机等级考试二级Java语言程序设计笔试试题

任務二 : 產生 20 個有炸彈的磚塊, 放在隨機的位置編輯 Block 類別的程式碼 import greenfoot.; // (World, Actor, GreenfootImage, Greenfoot and MouseInfo) Write a description of class

Q3 104 年 度 國 民 小 學 教 師 自 然 領 域 學 科 知 能 評 量 之 報 名 流 程 為 何? A3: 1. 網 路 報 名 時 間 為 104 年 8 月 3 日 ( 星 期 一 ) 上 午 8 時 30 分 起 至 8 月 11 日 ( 星 期 二 ) 下 午 3 時 止,

mvc

Chapter 9: Objects and Classes

untitled

(CIP). : /. :, 2003 ISBN F270 CIP (2003) ( 1 : ) : * : : :

2 Java 语 言 程 序 设 计 教 程 简 单 性 Java 语 言 的 语 法 与 C 语 言 和 C++ 语 言 很 接 近, 使 得 大 多 数 程 序 员 很 容 易 学 习 和 使 用 Java 另 一 方 面,Java 丢 弃 了 C++ 中 很 少 使 用 的 很 难

D C 93 2

國土資訊.indd

JBuilder Weblogic

麻 省 理 工 學 院 是 在 西 元 2013 年 12 月 3 日 推 出 MIT App Inventor 2 網 站, 提 供 免 費 的 雲 端 服 務, 使 用 者 可 以 透 過 瀏 覽 器 來 開 發 Android 裝 置 應 用 程 式, 該 網 站 的 網 址 為 : http

基 隆 市 104 學 年 度 國 民 中 學 技 藝 教 育 課 程 技 藝 競 賽 食 品 職 群 ( 烘 焙 主 題 ) 實 施 辦 法 一 依 據 : ( 一 ) 教 育 部 補 助 直 轄 市 縣 ( 市 ) 政 府 辦 理 生 涯 發 展 教 育 及 國 中 技 藝 教 育 相 關 經

Microsoft Word - Learn Objective-C.doc

Microsoft Word - flashgamekid.doc


untitled

世新大學 讀書會

使 用 Java 语 言 模 拟 保 险 箱 容 量 门 板 厚 度 箱 体 厚 度 属 性 锁 具 类 型 开 保 险 箱 关 保 险 箱 动 作 存 取 款

Java

Microsoft PowerPoint - Lecture7II.ppt


9, : Java 19., [4 ]. 3 Apla2Java Apla PAR,Apla2Java Apla Java.,Apla,,, 1. 1 Apla Apla A[J ] Get elem (set A) A J A B Intersection(set A,set B) A B A B

response_mostunwanted_060611_prepared

epub83-1

Microsoft Word - Flash_ActionScript3殿堂之路文字版.rtf

Microsoft Word - connect_pro_7_release_notes_v3_handoff_to_loc.doc

三維空間之機械手臂虛擬實境模擬

<4D F736F F D20A5C1B6A1B3E0C2A7B2DFAB55A4B6B2D02E646F63>

untitled

untitled

05 01 accordion UI containers 03 Accordion accordion UI accordion 54

無障礙網頁開發規範二版(草案)

例 度 讀 讀 不 不 來 念 來 了 讀 不 不 讀 不 讀行 利 了 說 更 了 讀

Microsoft Word htm

chp6.ppt

区 域 活 动 进 入 中 班 我 们 区 域 的 设 置 和 活 动 材 料 都 有 所 变 化, 同 时 也 吸 引 孩 子 们 积 极 的 参 与 学 习 操 作 区 的 新 材 料 他 们 最 喜 欢, 孩 子 们 用 立 方 块 进 行 推 理 操 作 用 扑 克 牌 进 行 接 龙 游

Transcription:

337 18 Adobe Flash CS4 Professional MovieClip ActionScript Flash ActionScript Flash Flash Flash MovieClip MovieClip ActionScript ( ) MovieClip Flash Sprite ActionScript MovieClip ActionScript 3.0 Shape Sprite MovieClip 240 DisplayObject ActionScript ActionScript ActionScript SWF Flash Player ActionScript AVM1 SWF ActionScript 1.0 ActionScript 2.0 SWF Flash Player 8 AVM2 SWF ActionScript 3.0 SWF Adobe Flash Player 9 Adobe AIR SWF SWF SWF SWF SWF

338 MovieClip Flash ( ) ActionScript Flash Player AIR 1 Flash 2 3 Script 4 > 5 mymovieclip mymovieclip 6 > 29 MovieClip SWF Flash MovieClip ActionScript SWF Flash MovieClip childclip parentclip parentclip.childclip.play(); Flash Event.ADDED_TO_STAGE ActionScript 2.0 MovieClip _width _height width height _xscale _yscale scalex scaley MovieClip ActionScript 3.0

339 Flash MovieClip MovieClip ActionScript Flash MovieClip SWF ActionScript Stage.frameRate play() stop() bicycle bicycle.stop(); ( ) startbutton // This function will be called when the button is clicked. It causes the // bicycle animation to play. function playanimation(event:mouseevent):void bicycle.play(); // Register the function as a listener with the button. startbutton.addeventlistener(mouseevent.click, playanimation); play() stop() nextframe() prevframe() enterframe play() nextframe() enterframe bicycle bicycle // This function is called when the enterframe event is triggered, meaning // it's called once per frame. function everyframe(event:event):void if (bicycle.currentframe == 1) bicycle.gotoandstop(bicycle.totalframes); else bicycle.prevframe(); bicycle.addeventlistener(event.enter_frame, everyframe); 1 prevframe() nextframe() ( 1 prevframe() ) if

340 gotoandplay() gotoandstop() ( ) ActionScript ( ) ActionScript ActionScript 3.0 FrameLabel ( ) name frame FrameLabel MovieClip FrameLabel currentlabels FrameLabel currentlabel robot currentlabel robot if (robot.currentlabel == "walking") // do something Flash SWF gotoandplay() gotoandstop() FLA Flash MovieClip scenes Scene SWF currentscene Scene Scene labels FrameLabel name numframes int ActionScript MovieClip Flash ActionScript ActionScript 3.0 API MovieClip MovieClip

341 ActionScript 3.0 ( ) addchild() addchildat() 231 ActionScript Flash ( ActionScript ) ActionScript SWF ActionScript ActionScript ActionScript 1 2 3 ActionScript ( Tree House TreeHouse ) ActionScript flash.display.movieclip Sprite ( MovieClip) 4 Flash ActionScript ( ) SWF MovieClip Flash package import flash.display.movieclip; public class ExampleMovieClip extends MovieClip public function ExampleMovieClip() ActionScript 50 ActionScript Circle Circle.as MovieClip getarea() getcircumference()

342 package import flash.display.movieclip; public class Circle extends MovieClip public function Circle() public function getarea():number // The formula is Pi times the radius squared. return Math.PI * Math.pow((width / 2), 2); public function getcircumference():number // The formula is Pi times the diameter. return Math.PI * width; ( Flash 1 ) var c:circle = new Circle(); addchild(c); trace(c.width); trace(c.height); trace(c.getarea()); trace(c.getcircumference()); ActionScript Circle ActionScript Circle Flash Circle 1

343 import flash.geom.colortransform; var totalcircles:uint = 10; var i:uint; for (i = 0; i < totalcircles; i++) // Create a new Circle instance. var c:circle = new Circle(); // Place the new Circle at an x coordinate that will space the circles // evenly across the Stage. c.x = (stage.stagewidth / totalcircles) * i; // Place the Circle instance at the vertical center of the Stage. c.y = stage.stageheight / 2; // Change the Circle instance to a random color c.transform.colortransform = getrandomcolor(); // Add the Circle instance to the current timeline. addchild(c); function getrandomcolor():colortransform // Generate random values for the red, green, and blue color channels. var red:number = (Math.random() * 512) - 255; var green:number = (Math.random() * 512) - 255; var blue:number = (Math.random() * 512) - 255; // Create and return a ColorTransform object with the random colors. return new ColorTransform(1, 1, 1, 1, red, green, blue, 0); transform (Circle MovieClip ) SWF ActionScript 3.0 SWF Loader SWF ActionScript 1 URL URLRequest 2 Loader 3 Loader load() URLRequest 4 ( Flash ) addchild() Loader var request:urlrequest = new URLRequest("http://www.[yourdomain].com/externalSwf.swf"); var loader:loader = new Loader() loader.load(request); addchild(loader); URL ( SWF URL) JPEG GIF PNG SWF ActionScript SWF Flash Player AIR SWF ActionScript SWF SWF SWF SWF SWF SWF SWF 548 ApplicationDomain 600 SWF

344 SWF Loader.content SWF ActionScript 3.0 Sprite SWF SWF ActionScript AVM2 (ActionScript Virtual Machine 2) ActionScript 3.0 SWF ActionScript 1.0 2.0 SWF AVM1 (ActionScript Virtual Machine 1) AVM1 SWF (Loader.content ) AVM1Movie AVM1Movie MovieClip AVM2 SWF AVM1Movie AVM2 SWF AVM1 SWF ActionScript 3.0 AVM1Movie RuntimeAssetsExplorer ActionScript Flash Player AIR SWF ActionScript SWF Flash SWF SWF SWF RuntimeAssetsExplorer RuntimeAsset SWF SWF Loader.load() SWF ActionScript MovieClip ActionScript Flash Player SWF 590 www.adobe.com/go/learn_programmingas3samples_flash_tw Samples/RuntimeAssetsExplorer RuntimeAssetsExplorer RuntimeAssetsExample.mxml Flash FLA Flex MXML RuntimeAssetsExample.fla RuntimeAssetsExample.as GeometricAssets.as Flash (FLA) RuntimeAsset GeometricAssets.fla GeometricAssets (FLA ) FLA ActionScript

345 com/example/programmingas3/runtimeassetexplorer/runtimelibrary.as com/example/programmingas3/runtimeassetexplorer/animatingbox.as com/example/programmingas3/runtimeassetexplorer/animatingstar.as Explorer SWF Explorer SWF Explorer SWF 87 RuntimeLibrary getassets() package com.example.programmingas3.runtimeassetexplorer public interface RuntimeLibrary function getassets():array; SWF RuntimeLibrary SWF SWF SWF SWF SWF RuntimeLibrary GeometricAssets RuntimeLibrary FLA RuntimeLibrary getassets() package import flash.display.sprite; import com.example.programmingas3.runtimeassetexplorer.runtimelibrary; public class GeometricAssets extends Sprite implements RuntimeLibrary public function GeometricAssets() public function getassets():array return [ "com.example.programmingas3.runtimeassetexplorer.animatingbox", "com.example.programmingas3.runtimeassetexplorer.animatingstar" ];

346 getassets() ( AnimationAssets) FLA MovieClip MovieClip AnimatingStar AnimatingBox package com.example.programmingas3.runtimeassetexplorer import flash.display.movieclip; public class AnimatingStar extends MovieClip public function AnimatingStar() FLA GeometricAssets MovieClip 360 animatingbox animatingstar ActionScript getassets() MovieClip flash.display.movieclip FLA SWF AVM2 SWF SWF AnimatingBox AnimatingStar SWF ASSETS_PATH FileReference SWF Flash Player runtimeassetsloadcomplete() private function runtimeassetsloadcomplete(event:event):void var rl:* = event.target.content; var assetlist:array = rl.getassets(); populatedropdown(assetlist); stage.framerate = 60; rl SWF SWF getassets() populatedropdown() ComboBox addasset() private function addasset():void var classname:string = assetnamecbo.selecteditem.data; var AssetClass:Class = getdefinitionbyname(classname) as Class; var mc:movieclip = new AssetClass();... ComboBox (assetnamecbo.selecteditem.data) getdefinitionbyname() ( flash.utils )