查看完整版本: 1.0转2.0 程序

cool-cool 2008-6-24 22:21

1.0转2.0 程序

不是破戒  是开放的  版本太老 帮忙改成新的 2.0

System.useCodePage = true;
Stage.scaleMode = "noScale";
imageURL = new Array();
thumbURL = new Array();
des = new Array();
myXML = new XML();
myXML.ignoreWhite = true;
myXML.onLoad = function(temp) {
_global.numOfPhoto = this.childNodes.length;
for (i=1; i<=numOfPhoto; i++) {
  imageURL[i] = this.childNodes[i-1].childNodes[0].childNodes[0];
  thumbURL[i] = this.childNodes[i-1].childNodes[1].childNodes[0];
  des[i] = this.childNodes[i-1].childNodes[2].childNodes[0];
}
gotoAndStop(2);
};
stop();
//
//
myXML.load("end.xml");
// 酒贰客 鞍捞 end.xml 颇老俊 例措 版肺甫 器窃矫难 林技夸.



centerX = 400;
centerY = 300;
// 捞固瘤狼 吝缴 困摹
numOfOneStep = 8;
// 茄锅狼 焊咯瘤绰 捞固瘤 滚瓢狼 俺荐
speed = 40;
// 捞固瘤 祸惑狼 加档甫 力绢窍绰 惑荐, 蔼捞 农搁 捞固瘤 祸惑 函版 加档啊 蠢妨笼聪促.
screen.swapDepths(1000);
//
currentNumOfOneStep = numOfOneStep;
// + 滚瓢阑 喘啡阑 锭 焊咯瘤绰 泅犁 滚瓢狼 俺荐
numOfStep = Math.ceil(numOfPhoto/currentNumOfOneStep);
// 滚瓢 技飘狼 俺荐(捞固瘤 俺荐啊 17俺牢 版快 醚 3 set栏肺 唱床笼聪促.)
step = 1;
btnView();
//
//
//
//
//
//
//
//
//
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//  级匙烙 捞固瘤 滚瓢狼 捞悼阑 困茄 next,prev 滚瓢阑 力绢窍绰 内靛涝聪促 .
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
next.onRelease = function() {
if (step != numOfStep) {
  step++;
  if (step == numOfStep) {
   currentNumOfOneStep = numOfPhoto-numOfOneStep*(numOfStep-1);
  } else {
   currentNumOfOneStep = numOfOneStep;
  }
  btnView();
}
};
next.onRollOver = function() {
this.gotoAndPlay(2);
};
next.onRollOut = function() {
this.gotoAndPlay(11);
};
//
prev.onRelease = function() {
if (step != 1) {
  step--;
  if (step == numOfStep) {
   currentNumOfOneStep = numOfPhoto-numOfOneStep*(numOfStep-1);
  } else {
   currentNumOfOneStep = numOfOneStep;
  }
  btnView();
}
};
prev.onRollOver = function() {
this.gotoAndPlay(2);
};
prev.onRollOut = function() {
this.gotoAndPlay(11);
};
//
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//  级匙烙 捞固瘤 滚瓢狼 积己苞 滚瓢阑 力绢窍绰 窃荐甫 器窃钦聪促.
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
function btnView() {
for (temp in this) {
  if (temp) {
   this[temp].removeMovieClip();
  }
}
for (i=1; i<=currentNumOfOneStep; i++) {
  mc = this.attachMovie("btn", ((step-1)*numOfOneStep)+i, i);
  mc._x = (i-1)*50+220;
  mc._y = 630;
  // 滚瓢狼 啊肺 困摹
  // 滚瓢狼 技肺 困摹
  mc.btn_inner.image.imageSS.loadMovie(thumbURL[((step-1)*numOfOneStep)+i]);
  mc.btn_inner.defaultX = mc.btn_inner._x;
  mc.btn_inner.defaultY = mc.btn_inner._y;
  mc.onRollOver = function() {
   this.btn_inner.onEnterFrame = function() {
    this._x += (this.defaultX-2-this._x)/4;
    this._y += (this.defaultY-2-this._y)/4;
    // 捞悼气阑 农霸 窍绊 酵篮 锭绰 2甫 10栏肺 函版窍搁 邓聪促.
    // 滚瓢狼 捞悼 规氢阑 馆措肺 且锭绰 2狼 何龋甫 -俊辑 +肺 荐沥窍技夸
   };
  };
  mc.onRollOut = mc.onDragOut=function () {
   this.btn_inner.onEnterFrame = function() {
    this._x += (this.defaultX-this._x)/2;
    this._y += (this.defaultY-this._y)/2;
   };
  };
  mc.onRelease = function() {
   screen.loadMovie(imageURL[this._name]);
   this.onEnterFrame = function() {
    temp1 = screen.getBytesLoaded();
    temp2 = screen.getBytesTotal();
    if (temp1 == temp2 && temp1>100) {
     description = des[this._name];
     screen._x = centerX-screen._width/2;
     screen._y = centerY-screen._height/2;
     screen._visible = 0;
     myColor = new Color(screen);
     myColorTransform = new Object();
     screen.ra = 100;
     screen.ga = 100;
     screen.ba = 100;
     screen.aa = 100;
     screen.rb = 255;
     screen.gb = 255;
     screen.bb = 255;
     screen.ab = 0;
     kkk = 1;
     screen.onEnterFrame = function() {
      screenBg._width += (screen._width+40-screenBg._width)/4;
      screenBg._height += (screen._height+40-screenBg._height)/4;
      if (kkk<10) {
       kkk++;
      } else {
       myColorTransform = {ra:this.ra, rb:this.rb, ga:this.ga, gb:this.gb, ba:this.ba, bb:this.bb, aa:this.aa, ab:this.ab};
       myColor.setTransform(myColorTransform);
       this.ra += (100-this.ra)/speed;
       this.ga += (100-this.ga)/speed;
       this.ba += (100-this.ba)/speed;
       this.aa += (100-this.aa)/speed;
       this.rb += (0-this.rb)/speed;
       this.gb += (0-this.gb)/speed;
       this.bb += (0-this.bb)/speed;
       this.ab += (0-this.ab)/speed;
       screen._visible = 1;
      }
     };
     delete this.onEnterFrame;
    }
   };
  };
}
}
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
// 敲贰矫 公厚啊 矫累且锭 霉锅掳 捞固瘤啊 唱鸥唱档废 窍绰 内靛涝聪促.
//
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
screen.loadMovie(imageURL[1]);
this.onEnterFrame = function() {
temp1 = screen.getBytesLoaded();
temp2 = screen.getBytesTotal();
if (temp1 == temp2 && temp1>100) {
  description = des[1];
  screen._x = centerX-screen._width/2;
  screen._y = centerY-screen._height/2;
  screen._visible = 0;
  myColor = new Color(screen);
  myColorTransform = new Object();
  screen.ra = 100;
  screen.ga = 100;
  screen.ba = 100;
  screen.aa = 100;
  screen.rb = 255;
  screen.gb = 255;
  screen.bb = 255;
  screen.ab = 0;
  kkk = 1;
  screen.onEnterFrame = function() {
   screenBg._width += (screen._width+40-screenBg._width)/4;
   screenBg._height += (screen._height+40-screenBg._height)/4;
   if (kkk<10) {
    kkk++;
   } else {
    myColorTransform = {ra:this.ra, rb:this.rb, ga:this.ga, gb:this.gb, ba:this.ba, bb:this.bb, aa:this.aa, ab:this.ab};
    myColor.setTransform(myColorTransform);
    this.ra += (100-this.ra)/speed;
    this.ga += (100-this.ga)/speed;
    this.ba += (100-this.ba)/speed;
    this.aa += (100-this.aa)/speed;
    this.rb += (0-this.rb)/speed;
    this.gb += (0-this.gb)/speed;
    this.bb += (0-this.bb)/speed;
    this.ab += (0-this.ab)/speed;
    screen._visible = 1;
   }
  };
  delete this.onEnterFrame;
}
};
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

