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.
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.
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?
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; }
stap is undefined when your swf starts. that's the problem.
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.
Don't see what you're looking for? Try a search.
|