news
media
projects
links
styles
about
feeds

August 16, 2004

[AS 1.0] Track Mouse & Draw.

Pretty simple mouse tracking method. Click to draw.

var mp:Array = [];
tmouse = function(){
	mp.push({x:_xmouse, y:_ymouse});
}
trackInterval = setInterval(tmouse, 10);

onMouseDown = function(){
	lineStyle(1,0x000000,100);
	moveTo(mp[0].x, mp[0].y);
	for(var i=0;i < mp.length;i++){
		lineTo(mp[i].x, mp[i].y);
		moveTo(mp[i].x, mp[i].y);
	}
	mp.splice(0,mp.length-1);
}
Mouse.addListener(this);

By: Dustin DuPree

Add Comment

August 16, 2004

Can you say pathetic?

Guess how long it took me to run/walk a mile today? Give up? A whopping 16 minutes. How pathetic is that? Once a very long time ago I was able to do it in 10, which was still pretty pathetic. I think this is the first time I've done it in a couple years though. Too much sitting at the computer and never getting exercise I guess. It sure did wake me up though. Maybe I'll have to try again later.

The other day I went to the Chicago Comicon with pals Eric & Erin. I don't really read comics, and I'm not a toy collector... but it was still interesting. Check out mydilemma.net for some funny pictures. Some red headed guy in the "Artist Alley" portion of "the con" stopped us and forced us to buy some comics for $0.50. They are the "craziest thing you'll find at the con" (in his words). I haven't really looked at them yet, but you can check out the site at torcpress.com.

Aside from that I've been working on a Flash game for some reason. It's currently in beta phase, but it is definitely playable. You can check it out here. (take note of the games.dujodu.com sub domain). I'll add it to the flash section once it's complete. If you find any bugs send me an e-mail or IM me (see contact page). Try to get the high score before Bowen blows everyone out of the water with his master dodging skills.

By: Dustin DuPree

Add Comment

August 13, 2004

[AS 1 or 2] array.splice() fun.

These do the same thing but in different ways. #2 is a bit faster since there is no number iteration. These were made to pick a given amount of items (at random) from an array. Each item is shown only once. These do kill the array, so making a copy first would be a good idea if you need to use it more than once.
/* Ask Some Questions!!! */
questions = ["q1", "q2", "q3", "q4", "q5", "q6", "q7", "q8", "q9", "q10",
 "q11", "q12", "q13", "q14", "q15", "q16", "q17", "q18", "q19", "q20"];

askNumber = 15; // how many "questions" to ask.

for(i = 0; i < askNumber; i++){
	rNum = Math.floor(Math.random()*(questions.length));
	trace(questions[rNum]);
	questions.splice(rNum,1);
}

/* Hold Back Some Questions!!! */
questions = ["q1", "q2", "q3", "q4", "q5", "q6", "q7", "q8", "q9", "q10",
	    "q11", "q12", "q13", "q14", "q15", "q16", "q17", "q18", "q19", "q20"];

holdNumber = 10; // How many "questions" to hold back. 

while(questions.length>holdNumber){
	rNum = Math.floor(Math.random()*(questions.length));
	trace(questions[rNum]);
	questions.splice(rNum,1);
}

/* Remove Like Array Elements */
function removeLikeElements(_array, _element){ 
    var i = _array.length; 
    while (i--) if (_array[i] == _element) _array.splice(i,1); 
} 
Thanks goes to Senocular the 8 eyed wonder from the Kirupa Forums for that last one. (his site has some great FireWorks exensions, flash examples, and tons of other stuff.. plus he is a nice guy, so check it out).

By: Dustin DuPree

Add Comment

recent media

Perfect Paradigm by Dustin DuPree
Perfect Paradigm
Flash Levels by Dustin DuPree
Flash Levels
Motion In Flash by Dustin DuPree
Motion In Flash