Flash Crash Help
- Started
- Last post
- 8 Responses
- jaybee
Mornin all.
I have made an animation in flash 8 (exporting flash player 9), that loops as you can see here: http://www.umbragroup.it/News/
Everything seems to work fine, but after about 10 mins, flash crashes for some reason, the CPU jumps to 50% and blocks the PC too.
How can i solve this issue? is it the flash player or could it depend on the actionscript?
Cheers
- MrD0
Did you test of other machines? PC / Mac / low CPU / low RAM?
after a while any flash will crash if left alone (but not 10 min), it eats up ram and etc
are the images embedded? its 350k with 4 images.
why not build the file so that you load JPG dynamically and animate them via AS.
if it does not have JPG in the SWF than the SWF is too big for some reason.
- jaybee0
Yep, i've tested it on other pc's / mac too, it does the same after a certain amount of time. (Why does flash crash if left alone??)
Anyway, I've imported the jpegs into flash and given them 80% quality, exported movie is also set to 80% quality.
When an image is set to alpha 0, i also kill the image using visible = false, so it's not sitting under other images that are animating, if you check the CPU it barely reaches 5%.
wtf?
- UndoUndo0
flash doesnt crash if left alone, it is more than likely a setInterval or older onEnterFrame (or too many) are running at the same time, not being cleared etc.
check yr actionscript and use the trace command to see when functions are being called with yr AS
- jaybee0
UndoUndo i am using the setInterval to play functions, but at the end of every function i clear them using:
clearInterval (intervalName)i haven't cleared the loop interval though, i'll try that out.
- UndoUndo0
make sure that the setInterval doesnt make 2 or more calls, if it does yr clearInterval will only clear one of them
- monNom0
you can use the delete operation to clear the junk out of memory.
so after you're done with it:
delete myMCinstance;
I think flash only gets access to 32Mb of memory, so that can fill up pretty quick.
- jaybee0
I have an init() function that sets the initial settings for all movieclips, i've also included ALL clearIntervals too here, coz' when the loop is over it calls this function that reset all settings and the loop() function to animate.
Like so:
function init():Void{
//all mc settings
clearInterval(intervalId);
clearInterval(intervalLoop);
}function loop():Void{
var a0:Number = 1000;
intervalId0 = setInterval(this, "scene1", a0);
intervalLoop = setInterval(this, "loop", 10000);
}function scene1():Void{
//all mc settings
clearInterval(intervalId);
}i think it should be fine.
- jaybee0
Cheers 4 ur help, i've solved the problem!
I forgot to clear the Loop interval in the init() function.