Błąd kodu

Technologia Flash, czyli animacja na potrzeby stron WWW to świat daleko odbiegły od zwykłego programowania i kodu. Zapytaj o pomoc i podziel się z nami Twoimi problemami z zakresu Flasha.
webhagi
Nowy
Nowy
Posty: 22
Rejestracja: czw sty 17, 2008 10:44 pm

Błąd kodu

Post autor: webhagi »

Witam serdecznie
Mam problem z pewnym plikiem chodzi o pewną drobną zmianke w kodzie, nieumiem sobie z nia poradzić, chodzi o suwak zatrzymuje sie na stronie 22 a powinien na 23(może być inna numeracja gdyż to ustawione jest w kodzie; ale jaka sie weżmie suwak ten czarny i zjedzie na dół to niezjezdza na sam dół tylko kartke wcześniej). Ogólnie są 3 opcje do przegladania, buton nastepny i poprzedni, suwak i strzałki przy suwaku. wszytsko działa dobrze tylko suwak nie bo zatrzymuje sie strone wcześniej.
oto kody (niejestem pewny który to ten odpowiedni więc posyłam obydwa)
oto link do pracy http://www.tajmahal.ekspres.net.pl/kia/index.swf

Kod: Zaznacz cały

function listMake(count) {
this.scrollMc.scPreBt._visible = 0;
this.preBt._visible = 0;
this.listMc.setMask(this.mask);
space = 1;
pec = count;
num = count;
this.pageCount = 2;
var k = 1;
while (k<=count) {
this.listMc.attachMovie("q"+k, "question"+k, k);
mcName = this.listMc["question"+k];
pmcName = this.listMc["question"+(k-1)];
mcName._x = 2;
mcName.ex.mcName = mcName;
mcName.ex.pmcName = pmcName;
mcName.ex.onLoadMC = function() {
var _loc2 = this._parent._parent._parent;
--_loc2.num;
this.mcName._y = this.pmcName._height+this.pmcName._y+17;
if (_loc2.listMc._height>=_loc2.mask._height*_loc2.pa geCount-0) {
this.mcName._y = _loc2.mask._height*_loc2.pageCount;
++_loc2.pageCount;
}
// end if 
if (_loc2.num == 0) {
_loc2.listMc.attachMovie("submit", "submitMc", k+1);
_loc2.listMc.submitMc._y = this.mcName._y+this.mcName._height+60;
_loc2.listMc.submitMc._x = _loc2.mask._width-180;
_loc2.play();
}
// end if 
delete this.onLoadMC;
};
++k;
}
// end while
_root.loadingMc.barFc();
}
// End of the function
function scrollFc() {
var maxSBC_y;
var maxSC_y;
var maxMC_y;
var sc_y;
if (this._parent._parent.listMc._height>=this._parent ._parent.mask._height) {
maxSBC_y = this._parent._parent.scrollBar._y+this._parent._pa rent.scrollBar._height-this._height;
this._parent.startDrag(false, this._parent._x, this._parent._parent.scrollBar._y, this._parent._x, maxSBC_y);
this.onEnterFrame = function() {
maxSC_y = this._parent._parent.scrollBar._height-this._height;
maxMC_y = this._parent._parent.listMc._height-this._parent._parent.mask._height;
sc_y = this._parent._parent.scrollBar._y-this._parent._y;
if (this._parent == this._parent._parent.scrollBar._y) {
this._parent._parent.listMc._y = 1;
} else if (this._parent._y == maxSBC_y) {
this._parent._parent.listMc._y = -maxMC_y;
} else {
this._parent._parent.listMc._y = sc_y/maxSC_y*maxMC_y;
}
// end else if
thispageGap = maxSBC_y/this._parent._parent.totalPage;
thisPage = Math.floor(this._parent._y/thispageGap);
this._parent.pageNum = thisPage+1;
this._parent._parent.cpageMc.gotoAndStop(thisPage+ 1);
};
}
// end if 
}
// End of the function
function moveSc(tg, num) {
delete tg._parent.onEnterFrame;
delete tg._parent._parent.listMc.onEnterFrame;
maxSBC_y = tg._parent._parent.scrollBar._y+tg._parent._parent .scrollBar._height-tg._height;
thispageGap = maxSBC_y/(tg._parent._parent.totalPage-1);
listpageGap = tg._parent._parent.mask._height;
thisPage = Math.floor(tg._parent._y/Math.floor(thispageGap));
tg._parent.pageNum = thisPage+1;
tg._parent._parent.cpageMc.gotoAndStop(thisPage+1) ;
tg._parent._y = thisPage*thispageGap;
tg._parent._parent.listMc._y = -thisPage*listpageGap;
if (num) {
thisPage = thisPage+num;
tg._parent.pageNum = thisPage+1;
tg._parent._parent.cpageMc.gotoAndStop(thisPage+1) ;
this.moveFc(tg._parent, thisPage*thispageGap);
this.moveFc(tg._parent._parent.listMc, -thisPage*listpageGap);
}
// end if 
if (thisPage == 0) {
tg._parent.scPreBt._visible = 0;
tg._parent._parent.preBt._visible = 0;
} else {
tg._parent.scPreBt._visible = 1;
tg._parent._parent.preBt._visible = 1;
}
// end else if
if (thisPage == totalPage) {
tg._parent.scNextBt._visible = 0;
tg._parent._parent.nextBt._visible = 0;
} else {
tg._parent.scNextBt._visible = 1;
tg._parent._parent.nextBt._visible = 1;
}
// end else if
}
// End of the function
function moveFc(tg, tgy) {
tg.distY = tgy;
tg.onEnterFrame = function() {
var _loc2 = this.distY-this._y;
this._y = this._y+9.000000E-001*_loc2;
if (Math.abs(_loc2)<=4) {
this._y = this.distY;
delete this.onEnterFrame;
}
// end if 
};
}
// End of the function
function printPage(num) {
var _loc2 = 0;
var _loc8 = 20;
var _loc5 = 0;
this.printMc.loder.createEmptyMovieClip("p"+_loc2, _loc2);
this.printMc.loder["p"+_loc2].attachMovie("a4", "a4", 1);
this.printMc.loder["p"+_loc2].a4._x = -30;
this.printMc.loder["p"+_loc2].a4._y = -30;
for (var _loc3 = 1; _loc3<=num; ++_loc3) {
this.printMc.loder["p"+_loc2].attachMovie("q"+_loc3, "question"+_loc3, _loc3+10);
var _loc6 = this.printMc.loder["p"+_loc2];
var _loc4 = _loc6["question"+_loc3];
var _loc7 = _loc6["question"+(_loc3-1)];
_loc4._x = 0;
_loc4._xscale = _loc4._yscale=75;
_loc4._y = _loc5;
_loc5 = this.listMc["question"+_loc3]._height*7.500000E-001+_loc4._y+_loc8;
if (_loc5>=this.printMc.loder["p"+_loc2].a4._y+this.printMc.loder["p"+_loc2].a4._height-30) {
_loc4.removeMovieClip();
_loc5 = 0;
--_loc3;
++_loc2;
this.printMc.loder.createEmptyMovieClip("p"+_loc2, _loc2+1);
this.printMc.loder["p"+_loc2].attachMovie("a4", "a4", 1);
this.printMc.loder["p"+_loc2].a4._x = -30;
this.printMc.loder["p"+_loc2].a4._y = -30;
}
// end if 
}
// end of for
this.printMc._xscale = this.printMc._yscale=70;
}
// End of the function
stop();
totalQuestnumA = 77;
totalQuestnumB = 9;
listMake(totalQuestnumA+totalQuestnumB);
LUB

