flash.docx

上传人:b****5 文档编号:8195696 上传时间:2023-01-29 格式:DOCX 页数:17 大小:18.66KB
下载 相关 举报
flash.docx_第1页
第1页 / 共17页
flash.docx_第2页
第2页 / 共17页
flash.docx_第3页
第3页 / 共17页
flash.docx_第4页
第4页 / 共17页
flash.docx_第5页
第5页 / 共17页
点击查看更多>>
下载资源
资源描述

flash.docx

《flash.docx》由会员分享,可在线阅读,更多相关《flash.docx(17页珍藏版)》请在冰豆网上搜索。

flash.docx

flash

Varmusic:

Sound=newSound();//设置声音类

Music.attachSound(“mysound”);//加载库文件中的声音ID

Music.start(0,5);//设置声音播放

随机加载内部声音

_root.onMouseDown=function(){

varmysound:

Sound=newSound();

varrandomsound=random(3);

mysound.attachSound("Sound"+randomsound);

mysound.stop();

mysound.start(0,2);

}

加载外部声音

mymp3=newmp3;

mymp3.loadSound("",true);

mymp3.start();

设置声音的大小和声道

varmusic:

Sound=newSound();//设置声音类

music.attachSound("sound1");//加载库文件中的声音ID

music.start(0,5);//设置声音播放

music.setVolume();//设置声音的大小1~100之间

music.setPan(pan)//设置声道pan是一个整数,指定声音的左右均衡,有效值的范围为-100到100;

在影片剪辑上控制声音

onClipEvent(mousedown){

music=newSound(this);

music.attachSound("sound1");

music.setVolume(1000);

music.setPan(0);

music.start(0,20);

}

fscommand("fullscreen",true)flash一打开就是全屏

loadMove(”dd.swf”,”a”);

a._x=205;

a._y=250;

 

三维立体

functiondraw(){

clear();

lineStyle(1,0xff0000);

moveTo(A1.x,A1.y,A1.z);

lineTo(A2.x,A2.y,A2.z);

lineTo(A3.x,A3.y,A3.z);

lineTo(A4.x,A4.y,A4.z);

lineTo(A5.x,A5,y,A5.z);

lineTo(A8.x,A8.y,A8.z);

lineTo(A7.x,A7.y,A7.z);

lineTo(A6.x,A6.y,A6.z);

lineTo(A3.x,A3.y,A3.z);

moveTo(A1.x,A1.y,A1.z);

lineTo(A4.x,A4.y,A4.z);

moveTo(A1.x,A1.y,A1.z);

lineTo(A8.x,A8.y,A8.z);

moveTo(A7.x,A7.y,A7.z);

lineTo(A2.x,A2.y,A2.z);

moveTo(A5.x,A5.y,A5.z);

lineTo(A6.x,A6.y,A6.z)

}

functionmm(){

for(i=1;i<=9;i++){

this["A"+i].rotateXYZ(e,f,g);

this["A"+i].cast();

}

draw();

}

Vector=function(x,y,z){

this.x=x;

this.y=y;

this.z=z;

}

vector.prototype.rotateXYZ=function(a,b,c){

varsa=Math.sin(a*3.141593/180);

varca=Math.cos(a*3.141593/180);

varsb=Math.sin(b*3.141593/180);

varcb=Math.cos(b*3.141593/180);

varsc=Math.sin(c*3.141593/180);

varcc=Math.cos(c*3.141593/180);

with(this){

varry=y*ca-z*sa;

varrz=y*sa+z*ca;

varrx=rz*sb+x*cb;

z=rz*cb-x*sb;

x=rx*cc-ry*sc;

y=rx*sc+ry*cc;

}

}

Vector.prototype.getSee=function(ViewA4ist){

if(ViewA4ist==undefined)

{

var_12=300;

}

return(_12/(_12+this.z));

}

 

气泡

onClipEvent(load){

this._visible=false;

varnum=50;

for(i=1;i

_root.attachMovie("qu","qu"+i,i);

varscale=random(60)+41;

_root["qu"+i]._alpha=random(60)+40;

_root["qu"+i]._xscale=scale;

_root["qu"+i]._yscale=scale;

_root["qu"+i]._x=random(550);

_root["qu"+i]._y=random(400);

_root["qu"+i].v=random

(2)+2;

}

}

onClipEvent(enterFrame){

for(i=1;i

_root["qu"+i]._y-=_root["qu"+i].v;

if(_root["qu"+i]._x>550){

_root["qu"+i]._x=0;

}

if(_root["qu"+i]._x<0){

_root["qu"+i]._x=550;

}

if(_root["qu"+i]._y<0){

_root["qu"+i]._y=400;

}

}

}

幻想空间

_quality="LOW";

