Sunday, January 11, 2009

How to Solve Flash Player Lag/Hiccup

Lately I have been testing a graphic intensive Flash program. I keep running into a problem. At some point in the program the Flash Player would lag or suffer a hiccup.

I went to other websites to see if my I was the only one experiencing this. I was not the only one.

1. I found that this maybe caused by a graphics card driver not being installed.

So I reinstalled the graphics card driver and it seemed to solve it a bit.

But this is not really the end of the story.

2. Flash can also lag if there are too many objects being instantiated in the Flash program. Especially if they are being created inside a loop. This causes Flash player's memory consumption to grow thus causing a lag.

But try to run other Flash programs and see if they lag. Because often it is the programmers fault why Flash lags. He probably did not develop the Flash program optimally.

Update August 2009: Okay guys, you may be wondering if this problem only occurs because you are using Windows, Mac, or Linux. Let me tell you, from looking at my web statistics of all the people who landed, let me share to you that this is a problem on all Operating Systems. It does not matter whether you are using Linux, Windows, or Mac OS. We are all experiencing this problem.

What does this mean?

It means Flash programmers must work to use the Flash Player more efficiently. At this point, programmers are doing things that are pushing the Flash Player to its limit - especially with Flash games.

On the otherhand, Lets hope that Adobe comes up with improvements to handle our programs.

Update December 2010:
I am no longer experiencing this problem. I've tested it on Windows XP and Windows 7. Just get the latest Flash Player from the Adobe website.

Thursday, January 8, 2009

Adobe Flex: How to Embed and Display SWF Assets

I have an swf file, published for Flash Player 9+ that contains two symbols. I am going to need one symbol which is actually a movie clip. This movie clip is named Jar and it comprises of two frames. The first frame is a picture of an okay jar. The second frame contains a picture of a broken jar. How do we embed and display this in Flex 3? (I will assume you are familiar with Flex 3) ...

import mx.core.MovieClipAsset;
import mx.controls.Image; [Embed(source="myassets.swf", symbol="Jar")]
[Bindable] public var JarClass:Class;

... That is about it when declaring it in Flex using Actionscript.
Now lets displaying using a function.
I made a function named init() which I call every time the CreationComplete event of the application is executed.
Here is the function:

private function init():void {

     var myJar:MovieClipAsset = MovieClipAsset(new JarClass());
     myJar.gotoAndStop(2); // Display the second frame
     var zImage:Image = new Image();
    zImage.source = myJar;
    zImage.x = 40; zImage.y = 40; // add to the DisplayObject to make it visible addChild(zImage);

} // init

That's about it.

Tuesday, January 6, 2009

Why Blocking Malware with HOSTS is not Recommended

A couple of people has sent me alternative solutions to solve this popup.adv.net and mtn5.goole.ws problem. I am surprised that this malware still bothers a lot of people since I have already solved this problem using the steps outlined here.

One of the solution suggested is to modify the file hosts which you can usually find at c:\windows\system32\drivers directory What you then do is open it with a notepad and place the following entry: 127.0.0.1 popup.adv.net 127.0.0.1 mtn5.goole.ws Then save the file. And then when you browse again you will no longer get the ads. Except, some of you will now have popups that have "page not found" messages.

It's not an elegant solution and I would not recommend it.

Another reason why this solution is bad, is that yes you are able to block the malware ads from displaying, but your PC will still be infected and your DNS setting is still screwed.
What you got by doing the above solution is really a false sense of security. So again the right thing to do is clean your PC of the trojan/virus then follow the steps outlined here.

Related Links:
How to Remove popup.adv.net and mtn5.goole.ws - Final Solution
How to Block Adwares using Firefox NoScript extension
How to Block popup.adv.net and mtn5.goole.ws