Class4 ActionScript ¦‚µ

  • View
    37

  • Download
    4

Embed Size (px)

DESCRIPTION

Class4 ActionScript 概念. 控制影格及場景播放視訊影片 元件的拖曳動作 載入外部的文字檔 文字區域的捲軸全螢幕播放. 動畫練習. 實作演練: ch00-1.fla 、參考 ch00-1-OK.swf 設定文件為: 777x120 px ,且影格速度為: 20 fps - PowerPoint PPT Presentation

Text of Class4 ActionScript ¦‚µ

  • Class4ActionScript

  • ch00-1.flach00-1-OK.swf777x120 px20 fps 2150 150l001505010015050110021503

  • ch00-2.flach00-2-OK.swfgotoAndStop

  • ActionScriptActionScriptFlash ActionScipt(Frame Actions)ActionScriptActionScript(Object Actions)ActionScriptActionScript

  • stop()play()gotoAndPlay()gotoAndStop()prevScene() 1nextScene() 1 ch01-1.fla

  • ch01-2.flach01-2-OK.swf//tellTarget on (press) {tellTarget (this.movie) {gotoAndPlay(2);}}

  • onClipEvent()load UnloadenterFramemouseMovekeyDownstartDrag() startDrag()stopDrag()startDrag()

  • ex01.flacoffeecoffeeMousehidestartDrag("coffee", true);Mouse.hide();

  • ch01-3.flach01-3-OK.swf

    ch01-4.flaon (press) {startDrag(bt, true);}on (release) {stopDrag();}

  • Flash()()()//setProperty()/getProperty()ch02-1.fla

    on (release) { setProperty("biplane", _x, x1); setProperty("biplane", _y, y1); setProperty("biplane", _alpha, a1); setProperty("biplane", _rotation, t1);}on (release) { x2 = getProperty(biplane,_x); y2 = getProperty(biplane,_y); a2 = getProperty(biplane,_alpha); t2 = getProperty(biplane,_rotation);}

  • ex02.flaon (release) {setProperty("monster", _x, monster._x+10);}on (release) {setProperty("monster", _xscale, monster._xscale+10);setProperty("monster", _yscale, monster._yscale+10);}on (release) {setProperty("monster", _rotation, monster._rotation+90);}

  • swf swfloadMovie()flashunloadMoviech04-1.fla/loadMovie() ch04-2.flaloadMovie() on (release) {_root.createEmptyMovieClip("where", 1);where.loadMovie("load_test1.swf");where._x = 200;where._y = 100;}on (release) {unloadMovie("where");}

  • LoadMovieloadMovie("url",level/target[, variables]) ex00.flam190, 135maction2~5loadMovie("ex_1.swf", "m");stop();nextFrameprevFrame

  • ActionScript

    .txt

  • ch05-1.flaloadVariablesNum() infoActionsmyAry = new Array(3);myAry[0] = "9/3";myAry[1] = "50~60";myAry[2]="";i=0;//info = myAry[i];

  • on (release) {if (i2) {i = i+1;}info = myAry[i];}on (release) {if (i0) {i = i-1;}info = myAry[i];}

  • loadVariablesNum score.txt

  • S_NameS_Math S_Chn S_Eng ActionsloadVariablesNum("score.txt", 0);count=1;stop();

  • on (press) { S_Name= eval("S_Name" + 1); S_Math = eval("S_Math" + 1); S_Chn = eval("S_Chn" + 1); S_Eng = eval("S_Eng" + 1);}on (press) { S_Name= eval("S_Name" + total); S_Math = eval("S_Math" + total); S_Chn = eval("S_Chn" + total); S_Eng = eval("S_Eng" + total);}on (press) { count-=1; if(counttotal) count=total; S_Name= eval("S_Name" + count); S_Math = eval("S_Math" + count); S_Chn = eval("S_Chn" + count); S_Eng = eval("S_Eng" + count);}

  • ch05-2.flareadmeloadVariablesNum("music.txt", 0);stop();on (press) {_root.readme.scroll = _root.readme.scroll+1;}

  • ch05-3.flaScrollBar

    ScrollBar

  • fscommand() fscommand("command", "parameters")command Flash Player Parameters Flash Player

  • ch06-1.flafscommand("fullscreen", true); fscommand("fullscreen", false); fscommand("allowscale", flase); fscommand("allowscale", true); fscommand("quit"); ESCfscommand("trapallkeys", "true");