快速业务通道

关于制作Flash翻书效果的研究

作者 佚名技术 来源 服务器技术 浏览 发布时间 2012-07-10
x, _root.stage.d1._y);  

  endFill();

  // I don''t think I need explain this part. You can find them in the help or reference of Flash MX. I copied them from there. J(我认为不需要解释这部分。你能在Flash MX的帮助或者参考中找到它们。我是从那里拷贝过来的。)  

  // Pretty clear, right? (很清楚了吧?)

  }  

  setPage3();

  // We need move and rotate movie clip Page3 with your mouse move. That is why we need this function here.(我们需要在鼠标移动时移动和旋转movie clip Page3。这就是为什么在这里我们需要这个函数)

  _root.stage.page3.setMask(_root.stage.triangle);  

  }

  这是我们还需要知道的一个函数:setMask。  

  就个人而言,我认为这个setMask函数在使用时有些小bug。它不象其他函数那么好用。  

  我要提醒你的另一件事是,在同一级脚本里你只能用setMask一次,意思就是,如果你想同时setMask movie clip Page2,你需要创建新的 mask movie clip,并在不同级的脚本中setMask。  

  很难理解吗?好吧,在我的例子里,我把下一个setMask放在movie clip Page2里。  

  // Move and rotate movie clip Page3 (移动并旋转movie clip Page3)

  function setPage3(){  

  _root.stage.page3._x = _root.stage.d1._x;

  _root.stage.page3._y = _root.stage.d1._y;  

  angle = _root.getAngle(_root.stage.stage.d1._x, _root.stage.stage.d1._y, _root.stage.stage.d4._x, _root.stage.stage.d4._y);

  _root.stage.page3._rotation = angle + 90;

  //Why add 90 degree here? I don''t know. I just found that the numbers worked perfectly only by adding that in there. (为什么这里加了90度?我不知道。我只是发现加了这个之后数字才能很好地工作)  

  _root.stage.page3._alpha = 100;

  // Remember we initialize movie clip Page3''s alpha as 0? Now we need switch it back. Because movie clip Page2 is on the under level of Page3. (记得我们把movie clip Page3的透明度设置为0了吗?现在我们需要把它变回去。因为movie clip Page2在Page3的下一层。)

  }  

  在这一课程中多加一条编码。  

  在movie clip “Stage”中:  

  onClipEvent (enterFrame) {

  _root.startSlip();

  }

  这一段代码使Flash一直检查鼠标的位置。

  第六部分:

  ——在Page2中绘制mask shape  

  在movie clip Page2里创建一个新的名为Page2_content的movie clip。  

  随便你取什么名都可以。  

  把下面的代码加到新的movie clip Page2_content中。  

  基本上,就象我们在上一个课程中讨论的那样,在同一级的script中,你只能使用setMask一次。这就是为什么在movie clip Page2里还需要再用一次的原因。
  

  这些代码是为了显示底部的movie clip Page4。  

  // Inside movie clip Page2_content. (在movie clip Page2_content内部)

  onClipEvent (enterFrame) {  

  _parent.createEmptyMovieClip ("triangle2", 1);

  _root.stage.page2.page2_content.setMask (_parent.triangle2);  

  with (_parent.triangle2) {  

  colors = [ 0xEFEFEF, 0xFFFFFF ];

  alphas = [ 0, 0 ];

  ratios = [ 0, 0xFF ];

  matrix = { a:200, b:0, c:0, d:0, e:200, f:0, g:200, h:200, i:1 };

  beginGradientFill( "linear", colors, alphas, ratios, matrix );  

  moveTo (_root.pdx , _root.pdy - _root.stageH/2);

  l

凌众科技专业提供服务器租用、服务器托管、企业邮局、虚拟主机等服务,公司网站:http://www.lingzhong.cn 为了给广大客户了解更多的技术信息,本技术文章收集来源于网络,凌众科技尊重文章作者的版权,如果有涉及你的版权有必要删除你的文章,请和我们联系。以上信息与文章正文是不可分割的一部分,如果您要转载本文章,请保留以上信息,谢谢!

分享到: 更多

Copyright ©1999-2011 厦门凌众科技有限公司 厦门优通互联科技开发有限公司 All rights reserved

地址(ADD):厦门软件园二期望海路63号701E(东南融通旁) 邮编(ZIP):361008

电话:0592-5908028 传真:0592-5908039 咨询信箱:web@lingzhong.cn 咨询OICQ:173723134

《中华人民共和国增值电信业务经营许可证》闽B2-20100024  ICP备案:闽ICP备05037997号