What does this mean for me? You will always be able to play your favorite games on Kongregate. However, certain site features may suddenly stop working and leave you with a severely degraded experience.
What should I do? We strongly urge all our users to upgrade to modern browsers for a better experience and improved security.
We suggest you install the latest version of one of these browsers:
Kongregate is a community-driven browser games portal with an open platform for all web games.
Get your games in front of thousands of users while monetizing through ads and virtual goods.
Learn more »
Hi I’m a flash newbie but am an experienced developer.
I finally am looking into converting some of my java projects to flash. For my first project I ported my voter project [http://www.cheesygames.com/voter](http://www.cheesygames.com/voter) which was originally done in java.
The problem is that the flash version is much slower than the java version.
I created a test page ([http://www.cheesygames.com/voter\_test](http://www.cheesygames.com/voter_test)) to show the speed difference voter along with the source code for the project.
At this point i think I’m just not doing things in a flash friendly way which is slowing things down.
If anyone can provide any pointers I would appreciate it.
The problem is not Flash, its your coding methodology. It looks like your only using 1 EnterFrame event to update the blocks. This means 1 will only see 1 change based on the frame rate you have set. It doesnt look like are stressing flash at all.
1) Increase your framerate
2) Use a loop to run several updates per EnterFrame.
Heres your code, updated to run 3000 iterations per EnterFrame event. As you can see, its fast. It could push several times that amount per EnterFrame if you desired.
An alternate and possibly faster way would be to create a much smaller bitmap, enlarge it so the pixels are blocky, and then use the fast setPixel() method on it. You should get even better performance out of that (for this particular setting).
Ahh I see – so enterFrame will not execute quicker than the set FPS. I was thinking it would just fire as often as it could.
So does this mean your code is doing 3000 \* 31 (fps) = 2,883,000 iterations per second and my original code was doing 31 iterations per second?
I’ll have to play with the setpixel idea as well. I just assumed a pixel would always be single pixel rather than being able to zoom in on it.
Thanks for the info I appreciate it.
> so enterFrame will not execute quicker than the set FPS
Correct. The EnterFrame event fires every time flash enters a new frame, as its name implies. 31 fps = 31 events fired per second.
> So does this mean your code is doing 3000 \* 31 (fps) = 2,883,000 iterations per second and my original code was doing 31 iterations per second?
I believe its 93,000 iterations per second, but ya you got the point.