Tag Archive for 'bug'

Page 2 of 2

I want actual sizes!

Just great! yet another weird Flash “feature”. When I tried to get the width of a rotating MovieClip I got wildly variating values. This surprised me because the MovieClip only contained exact round shape. The circle was 25 px in diameter, but when I started to trace the width in an interval I got values ranging from 25 to 35.4px.

As it turned out, the width and height of the MovieClip only represent the bounding box of the original shape (when it still had a rotation of 0). The only way to get the actual width and height of the MovieClip was to use the getBoundsmethod. This method calculates the boundingbox according to the current shape and orientation of the MovieClip giving the trrue width and height.

To test this create a movieclip width a circle in it and place the code below on the first frame (I’m no fan of timeline-code but it’s ideal for testing purpose :D ).

1
2
3
4
this.onEnterFrame = function(){ 
	this._rotation += 15; 
	trace("boundingbox-width: "+(this.getBounds().xMax-this.getBounds().xMin)+"\t\twidth: "+this._width); 
}

The sample is as2 but the problem and solution are the same in as3.

I hope this helps some of you who were wondering why a 25px circel suddenly had a 35.4px width :| .

allowFulSceen vs. transparent wmode

Just great when you waste half an hour figuring out why you can’t get your flash to run in fullscreen mode :|

To save you the time and frustration, here is why it didn’t work:
You can’t use the allowFullScreen = true and wmode = transparent together :?

Somehow the flashplayer is not smart enough to simply make the background opaque when you set the player to fullscreen mode.

Lets hope they fix this in the next player update…

Buggy Flash 9 IDE

Just great how Adobe manage to screw up something that was working just fine. :|

After reading Den Ivanov’s post I wanted to make a comment but it became so big I decided to make a post about it myself;

Apart from the bug Den describes there are tons more. I also have troubles with the panels who very often lose their “titlebar” in which case it’s impossible to close them or switch to other tabs in that panel. The only way to restore them is to close and open the panel (hit F4 twice).
There also is a bug in the sizing of the help window as it often resizes to the height of the screen making it impossible to read the complete content. :(

It’s a shame they release a version that is even more buggy than it’s alpha version. Flash 9 is almost the same as version 8 (apart from the as3 compiler) and yet they manage to screw up the IDE.
Too bad the alpha version of Flash 9 couldn’t handle components because it was much more stable than this buggy crap. :evil:

I really hope they fix these bugs (they are definitely not eastereggs like Den said) in the next update…

Garbage Collector troubles using the Loader class.

Just great :( another weird Garbage Collector issue in AS3:

When I load an image using the Loader class and unload it later on. It won’t be disposed by the garbage collector.
There are no references to neither the Loader nor the (weak) eventlisteners. After loading the image a couple of times the memory goes sky high :| .

Here is a (simple) example: loadertest.zip

Does anyone have an explaination on why the GC doesn’t clean the loaded content? I would be very grateful!

UPDATE 1 (2007-06-19):
I made the example even less complicated by using the same Loader instance when loading new images.

As I work around I tried to dispose the loaded BitmapData but unfortunately it had no effect.
I assume the leak is somewhere within the Loader (or even deeper in the code) and that the loaded (binary) data is not removed after it’s converted into a BitmapData.

UPDATE 2 (2007-06-19):
I found the solution on in this post:
http://www.webforumz.com/macromedia-flash/42690-memory-leak-when-loading-swf-in.htm

It seems that the unload() method has a bug when used in the flash IDE. Once I ran the test in a browser there seem to be no more problems and the GC nicely clears the memory…

Lets hope Adobe fixes this problem in the next Flash 9 update.