Still delving into metaballs. I implemented the suggestions in this page for optimizing, and the results are good. I could even animate it - just barely though, at ~15 FPS on my browser.
Again, most of this is just copy & paste from the source provided in the tutorial.
Metaballs - move your mouse around. Click to change the target ball.
Still looking for a more elegant solution for Flash. This is done on a very small stage size, with only 4 balls. I want to do a full screen version, with at least 10 balls moving around. ![]()
I stumbled upon Metaballs yesterday, and decided it would be cool to try it out. I’ve seen some very nice examples done in Flash, but no luck finding their sources.
After Googling around, I found this tutorial on Metaballs and computer graphics.
I ported the code into AS3, but the result is not very impressive. It is very slow and processor heavy. If you click on the stage, the last Metaball added will be moved, and as you can see, it takes a bit of time to redraw them. I’m not even thinking about animating this.
I’m still looking for a more elegant solution for Flash, hopefully one that uses the Vector-based drawing API of Flash, and not BitmapData.
UPDATE: I have an updated version here. Also, I linked the image above to the updated one. For comparison, the old one is here.
I missed it by a few days, but the 25-Line ActionScript contest has just ended, and 12 finalists and their works have been put up. All of them are very impressive and cool. Check it out and vote for your favorite!
I especially liked these:
http://www.25lines.com/finalists/0812/073.swf
http://www.25lines.com/finalists/0812/043.swf
http://www.25lines.com/finalists/0812/037.swf
http://www.25lines.com/finalists/0812/034.swf
I’ve bookmarked this site. You should too! There are some very useful and helpful tips in there. Like the latest one, as of this writing, about simplifying multiple method calls to a graphic (or any) object.
From this:
[sourcecode language="js"]
mc.graphics.lineStyle(0);
mc.graphics.moveTo(10, 10);
mc.graphics.lineTo(20,10);
//…
[/sourcecode]
To this:
[sourcecode language="js"]
with (mc.graphics) {
lineStyle(0);
moveTo(10, 10);
lineTo(20,10);
//…
}
[/sourcecode]
Much more readable and easier to type.
Check it out here and bookmark it.
I found this little class that displays the framerate of the current movie and the total memory usage of the Flash Player on your movie. It also shows the version of the player and the operating system you are on. It even has a graph. Very useful for monitoring your experiments or whatever.
If anyone knows something better, please let me know.
It’s been a while since I’ve posted here. Got caught up with exams and projects for school, and a lot of DotA with friends. Now sem-break is here, I can now just sit around and be bored.
I’ve been playing around with Papervsion lately, and have finally understood how to make it work, albeit only lightly. Here is one of my first attempts with Papervision. It’s just a bunch of spheres, where clicking on one will move the camera to its position, while the camera focuses on the center.
It’s not much. I’m still working on it, but I just wanted to post something here. Check it out. Flash Player 10 is required.
Update: I’ve added a depth of field effect. It’s not very “accurate”, but it’s a nice touch. I don’t know how to do it efficiently, so it might be CPU intensive.
Update 2: I’ve added random movement to the particles.
As always, the source.
Greetings all, still haven’t fixed the PC, and no plans in buying a new one.
But, being forced to use a Macbook with no games installed(damn DotA) and a slow connection, I managed to find some time to get back into Flash and ActionScript.
I finally figured out how to setup external class libraries in FlexBuilder, which took longer than I would have hoped. Now I can use Papervision3D, Away3D and have a central library for all other API’s and classes. It’s not as enjoyable as FlashDevelop, but, it’s better than nothing.
I also started playing with PV3D, which is just awesome. Very fun to play around with, and I can’t wait to make something I could use for my eternally work-in-progress site.
And finally, there’s a new tweening engine on the block. It’s called gTween and it’s made by Grant Skinner, so you know it’s great. Like TweenLite, it aims for speed and it’s also very lightweight. It’s still in beta, and not as powerful and feature-packed as TweenMax or other tweening engines. I haven’t tested it enough to choose it over TweenLite yet, but, I like it’s different approach to creating and managing (yep, you could manage, edit, reuse and even nest) tweens. Check it out here.
And, yeah, I would post my little “experiment” with Papervision, but I can’t seem to extract/find the swf file. I even tried using the .as file as a Document class to a Flash file, but I still can’t double-click and play the movie.
I am also having trouble with FlexBuilder, whenever I Run/Play button to test a project, it often doesn’t show anything until several retries or not at all, but using the .as file as a Doc class to a Flash file, it plays fine.
Any help would be very much appreciated.