wyang 2008-6-25 10:49

估计没人会去改,放段代码上来,连测试的fla都没有,还要去猜这段代码是用来做什么的

Cl@rke将军 2008-6-25 15:14

注释是台湾的big5码?

flash自己就有as1.0转2.0功能,
把脚本拷到flash里,“发布设置”中选“as2.0”
发布出swf后用精灵反导就是2.0格式了

wyang 2008-6-25 15:29

很多时候,as1写的程序,发布成as2的时候就不运行了,更不用说自动转成as2了

Cl@rke将军 2008-6-25 19:28

楼上别乱说,
随便你打多长as1脚本,
发布成as2,
500次能出1次问题算多的

cool-cool 2008-6-25 22:10

不知道 应该是韩国的吧

cool-cool 2008-6-25 22:13

3楼的兄弟 你的方法不行 , 转完XML加载那就 没了 是空的 但我知道了 XML加载那有问题 也的谢谢你

cool-cool 2008-6-26 00:05

语言我改成 2.0了 但6版本.2.0语言 转7-8版本就不行 不知道是不是语言的问题

wyang 2008-6-26 09:06

[quote]原帖由 [i]Cl@rke将军[/i] 于 2008-6-25 19:28 发表 [url=http://space.flash8.net/bbs/redirect.php?goto=findpost&pid=2190704&ptid=357007][img]http://space.flash8.net/bbs/images/common/back.gif[/img][/url]
楼上别乱说,
随便你打多长as1脚本,
发布成as2,
500次能出1次问题算多的 [/quote]

那是因为你写的程序从来都没有组件或者自己开发组件

Cl@rke将军 2008-6-26 19:00

楼上这句貌似很肯定啊
首先声明你是乱说第二次

然后,本人看不出楼主这个脚本和组件有什么关系

wyang 2008-6-27 14:52

好像我没说过是这段代码与组件有什么关系,我是说很多时候as1的东西会在as2里就运行不了,不过你说我乱说也没关系,反正我只是发表一个我个人的看法。
页: [1]
查看完整版本: 1.0转2.0 程序