Tag Archive for 'bug'

Where is the “Save and Compact” in CS5?

I found the “Save and Compact” was missing from the new Flash CS5. At first it didn’t bother me until I copied a previous project with loads of bitmaps to act as base for a new project.
I always work this way when I start a new project: I copy my most recent (similar) project, remove the stuff I don’t need, rename some stuff and start building the new project.
No problem for as-files, but oddly enough stuff like movie clips, sounds, bitmaps, etc. you remove from your fla-file-library are not actually removed from the fla-file itself. This means all stuff removed from the library is actually just hidden (but with no way to un-hide) and will float forever in your fla-file without any use.
In previous Flash versions this problem could be solved by hitting the “Save and compact” option but for some reason they removed this option in the CS5 version of Flash.

Very annoying if you ask me because I just want to work like I was used to without fla files growing in size with each new project (for no apparent reason).
Luckily I found a very simple solution: clear everything from your library you don’t need any more and then just hit “Save as…” and save as a CS4 file. Thiss step will remove most of the overhead. After this, saving it again as CS5 file will reduce the file-size even more!

This trick is a bit more work than before (and it would make more sense if Flash did it all by itself),  but atleast it gets the job done.

Hopfully an update for CS5 will get rid of this problem once and for all…

MouseEvent.ROLL_OUT troubles

Just great 🙁 Just when I thought I mastered the MouseEvents in as3 (after trying almost every combination of MouseEvents, buttonMode and mouseChildren) I found a new problem situation; only this time I can seem to find a solution.

The situation looks like this:
If you can see this, then you might need a Flash Player upgrade or you need to install Flash Player if it's missing. Get Flash Player from Adobe.

– The two shapes are siblings so they have the same parent (i.o.w. the two shapes can’t be nested).
– The blue oval is on top of the green rectangle.
– I want to know when the mouse leaves the green rectangle.

The problem is that the green rectangle dispatches a ROLL_OUT and MOUSE_OUT event as soon as the mouse hits the blue oval.

I tried all combinations of mouseChildren, buttonMode and enabled on the oval and on the parent of the two clips, but nothing seems to make the oval not “steal focus” of the rectangle.

Here is the source of the test: Rollout test (zip)

I can think of some workarounds (hitArea, using an invisible button, etc.) but I much rather find a straight way to handle this kind of situation.
Since this was never a problem in as2 I believe there should be a decent solution in as3 as well.

If someone has an answer to this problem or knows about a secret property I haven’t tried, please let me know…

WordPress update & plugin troubles…

Just great! Recently I updated my blog to wordpress 2.3.3 (because of a major security leak) and all of a sudden almost my entire blog crashed 🙁 .
Without any proper warning on the wordpress site when downloading the new blog version, I assumed there should be no problem to update, but that turned out to be a big mistake…
my entire blog crashed!

It turned out the (old) plugins were the root of the problem and I had to delete them all in order to get my blog up and running again.

Mad as I could be I tried to reinstall new versions of plugins, but since most of the plugins were not yet updated and compatible with the new WordPress version it was still drama and I decided to let it be and leave my blog a big mess (no syntax highlighting, broken tags, etc.).

After a week of snowboard fun I regained the courage to look for new plugins to replace the old ones. And whaddayaknow; I found just the right plugins for my blog. I’m not sure if it was the time plugin-developers needed to update their plugins or the time I needed to cooldown and start a fresh new search but I did it 😀 .

SWF and Youtube embedding
To show swf files, youtube videos and other mash-up stuff I now use xhtml-video-embed. This plugin lets you embed different content using a simple [tag] ... [/tag]-markup…
No more fucked-up embedcode in your post editor!

Syntax highlighting
To display my codesnipets in proper format without screwing up the layout of my theme I now use WP-Codebox. It turned out this plugin is even better than my old syntaxhighlighter-plugin!
This plugin uses a <pre lang="LANGUAGE"> ... <pre>-markup and supports a lot of languages (including actionscript). Very nice. 😀

For the tags of my post I now use the new tag-feature of WordPress. Since it doesn’t display tags with posts by default I had to find a way to show them anyway and I found the answer right here: http://richgilchrest.com/how-to-add-wordpress-23-tags-to-your-current-theme/
In short; you just have to add a line like the one below into the index.php, archive.php,  and/or single.php file of your theme:
<?php the_tags("<b>Tags:</b> ", ", ", ""); ?>
How easy…

In the end it turned out to be all worth the stress and nail nibbling… justGREAT!

PS: With my blog back in business I decided to change the header and footer of my theme as well. Hope you appreciate it :mrgreen:

0.1*3 = 0.30000000000000004

Isn’t this just great? I stumbled upon this problem in actionscript a while ago, but at that time I just worked around it and never bothered again… until today. A colleague came to me with the same problem and I decided to investigate a little more.

Apparently it is some weird bug when it comes to multiplying decimals values by 3. Take this little script for example:

var j:Number; 
for(var i:int=0; i&lt;10; i++){ 
	j = i/10; 
	trace(j+"*3 =\t"+(j*3)); 

It outputs:
0*3 = 0
0.1*3 = 0.30000000000000004
0.2*3 = 0.6000000000000001
0.3*3 = 0.8999999999999999
0.4*3 = 1.2000000000000002
0.5*3 = 1.5
0.6*3 = 1.7999999999999998
0.7*3 = 2.0999999999999996
0.8*3 = 2.4000000000000004
0.9*3 = 2.7

And it doesn’t stop just there. The same problems occur when adding a decimal value to the double of it’s value:

trace(.1+.2) //0.30000000000000004 
trace(.2+.4) //0.6000000000000001 
trace(.3+.6) //0.8999999999999999 
trace(.4+.8) //1.2000000000000002

The problem occurres in Javascript as well as in Actionscript (and probably some other languages too) so it’s probably caused by the way decimal values are treated at byte-level. Because it’s not likely there will be a fix for this soon, here is a little workaround:
i = int(i *10)/10; //use int() in favour of Math.round() to speed up the code

Where is my as2 remoting in Flash 9?

Just great! I installed Flash 9 and was happy I could finally throw out the old Flash 8 version only to find out that I couldn’t  compile my old as2 remoting projects in Flash 9. At Adobe they were smart enough to include remoting in as3 but they totally forgot to add it for as2 as well. Checking the (Flash 9) help led me to the site where I can only download the Flash 8 remoting installer which can’t be installed for Flash 9…

Very smart Adobe! 😐

Fortunately I thought of an easy way to get this problem solved; simply copy the remoting classes from Flash 8 to some other directory and set this directory as one of your default Flash 9 – as2 – classpaths. (Copying it into the default classpath with all other default classes didn’t work for me somehow.)

To make it easy for you I extracted the remoting classes and put them in a zip: as2RemotingPackage.zip

PS: I coudn’t find any info about this on the internet so either nobody ever needed it, nobody ever bothered to try and find a solution or this solution is so simple nobody ever bothered to write about it.
Anyway I bother to write about it for those of you who couldn’t find a solution or just didn’t bother to find one.

Hope this will help you… 💡