收藏本站腾讯微博新浪微博

经典论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

蓝色理想 最新研发动态 网站开通淘帖功能 - 蓝色理想插件 论坛内容导读一页看论坛 - 给官方提建议

论坛活动及任务 地图和邮件任务 请多用悬赏提问 热夏来袭,选一款蓝色理想的个性T恤吧!

手机上论坛,使用APP获得更好体验 急需前端攻城狮,获得内部推荐机会 论坛开通淘帖功能,收藏终于可以分类了!

搜索
查看: 4801|回复: 2

[FLASH IDE] 求帮忙flash翻页效果代码问题解决

[复制链接]
发表于 2014-5-23 10:22:01 | 显示全部楼层 |阅读模式
本帖最后由 qingheshangyu 于 2014-5-23 10:25 编辑

我将flash翻页效果的源文件由原先的208页改成现在的20页但是20页之后还是翻空白页。而且出现错误:由于指定的对象不存在,'with' 动作失败。怎么解决呢,在线等待解决。。。
function hero() {
PW = 512;
PH = 700;
PC = 16777215;/*0xffffff*/
MP = 20;// 页数
AS = 0.08;
SN = 0.002;
DR = 0.4;
DA = 20;
SY = _y;
PWH = PW+PH;
PY = PH/2+PW;
DD = 1;
VR = -1;
ENP = 2.5;
CP = 0.5;
DRG = false;//以上全部是设置变量。将按钮加载到书页的4个角
attachMovie("CB","BRB",110);//创建库中影片剪辑的实例
attachMovie("CB","TRB",111);
attachMovie("CB","BLB",120);
attachMovie("CB","TLB",121);
BLB._xscale = TLB._xscale=-100;//mc宽度的百分比
TLB._yscale = TRB._yscale=-100;//以上是设置相应影片的x与y方向上的缩放 ,mc高度的百分比
BRB._x = TRB._x=PW;
BLB._x = TLB._x=-PW;//以上是设置相应影片x轴上的坐标
BLB._visible = TLB._visible=false;//设置可见性
PI(ENP,DD,VR); //执行名叫PI的函数,参数这里面的三个.
}// End of the function
function MM() {          //创建空的影片剪辑来加载书页
this.createEmptyMovieClip("FBPM",70);//在运行时创建一个空的mc,这常常用于AS绘图(“名称”,深度)
with (FBPM) {
  beginFill(21760,100);//标识纯色填充的开始.
  lineto(PWH,-VR*PWH);//从当前绘画位置绘制一条线
  curveto(0,-VR*2*PWH,-PWH,-VR*PWH);
  lineTo(0,0);//从当前绘画位置绘制一条曲线
  endFill();//标识填充结束
}// End of with
FBPM.duplicateMovieClip("FTPM",80);//复制此影片剪辑,(”新名称“,深度)
this.createEmptyMovieClip("FSM",90);//创建空的影片剪辑实例
DP(FSM,-DD,VR);
FSM._rotation = VR*DD*90;//旋转
this.createEmptyMovieClip("SSM",100);
DP(SSM,DD,VR);
FBP.setMask(FBPM);//设置此影片剪辑的可改编的遮色片
FTP.setMask(FTPM);
FS.setMask(FSM);
SS.setMask(SSM);
}// End of the function
function L01(rrr) {     //定义变量获得函数返回值
var _loc1 = rrr;
return (_loc1>1 ? (1) : (_loc1<0 ? (0) : (_loc1)));
}// End of the function
function MSE(t, xq, yq) {//定义变量来画圆来实现书页的弯曲效果
with (t) {
  var c = [0, 0, 0, 0, 0, 0, 0];
  var a = [30, 25, 15, 5, 0, 1, 6];
  var ra = [0, 1, 17, 51, 89, 132, 255];
  var m = {matrixType:"box", x:0, y:-yq*PW, w:xq*PW, h:-yq*PH, r:0};
  beginGradientFill("linear",c,a,ra,m);
  moveTo(0,-PW*yq);
  lineTo(0,-PWH*yq);
  lineTo(xq*PW,-PWH*yq);
  lineTo(xq*PW,-PW*yq);
  lineTo(0,-PW*yq);
  endFill();//标识填充结束.
}// End of with
}// End of the function
function GGR() {//定义变量画圆,实现书页的角跟随鼠标移动达到弯曲的效果
if (DRG) {
  MRO = -DD*(_xmouse-startX-DD*DA)/(2*PW);
} else {
  MRO>6.666667E-001 ? (MRO=MRO+AS) : (MRO=MRO-AS);
}// end else if
return (L01(MRO));
}// End of the function
function SAFP(ENP, DD) {
PI(ENP,DD,VR);
startX = DD*PW;
BRB._visible = BLB._visible=TRB._visible=TLB._visible=0;//是否可见
PRO = 0;
FFF(ODR);
onEnterFrame = function () {//进入帧时使用
  FA(L01(PRO=PRO+AS));
};
CP = ENP;
}// End of the function
function SB() {
var _loc2 = -VR*(PW+PH/2);
var _loc1 = PH/2;
BRB._y = BLB._y=_loc2+_loc1;
TRB._y = TLB._y=_loc2-_loc1;
}// End of the function
function FA(goalR) {
step = (goalR-ODR)*DR;
ODR = ODR+step;
FFF(ODR);
if (ODR>1-SN) {
  FFF(1);
  FD();
  if (AFG) {
   if (CP != EAFP) {
    SAFP(CP+DAF*2,DAF);
   } else {
    AFG = false;
   }// end if
  }
  // end if
}
// end else if
}// End of the function
function turnTo(ENP) {
var _loc2 = ENP;
if (_loc2 != CP) {
  if (!onEnterFrame) {
   var _loc1 = _loc2>CP ? (1) : (-1);
   SAFP(_loc2,_loc1);
  }
  // end if
}
// end if
}// End of the function
function flipTo(targPage) {
var _loc1 = targPage;
if (_loc1>CP) {
  DAF = 1;
} else if (_loc1<CP) {
  DAF = -1;
} else {
  return;
}// end else if
AFG = true;
EAFP = _loc1;
SAFP(CP+DAF*2,DAF);
return;
}// End of the function
function DP(t, xq, yq) {
with (t) {
  beginFill(PC,100);
  moveto(0,-yq*PW);
  lineto(0,-yq*PWH);
  lineTo(xq*PW,-yq*PWH);
  lineTo(xq*PW,-yq*PW);
  endFill();
}// End of with
}// End of the function
function FFF(CV) {    //顺时针旋转
var _loc1 = VR*DD*45*CV;
FBPM._rotation = FTPM._rotation=-_loc1;
FBP._rotation = FSM._rotation=VR*(DD*90)-_loc1*2;
FS._rotation = SS._rotation=VR*(DD*45)-_loc1;
}// End of the function
function FD() {     //翻页完成后设置其透明度
onEnterFrame = null;
ODR = 0;
BRB._alpha = BLB._alpha=TRB._alpha=TLB._alpha=100;//透明度(百分比)
if (CP != 5.000000E-001) {
  BLB._visible = TLB._visible=true;
} else {
  BLB._visible = TLB._visible=false;
}// end else if
if (CP != MP+5.000000E-001) {
  BRB._visible = TRB._visible=true;
} else {
  BRB._visible = TRB._visible=false;
}// end else if
if (PRO == 0) {    //删除掉所加载的影片剪辑
  FS.removeMovieClip();//删除由duplicateMoveclip创建的影片剪辑
  FSM.removeMovieClip();
  SS.removeMovieClip();
  SSM.removeMovieClip();
  FBP.removeMovieClip();
  FBPM.removeMovieClip();
  if (DD == 1) {
   SRP.removeMovieClip();//对于用attachMovie加载的,用duplicateMovieClip复制的和用creatEmptyMovieClip创建的mc可以用这种方法移除
  } else {
   SLP.removeMovieClip();
  }// end else if
} else {
  FTP.removeMovieClip();
  if (DD == -1) {
   SRP.removeMovieClip();
  } else {
   SLP.removeMovieClip();
  }// end else if
}// end else if
FTPM.removeMovieClip();
}// End of the function
function SSW() {  //创建新的影片剪辑加载其他书页
this.createEmptyMovieClip("FS",50);
MSW(FS,-DD,VR);
FS._rotation = VR*DD*45;
this.createEmptyMovieClip("SS",60);
MSW(SS,DD,VR);
SS._rotation = VR*DD*45;
}// End of the function
function LB() {
if (CP == 5.000000E-001) {
  SLP._visible = 0;
  FTP.Shade._alpha = 67;
} else if (CP == MP+5.000000E-001) {
  SRP._visible = 0;
  FTP.Shade._alpha = 67;
}
// end else if
if (ENP == 5.000000E-001) {
  FS._alpha = 67;
  SS._visible = 0;
} else if (ENP == MP+5.000000E-001) {
  FS._alpha = 67;
  SS._visible = 0;
}
// end else if
}// End of the function
function SFG() {
this.createEmptyMovieClip("FTP",30);
DP(FTP,DD,VR);
var PN = DD == 1 ? (CP+5.000000E-001) : (CP-5.000000E-001);
with (FTP) {
  attachMovie("print"+PN,"Print",10);
  with (Print) {
   _x = DD*PW/2;
   _y = -VR*PY;
  }// End of with
}// End of with
FTP.createEmptyMovieClip("Shade",20);
MSE(FTP.Shade,DD,VR);
this.createEmptyMovieClip("FBP",40);
DP(FBP,-DD,VR);
var PN = DD == 1 ? (ENP-5.000000E-001) : (ENP+5.000000E-001);
FBP.attachMovie("print"+PN,"Print",10);
with (FBP.Print) {
  _x = -DD*PW/2;
  _y = -VR*PY;
}// End of with
FBP._rotation = DD*VR*90;
}// End of the function
function MSW(t, xq) {
with (t) {
  var c;
  var a;
  var ra;
  var mxl;
  var m;
  c = [0, 0, 0, 0, 0, 0, 0];
  a = [30, 25, 15, 5, 0, 1, 6];
  ra = [0, 1, 17, 51, 89, 132, 255];
  mxl = Math.sqrt(PW*PW+PWH*PWH);
  m = {matrixType:"box", x:0, y:-VR*mxl, w:xq*PW, h:VR*(mxl-PW), r:0};
  beginGradientFill("linear",c,a,ra,m);//梯度
  moveto(0,-VR*PW);//将当前绘画位置移动到 (x, y)
  lineto(0,-VR*mxl);
  lineto(xq*PW,-VR*mxl);
  lineTo(xq*PW,-VR*PW);
  endFill();
}// End of with
}// End of the function
function SMF(DD, VR) {
var _loc1 = DD;
PI(CP+_loc1*2,_loc1,VR);
startX = _loc1*PW;
DRG = true;
BRB._alpha = BLB._alpha=TLB._alpha=TRB._alpha=0;
ODR = 0;
onEnterFrame = function () {//循环执行
  var _loc1 = GGR();
  step = (_loc1-ODR)*DR;
  ODR = ODR+step;
  FFF(ODR);
  if (!DRG) {
   if (ODR<SN) {
    FFF(0);
    PRO = 0;
    FD();
    return;
   }
   // end if
   if (ODR>1-SN) {
    FFF(1);
    PRO = 1;
    FD();
   }
   // end if
  }
  // end if
};
}// End of the function
function PI(ep, d, v) {
ENP = ep;
DD = d;
VR = v;
setProperty("", _y, SY+v*(PY*_yscale/100));// 1、功能:
    //当影片播放时,更改影片剪辑的属性。
   // 2、格式:
   // setProperty(target,property,value/expression)
   // 参数解释:
   // target要设置其属性的影片剪辑实例名称的路径。
   // property要设置的属性。
   // value属性的新文本值。
   // expression计算结果为属性新值的公式。

SST();
SFG();
SSW();
MM();
LB();
SB();
}// End of the function
function SST() {
this.createEmptyMovieClip("SLP",10);
if (ENP != 5.000000E-001) {
  DP(SLP,-1,VR);
  var PN = DD == 1 ? (CP-5.000000E-001) : (ENP-5.000000E-001);
  var _loc2 = SLP.attachMovie("print"+PN, "Print", 1);
  _loc2._x = -PW/2;
  _loc2._y = -VR*PY;
}
// end if
this.createEmptyMovieClip("SRP",20);
if (ENP != MP+5.000000E-001) {
  DP(SRP,1,VR);
  var PN = DD == 1 ? (ENP+5.000000E-001) : (CP+5.000000E-001);
  var _loc3 = SRP.attachMovie("print"+PN, "Print", 1);
  _loc3._x = PW/2;
  _loc3._y = -VR*PY;
}
// end if
var _loc1 = DD>0 ? (SLP) : (SRP);
_loc1.createEmptyMovieClip("Shade",2);
MSE(_loc1.Shade,-DD,VR);
}// End of the function
function DRRS() {
if (MRO>6.666667E-001) {
  CP = CP+2*DD;
}
// end if
PD = DRG=false;
BRB._visible = BLB._visible=TLB._visible=TRB._visible=false;
}// End of the function
function PSRS(side) {
if (PD) {
  PD = false;
} else {
  flipTo(CP+side*2);
}// end else if
}// End of the function
stop();
hero();
_root.onEnterFrame = function(){
Mouse.hide();
};
BLB.onRollOver = function() {
SMF(-1,1);
};
TLB.onRollOver = function() {
SMF(-1,-1);
};
BRB.onRollOver = function() {
SMF(1,1);
};
TRB.onRollOver = function() {
SMF(1,-1);
};
BLB.onRollOut = BRB.onRollOut=TRB.onRollOut=TLB.onRollOut=function () {
DRG = false;
};
BLB.onRelease = TLB.onRelease=function () {
PSRS(-1);
};
BRB.onRelease = TRB.onRelease=function () {
PSRS(1);
};
BLB.onDragOut = TLB.onDragOut=function () {
PD = true;
BRB._visible = TRB._visible=false;
};

BRB.onDragOut = TRB.onDragOut=function () {
PD = true;
BLB._visible = TLB._visible=false;
};
BLB.onReleaseOutside = BRB.onReleaseOutside=TLB.onReleaseOutside=TRB.onReleaseOutside=function () {
DRRS();
};
发表于 2014-5-30 20:53:10 | 显示全部楼层
把破解的改成原创的就行了。
回复 支持 1 反对 0

使用道具 举报

发表于 2017-5-8 13:29:47 | 显示全部楼层
您好,我现在在做电子杂志的毕业设计,在翻页效果的制作上遇到了问题,想请教一下怎么通过AS2.0代码实现翻页效果的制作呀
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|小黑屋|Archiver|手机版|blueidea.com ( 湘ICP备12001430号 )  

GMT+8, 2020-9-29 20:05 , Processed in 0.095461 second(s), 8 queries , Gzip On, Memcache On.

Powered by Discuz! X3.2 Licensed

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表