Friday, December 4, 2009

Eno?



This is a super basic little thingum...but then, I'm also feeling a little fried at the end of this week. This requires headphones or speakers, and though it may take it a second, I swear it IS doing something after you click start.

This is pretty much an incremental counter that, when it hits a certain point, cues in an .mp3 and calls a function that adds the little sound notification text. Nothing huge, but I did use some similar code to create the soundtrack for my upcoming capstone project.

Tuesday, December 1, 2009

Stay on target...



Just a little quick one. Here we have a "seeker" movie clip that is constantly on the hunt for those delicious little green orbs. It will turn to face the nearest one (or the one it's currently chasing) via some trigonometry. The chasing is nothing too incredibly complex. There's an invisible hit box surrounding the seeker and when it hits a green orb, the seeker's change in coordinates is based off of where the orb is relative to the seeker.

You may notice the seeker has a preference for one of the orbs. I believe that if both orbs are within sight, the seeker goes after the one it is currently chasing. I have seen it do an about-face to chase the other orb, but I think that's because I've put in a cool down period for the chase. In other words, if the hit zone ISN'T hitting the green orb, the seeker will still give chase for a half second. During this cool down period (invisible to the viewer), the seeker can freely change targets if one is available.

Sunday, November 29, 2009

Dynamic Text Loading

EDIT: Okay, for some reason the embedded .swf couldn't locate the .txt file in the same directory. So, here's a link to a version that works.
Remember, use the arrow keys to move the letter origin point.

Alright, here we have another old random experiment from a few months back. Basically what we have here is a .swf pulling in text information from an external .txt file. Every half a second or so, we pull the next character from the text file and shove it into a new dynamic text field. This text field is inside a movie clip that simply fades over the course of a few seconds.

Simple stuff here, but it amuses me! But then, so do sparkly objects and keys, so...

Anyway, you'll find the .as file below (that houses the origin point's controls) and the .fla containing the code. The "testTxt.txt" is the text the .swf pulls from, so if you want to save these files to your local machine, be sure to grab that little guy, too.

ALSO, you may wonder why I have my loadVars line in the onEnterFrame function...sure, it costs a little more computation, BUT this allows for instant updating. You could have this .swf open, modify and save the .txt file, and BAM! The .swf instantly reflects the changes made without have to recompile. Slick, eh?

text file
.fla source
.as source