Kod: Zaznacz cały

function submit(num) {
this.totalQuest = num;
this.incorrect = this.totalQuest-this.correct;
this.percorrect = Math.floor(this.correct/this.totalQuest*10);
_root.endMc.congMc.correct = this.correct;
_root.endMc.congMc.incorrect = this.incorrect;
_root.endMc.congMc.percorrect = this.percorrect;
_root.endMc.congMc.total = this.totalQuest;
_root.endMc.wyniki_mc.congMc.correct = this.correct;
_root.endMc.wyniki_mc.congMc.incorrect = this.incorrect;
_root.endMc.wyniki_mc.congMc.percorrect = this.percorrect;
_root.endMc.wyniki_mc.congMc.total = this.totalQuest;
_root.endMc.prcongMc.correct = this.correct;
_root.endMc.prcongMc.incorrect = this.incorrect;
_root.endMc.prcongMc.percorrect = this.percorrect;
_root.endMc.prcongMc.total = this.totalQuest;
if (this.percorrect>=10) {
_root.endMc._visible = 1;
} else {
_root.replayMc._visible = 1;
}
// end else if
}
// End of the function
function printData() {
var _loc5 = 0;
var _loc6;
this.correct = 0;
this.incorrect = 0;
this.percorrect = 0;
for (var _loc4 in this.printMc.loder) {
var _loc2 = this.printMc.loder[_loc4];
for (var _loc3 in _loc2) {
if (typeof (_loc2[_loc3]) == "movieclip" && _loc3 != "a4") {
_loc2[_loc3].ex.select = this.listMc[_loc3].ex.select;
_loc2[_loc3].ex.text = this.listMc[_loc3].ex.text;
_loc2[_loc3].ex.checkRadio();
}
// end if 
}
// end of for...in
}
// end of for...in
}
// End of the function
function myprintJob(tg, ntg, ntg2) {
my_pj = new PrintJob();
var _loc3 = my_pj.start();
if (_loc3) {
my_pj.addPage(ntg);
my_pj.addPage(ntg2);
for (var _loc2 in tg) {
if (typeof (tg[_loc2]) == "movieclip") {
my_pj.addPage(tg[_loc2]);
}
// end if 
}
// end of for...in
my_pj.send();
}
// end if 
delete my_pj;
}
// End of the function
this.scrollMc.scrollBt.onPress = scrollFc;
this.scrollMc.scrollBt.onRelease = this.scrollMc.scrollBt.onReleaseOutside=function () {
this.stopDrag();
delete this.onEnterFrame;
this._parent._parent.moveSc(this);
};
this.scrollMc.scNextBt.onRelease = function() {
if (thisPage < totalPage) {
this._parent._parent.moveSc(this._parent.scrollBt, 1);
}
};
this.scrollMc.scrollBt.onRollOver = function() {
this.gotoAndStop("f2");
};
this.scrollMc.scrollBt.onRollOut = function() {
this.gotoAndStop("f1");
};
this.scrollMc.scNextBt.onRollOver = this.scrollMc.scPreBt.onRollOver=function () {
this.gotoAndStop("f2");
};
this.scrollMc.scNextBt.onRollOut = this.scrollMc.scPreBt.onRollOut=function () {
this.gotoAndStop("f1");
};
this.nextBt.onRollOver = this.preBt.onRollOver=function () {
this.gotoAndStop("f2");
};
this.nextBt.onRollOut = this.preBt.onRollOut=function () {
this.gotoAndStop("f1");
};
this.scrollMc.scPreBt.onRelease = function() {
this._parent._parent.moveSc(this._parent.scrollBt, -1);
};
this.nextBt.onRelease = function() {
moveSc(this._parent.scrollMc.scrollBt, 1);
};
this.preBt.onRelease = function() {
moveSc(this._parent.scrollMc.scrollBt, -1);
};
totalPage = this.pageCount-1;
trace("totalPage "+this.pageCount+" "+totalPage);
tpageMc.gotoAndStop(totalPage);
printPage(totalQuestnumA+totalQuestnumB);
stop();
this.listMc.submitMc.onRelease = function() {
this._parent._parent.printData(this._parent._paren t.totalQuestnumA+this._parent._parent.totalQuestnu mB);
this._parent._parent.submit(this._parent._parent.t otalQuestnumA);
};
_root.endMc.printBt.onRelease = function() {
myprintJob(printMc.loder, _root.endMc.prcongMc, _root.endMc.wyniki_mc);
};
ODPOWIEDZ