2010.01.29

Wordle

By underblob @ 3:32pm — Categories: Design, Tech

Was checking out the new WordPress Foundation site and saw in the sidebar it said their header image was generated with Wordle. Curious, I checked it out and found Wordle is a Java Applet that creates a graphic word matrix based on the number of recurring words in any RSS feed. There are a bunch of fonts and layout algorythms you can choose from and you can create custom color palette as well. Here is one I generated from underblob.com’s RSS:



Pretty cool!

2010.01.22

AS3 Listeners — Loader.COMPLETE vs MovieClip.ENTER_FRAME

By underblob @ 6:31pm — Categories: Flash, Tech
Tags: , , , , ,

Trying to load a directory of hundreds of images into separate movie clips using the AS3 Loader class. By assigning an Event.COMPLETE listener to the Loader, the callback function only has a reference to the Loader and not to the image that’s being loaded or the parent that it’s being loaded into. So if I need to Tween on this image after the load is completed, no dice. Instead, assign an Event.ENTER_FRAME to the parent MovieClip and dig a byte comparison out of the contentLoaderInfo object…

 

for each ( var imgPath in imgXML.elements () ) {
	var imgLoader:Loader = new Loader ();
	imgClip.addChild ( imgLoader );
	imgClip.addEventListener ( Event.ENTER_FRAME, imgLoading );
	imgLoader.load ( new URLRequest ( imgPath ) );
}

function imgLoading ( e:Event ):void {
	var bL:Number = e.target.getChildAt ( 0 ).contentLoaderInfo.bytesLoaded;
	var bT:Number = e.target.getChildAt ( 0 ).contentLoaderInfo.bytesTotal;
	if ( bT == bL ) {
		e.target.removeEventListener ( Event.ENTER_FRAME, imgLoading );
		e.target.parent.Tweener // etc.
	}
}


2010.01.18

Haiti People Finder

By underblob @ 2:11pm — Categories: Tech
Tags: , ,

Google is assisting in the finding and retrieving of lost persons in Haiti via this web application:
http://haiticrisis.appspot.com/

WP Access to Template Tags

By underblob @ 1:29pm — Categories: LAMP, WordPress

I make a form in a Custom Template in my WordPress Theme. I submit the form to a PHP script in the theme directory via bloginfo ( ‘template_directory’ ). I want to be able to generate an email and have it sent to the admin email address that’s set in the WP installation. How can I access the Template Tags in the stand-alone submission script? By pure dumb luck I found the right two lines of code to paste into my script:

require_once ( $_SERVER[ 'DOCUMENT_ROOT' ] . '/wp-load.php' );
 wp ();

Now I created a reusable script that I can drop into any WordPress Theme by inserting the Site Name via get_bloginfo ( ‘name’ ) into the subject and sending the email to the Site Admin via get_bloginfo ( ‘admin_email’ ).

Links

WordPress.org/Template_Tags
PHP.net/mail-function

2010.01.04

TweenLite Calls

By underblob @ 7:54pm — Categories: Flash, Tech
Tags: , , ,

Formatting for the GreenSock TweenLite animation AS3 Class:

TweenLite.to ( mc:MovieClip, duration:Number,
	{
		alpha:0,
		x:120,
		ease:Quint.easeInOut,
		delay:2,
		onComplete:callbackFunction,
		onCompleteParams:[ 5, mc ]
	}
 );

 

Links

GreenSock