j_lyman
09-03-2008, 02:49 PM
I have put together a Flash piece for a website I am building that is set up to show 5 different animated banners in a certain sequence. I have each banner created in a separate SWF and bring them into the main Flash movie by loading them into an empty movie clip.
Everything works great, except for one thing... after showing the sequence through about 2 to 2 1/2 times the movie starts to seize until it stops altogether and basically freezes the application that you are using to view it (whether that be a browser, Flash player or Flash itself).
The sizes of the files should not be a problem as each is 32KB or less. My guess is that it's somewhere in the code. It's only 53 lines long, but maybe there are redundancies or something that I am not aware of that would take up a lot of processor power. I don't know. So I am turning to you good folks here to throw out some ideas and thoughts. Maybe there is a way to pair down my code even more so there aren't any unnecessary lines, etc.
I appreciate any help. Thanks.
Here is the code so you can look at it:
stop();
playConsult();
function playConsult() {
empty_mc.unloadMovie();
empty_mc.loadMovie("flash/anim_consult.swf");
movieLength = getBytesTotal() / 3;
setInterval(pause1, movieLength);
function pause1() {
playLdrship();
}
}
function playLdrship() {
empty_mc.unloadMovie();
empty_mc.loadMovie("flash/anim_ldrship.swf");
movieLength = getBytesTotal() / 3;
setInterval(pause2, movieLength);
function pause2() {
playStrategic();
}
}
function playStrategic() {
empty_mc.unloadMovie();
empty_mc.loadMovie("flash/anim_strategic.swf");
movieLength = getBytesTotal() / 3;
setInterval(pause3, movieLength);
function pause3() {
playTraining();
}
}
function playTraining() {
empty_mc.unloadMovie();
empty_mc.loadMovie("flash/anim_training.swf");
movieLength = getBytesTotal() / 3;
setInterval(pause4, movieLength);
function pause4() {
playCoaching();
}
}
function playCoaching() {
empty_mc.unloadMovie();
empty_mc.loadMovie("flash/anim_coaching.swf");
movieLength = getBytesTotal() / 3;
setInterval(pause5, movieLength);
function pause5() {
playConsult();
}
}
Everything works great, except for one thing... after showing the sequence through about 2 to 2 1/2 times the movie starts to seize until it stops altogether and basically freezes the application that you are using to view it (whether that be a browser, Flash player or Flash itself).
The sizes of the files should not be a problem as each is 32KB or less. My guess is that it's somewhere in the code. It's only 53 lines long, but maybe there are redundancies or something that I am not aware of that would take up a lot of processor power. I don't know. So I am turning to you good folks here to throw out some ideas and thoughts. Maybe there is a way to pair down my code even more so there aren't any unnecessary lines, etc.
I appreciate any help. Thanks.
Here is the code so you can look at it:
stop();
playConsult();
function playConsult() {
empty_mc.unloadMovie();
empty_mc.loadMovie("flash/anim_consult.swf");
movieLength = getBytesTotal() / 3;
setInterval(pause1, movieLength);
function pause1() {
playLdrship();
}
}
function playLdrship() {
empty_mc.unloadMovie();
empty_mc.loadMovie("flash/anim_ldrship.swf");
movieLength = getBytesTotal() / 3;
setInterval(pause2, movieLength);
function pause2() {
playStrategic();
}
}
function playStrategic() {
empty_mc.unloadMovie();
empty_mc.loadMovie("flash/anim_strategic.swf");
movieLength = getBytesTotal() / 3;
setInterval(pause3, movieLength);
function pause3() {
playTraining();
}
}
function playTraining() {
empty_mc.unloadMovie();
empty_mc.loadMovie("flash/anim_training.swf");
movieLength = getBytesTotal() / 3;
setInterval(pause4, movieLength);
function pause4() {
playCoaching();
}
}
function playCoaching() {
empty_mc.unloadMovie();
empty_mc.loadMovie("flash/anim_coaching.swf");
movieLength = getBytesTotal() / 3;
setInterval(pause5, movieLength);
function pause5() {
playConsult();
}
}