for(i=1;i<=8;i++){

_root.createEmptyMovieClip("point"+i,i+10);

_root["point"+i]._x=Stage.width/2;

_root["point"+i]._y=Stage.height/2;

_root["point"+i].xVel=Math.floor(Math.random()*10)-5;

_root["point"+i].yVel=Math.floor(Math.random()*10)-5;

_root["point"+i].onEnterFrame=function(){

this._x+=this.xVel;

this._y+=this.yVel;

this._x<0||this._x>Stage.width?

this.xVel*=-1:

this.xVel;

this._y<0||this._y>Stage.height?

this.yVel*=-1:

this.yVel;

}

}

values=newArray("0","2","4","6","8","A","C","D");

_root.hexColor="0x"+values[Math.floor(Math.random()*values.length)]

+values[Math.floor(Math.random()*values.length)]+values[Math.floor(Math.random()*values.length)]

+values[Math.floor(Math.random()*values.length)]+values[Math.floor(Math.random()*values.length)]

+values[Math.floor(Math.random()*values.length)];

i=1;

_root.onEnterFrame=function(){

name="dongua_shape_"+i;

_root.createEmptyMovieClip(name,i+20);

_root[name].beginFill(_root.hetColor,3);

_root[name].moveTo(_root.point1._x,_root.point1._y);

_root[name].curveTo(_root.point2._x,_root.point2._y,_root.point3._x,_root.point3._y);

_root[name].curveTo(_root.point4._x,_root.point4._y,_root.point5._x,_root.point5._y);

_root[name].curveTo(_root.point6._x,_root.point6._y,_root.point7._x,_root.point7._y);

_root[name].curveTo(_root.point8._x,_root.point8._y,_root.point1._x,_root.point1._y);

_root[name].endFill();

removeMovieClip(_root["dongua_shape_"+(i-50)]);

i++;

}

萤火虫

for(i=1;i<20;i++)

{

yh.duplicateMovieClip("yh"+i,i);

with(this["yh"+i])

{

_x=random(Stage.width);

_y=random(Stage.height);

}

}

 

鼠标滚轮控制图片

varmouseListener:

Object=newObject();

mouseListenr.onMouseWheel=function(delta){

clip_mc._y+=delta*10;

}

Mouse.addListener(mouseListener);

鼠标跟随

startDrag("影片剪辑名字",true);

曝光效果

MovieClip.Prototype.setBrightOffset=function(offset){

varThis=newColor(this);

vartrans=This.getTransform();

with(trans){

rb=gb=bb=offset;

}

This.setTransform(trans);

}

mc.onEnterFrame=function(){

if(_xmouse<=550/2){

this.gotoAndStop

(1);

this.setBrightOffset((_xmouse-550/4)*255/(550/4));

}

else{

this.gotoAndStop

(2);

this.setBrightOffset(-(_xmouse-550*3/4)*255/(550/4))

}

}

 

模糊效果

onClipEvent(load)

{

varmax=10;

varanglestep=360/max;

varrad=0.5;

for(i=0;i

_root.attachMovie("text","text"+i,10+i);

}

d=0;

dstep=0.150000;

a=45;

astep=1.300000;

}

onClipEvent(enterFrame){

for(i=0;i

_root["text"+i]._x=275+d*Math.cos(anglestep*i*rad);

_root["text"+i]._y=200+d*Math.sin(anglestep*i*rad);

_root["text"+i]._alpha=a;

}

a=a+astep;

d=d+astep;

if(a>50||a<-5)

{

astep=astep*-1;

dstep=dstep*-1;

}

}

漩涡

for(i=0;i<60;i++){

duplicateMovieClip("/mc","mc"+i,i);

setProperty("/mc"+i,_xscale,i*2);

setProperty("/mc"+i,_yscale,i*2);

setProperty("/mc"+i,_rotation,i*-10);

}

水晶效果

functionscaleMe()

{

this.angle=this.degrees*0.017453;

this.degrees=this.degrees+(this._parent._parent._xmouse-300)/30;

this.xpos=this._parent._parent.radius*Math.cos(this.angle);

this.xpos=this._parent._parent.radius*Math.sin(this.angle)+60;

this.depth=1/(1-this.xpos/this._parent._parent.perspective);

this._x=this.xpos*this.depth+this._parent._parent.centrepointx;

this._y=this._parent._parent.centrepointy;

this._xscale=this.zpos;

this._yscale=this.depth*93;

this._alpha=this.zpos+150;

this.swapDepths(this.depth*500);

}

fscommand("allowscale","false");

numbers_as_words=["1","2","3","4","5","6","7"];

perspective=500;

centrepointx=300;

centrepointy=100;

radius=180;

numSections=7;

spacing=360/numSections;

this.createEmptyMovieClip("c_mc",1);

