Nov
28
2009
Thomas Viktil
At a recent project I had to make a video loop indefinitely and most importanly: seemless. I tried all kinds of different methods, including using FLV, F4V, M4V, FLVplayback component, the Video class, embedded video and a few other. The only solution that worked was (in my opinion) the most outdated one.
I setup a new SWF file in Flash Professional and imported the video to stage. I chose to create keyframes for each frame of the video, set the JPG compression rate to 100 and then exported the video as a SWF. This was the only method I could find that would make the video loop seamlessly. It solved one problem but introduced another.
As the application ran I monitored the memory usage and soon discovered that the application ate up more and more memory for each time the video looped. To solve this problem I forced the garbage collector to run each time the video completed a loop. This kept the memory usage stable and the application has now been running for about a month.
This is how you run the garbage collector:
System.gc()
no comments | tags: adobe, air, AS3, flash, garbage collector, memory usage, system.gc | posted in AS3, air, flash, flex
Apr
28
2009
Thomas Viktil
I’m currently using Flex Builder 3.0.1.205647 with Flex SDK 3.1.0 and I got an error saying Flex couldn’t create my AIR file. After a bit of googling I found out that it is a bug in Flex Builder 3 (Bug report #FB-11712), and it seems like it will be fixed in the Gumbo release.
The bug is related to adding custom application icons. You do this by editing the application’s xml file. To be more precise, at the lines which looks like these:
<!-- The icon to display for the file type. Optional. -->
<icon>
<image16x16>icon_16.png</image16x16>
<image32x32>icon_32.png</image32x32>
<image48x48>icon_48.png</image48x48>
<!--image128x128></image128x128-->
</icon>
The solution to this bug is actually quite simple. Simply comment out the icons you don’t plan to use -just like I have done in the example above. Oh, and be sure to tick the check box “Copy non-embedded files to output folder” in Project -> Properties -> Flex Compiler.
3 comments | tags: air, application icon, bug, compile error, create file, flex builder, flex sdk, gumbo, icon, non-embedded files, xml | posted in air, flex