all groups > flash actionscript > december 2005 >
You're in the

flash actionscript

group:

Action from flash5 to flash8



Action from flash5 to flash8 RnV
12/29/2005 7:29:30 PM
flash actionscript: Hello,

I have a problem with the thumbnails in the flashmovie.
With flash version 5 its working perfect, with flash version 8 it dosent buth
there are no errors?
Please look at the action that i use:

Firts i load the images with:

aantal = _root.aantaldir1;
soort = "fotos/dir1";
buttons.soort = soort;
buttons.aantal = aantal;
if (aantal<20) {
buttons.gotoAndStop(aantal);
} else {
buttons.gotoAndStop(20);
}
if (aantal<21) {
buttons.volgendebutton._visible = "0";
}
buttons.vorigebutton._visible = "0";
tumbnail = 20;
do {
unloadMovie((tumbnail));
tumbnail--;
} while (tumbnail>0);
do {
loadMovie(soort + "/" + aantal + "s.jpg", (aantal));
aantal--;
} while (aantal>0);

This action works perfect olso with flash 8.
But now when there are more then 20 images de action on the Next button dosent
work:

on (release) {
stap = stap+20;
aantalbackup = aantal;
if (aantal>(stap+20)) {
aantal = (stap+20);
gotoAndStop(20);
} else if ((aantal-stap)<20) {
gotoAndStop(aantal-stap);
} else {
gotoAndStop(20);
}
if (stap > 19) {
vorigebutton._visible = "1";
} else {
vorigebutton._visible = "0";
}
if ((aantal-stap)<20){
volgendebutton._visible = "0";
} else {
volgendebutton._visible = "1";
}
tumbnail = 20;
do {
unloadMovie("_parent." + (tumbnail));
tumbnail--;
} while (tumbnail>0);
do {
loadMovie(_parent.soort + "/" + aantal + "s.jpg", ("_parent." +
(aantal-stap)));
aantal--;
} while (aantal>stap);
aantal = aantalbackup;
}

Can sombody tell me what wrong?
Please excus my bath english.

Thanks.
Re: Action from flash5 to flash8 kglad
12/29/2005 8:40:44 PM
make sure all your variables are defined. from the code you presented there is
more than one variable that initially appears undefined. in flash 5, that's
ok: an undefined variable is assumed be false or zero. in flash 8, it's
assumed to be false but not zero so any arithmetic operations will fail.
Re: Action from flash5 to flash8 RnV
12/29/2005 8:45:25 PM
Thit isent the problem,
Becaus the _visible is working well.
But when there are more then 20 images and i click volgendebutton "next" the thumbnails are empty?

Re: Action from flash5 to flash8 kglad
12/29/2005 9:11:25 PM
when you execute the following code attached to whatever button it's currently
attached to, what do you see in the output panel?

on (release) {
trace("A "+stap+" "+aantal+" B");
stap = stap+20;
aantalbackup = aantal;
if (aantal>(stap+20)) {
aantal = (stap+20);
gotoAndStop(20);
} else if ((aantal-stap)<20) {
gotoAndStop(aantal-stap);
} else {
gotoAndStop(20);
}
if (stap > 19) {
vorigebutton._visible = "1";
} else {
vorigebutton._visible = "0";
}
if ((aantal-stap)<20){
volgendebutton._visible = "0";
} else {
volgendebutton._visible = "1";
}
tumbnail = 20;
do {
unloadMovie("_parent." + (tumbnail));
tumbnail--;
} while (tumbnail>0);
do {
loadMovie(_parent.soort + "/" + aantal + "s.jpg", ("_parent." +
(aantal-stap)));
aantal--;
} while (aantal>stap);
aantal = aantalbackup;
}
Re: Action from flash5 to flash8 RnV
12/29/2005 9:30:50 PM
When i use the action, i get at the Output window: A undefined 27 B

If it is easy when you can see the *.fla its available at www.rvsitedesign.nl/extra/album.zip

Thanks!

Re: Action from flash5 to flash8 kglad
12/30/2005 2:15:10 AM
stap is undefined when your swf starts. that's the problem.

Re: Action from flash5 to flash8 RnV
12/30/2005 12:31:47 PM
Thanks !!!

It's working perfect.
I put the action stop = 0; at the frame of the movie.
Olso i have change _visble = "0" and "1" in false en true.

Thnaks for the quick help.

Greetings and best regards Rene.
Re: Action from flash5 to flash8 kglad
12/30/2005 12:59:23 PM
AddThis Social Bookmark Button