for(s=1;s<=numSections;s++){

_root.c_mc.attachMovie(numbers_as_words[s-1],"section"+s,s);

_root.c_mc["section"+s].degrees=(s-1)*spacing;

_root.c_mc["section"+s].onEnterFrame=scaleMe;

}

c_mc.onEnterFrame=function(){

var_12=newflash.filters.BlurFilter();

_12.quality=3;

_12.blurx=Math.abs((this._parent._xmouse-300)/9);

_12.blury=0;

this.filters=[_12];

}

stop();

动态打字效果

functiontypetext(str:

String,speed:

Number){

vari=0;

varttext=newObject();

varIS_type_txt:

Boolean=true;

ttext.interval=function(){

vartype_txt_move=newString(str);

textcontent.htmlText=type_txt_move.substring(0,i+1);

if(IS_type_txt){

i++;

}else{

clearInterval(ttext_ID);

}

if(i>=type_txt_move.length){

IS_type_txt=false;

}elseif(i<=0){

IS_type_txt=true;

}

}

varttext_ID=setInterval(ttext,"interval",speed);

}

typetext("【一剪梅】
李清照
红藕香残玉簟秋。


轻解罗裳,
独上兰舟。


云中谁寄锦书来?


雁字回时,
月满西楼。



花自飘零水自流。


一种相思,
两处闲愁。


此情无计可消除,
才下眉头,
却上心头。

",150);

图片查看_root.createEmptyMovieClip("slide",1);

_root.next.onRelease=function(){

a=1;

i++;

num++;

if(num>=12){

num=1;

}

_root.slide.createEmptyMovieClip(["CM"+i],i);

_root.slide.loadMovie("image/0"+num+".jpg","CM"+i);

_root.slide._alpha=0;

_root.slide._x=-300;

_root.slide._y=36;

_root.name="image/photo0"+num+".jpg";

_root.onEnterFrame=function(){

a++;

_root.slide.setMask(mask);

_root.slide._alpha+=5;

_root.slide._x+=(50-_root.slide._x)/5;

_root.slide["CM"+(i-1)]._x=a*3;

_root.slide["CM"+(i-2)].removeMovieClip();

}

}

_root.back.onRelease=function(){

a=1;

i++;

num--;

if(num<=0){

num=12;

}

_root.slide.createEmptyMovieClip("CM"+i,i);

_root.slide.loadMovie("image/0"+num+".jpg");

_root.slide._alpha=0;

_root.slide._x=300;

_root.slide._y=36;

_root.name="image/photo0"+num+".jpg";

_root.onEnterFrame=function(){

a++;

_root.slide.setMask(mask);

_root.slide._alpha+=3;

_root.slide._x+=(50-_root.slide._x)/5;

_root.slide["CM"+(i-1)]._x-=a*3;

_root.slide["CM"+(i-2)].removeMovieClip();

}

}

图片轮换

functionrun(){

if(myMovieClip0._currentframe>4){

myMovieClip0.gotoAndStop

(1);

}

myBitmapData.noise(Math.floor(1000*Math.random()),0,255,15,false);

myMovieClip2._alpha=myMovieClip2._alpha-2;

if(myMovieClip2._alpha<=1){

k++;

myMovieClip2._alpha=100;

myMovieClip0.nextFrame();

var_12=1;

while(_12<=4){

if(_12==k){

this["m"+_12].mm.gotoAndStop

(2);

}

_12++;

}

if(k>4){

k=1;

m1.mm.gotoAndStop

(2);

myMovieClip0.gotoAndStop

(1);

}

}

}

varmyBitmapData=newflash.display.BitmapData(400,300);

this.createEmptyMovieClip("myMovieClip2",1);

myMovieClip2._x=myMovieClip0._x;

myMovieClip2._y=myMovieClip0._y;

myMovieClip2.attachBitmap(myBitmapData,1);

_global.k=1;

vari=1;

while(i<=4){

this["m"+i].gotoAndStop(i);

this["m"+i].mm.gotoAndStop

(1);

i++;

}

myMovieClip0.gotoAndStop

(1);

m1.mm.gotoAndStop

(2);

_root.onEnterFrame=run;

vari=1;

while(i<=4){

this["m"+i].no=i;

this["m"+i].onPress=function(){

delete_root["onEnterFrame"];

_root.onEnterFrame=run;

var_13=1;

while(_13<=4){

if(_13==this.no){

k=_13;

_root.myMovieClip0.gotoAndStop(_13);

_root["m"+_13].mm.gotoAndStop

(2);

}

else{

_root["m"+_13].mm.gotoAndStop

(1);

}

_13++;

}

}

i++;

}

注释

stop();

varsz=127;

varsd=3;

vartemp=1;

tempT=temp;

mcX=mc_x;

xfmc._visible=false;

functionxfmchs(){

xfmc._visible=true;

xfmc.onEnterFrame=function(){

xfmc._x=xf

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 职业教育 > 中职中专

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1