Marcela channeling Margeeka

or you could try something random.

These are a few of my favorite things.

I see you're interested in my obsession with Flash. Perhaps you'd like to subscribe to that tag's feed?


Feb 05, 2010
Permalink
Best programming advice I could ever give: be lazy and don’t reinvent the wheel.

FlashDevelopForum!Marcela Wed Jan 16, 2008 2:36 pm

I signed up for the FlashDevelop forums 2 years ago and haven’t had the need to post anything until today.

When I submitted my post, it prompted me on whether or not I would like to include my signature. By default, this option was checked and I left it checked because I don’t usually fill in the signature portion of my forum profiles.

I guess that day in January I wasn’t my normal self and that’s what I filled in.

No regrets, I think the advice still holds up.


Tags: | Flash | marGEEKa |
Comments (View) | 1 note
Permalink

But he says he loves me

About two years ago, I thought XPath for AS2 was the bees knees. That was back before I’d switched to AS3 and encountered the power and ease-of-use of E4X.

Making the switch has turned out to be something like leaving an abusive spouse and then marrying someone who brings you breakfast in bed every day.

Unfortunately, one of my pre-switch projects needed a touch up this week and I was forced to deal with my ex. I had to wrestle with it a bit, but I eventually got it to do what I needed, and I consoled myself with the notion that by this time next week, I would be back with my sweetheart E4X, and XPath would once again be a distant memory.

I try to wrap up my techy posts in metaphors so my non-techy followers aren’t too put off by them. I’m sure it’s as effective as trying to hide a pill in some cat food.


Tags: | Flash | office life |
Comments (View) | 1 note
Dec 10, 2009
Permalink

Tags: | Flash | marGEEKa |
Comments (View) | 2 notes
Nov 11, 2009
Permalink
this is so beautifully done

it’s logical, elegant, and when you explain it to me, I can work with it

Adam, giving feedback on the project I did for him.

We were both wary of working together on this project. And actually, I’d turned it down, but he couldn’t find anyone else to do it so the guilt kicked in and here we are.

This makes everything—the fights, the late nights, the stress—completely worth it. It reminds me that while I sometimes dream of leaving this field and becoming a teacher, I’m right where I’m supposed to be.


Tags: | Adam | marGEEKa | Flash | True Love |
Comments (View) | 1 note
Jul 30, 2009
Permalink

Tags: | marGEEKa | Flash | family | Adam |
Comments (View) | 0 notes
Jul 23, 2009
Permalink

Second AS3 Snippet of the day…

A coworker and I drove ourselves halfway to insanity trying to figure out why the number Powerpoint was spitting out as a color wasn’t translating correctly when we used it in Flash.

I vaguely remembered something about the number being a decimal representation of the RGB values instead of the hex values, so after much Googling and translating from VB to AS3, I give you:

function decToColor(dec:Number):Number {
	var red:int = Math.floor(dec & 0xFF);
	var green:int = Math.floor((dec & 0xFF00) / 256);
	var blue:int = Math.floor(dec / 65536);
	
	return red<<16 | green<<8 | blue;
}

Tags: | office life | Flash | marGEEKa |
Comments (View) | 0 notes
Permalink

Tags: | marGEEKa | Flash |
Comments (View) | 0 notes
Jul 14, 2009
Permalink

Tags: | office life | Flash | marGEEKa |
Comments (View) | 0 notes
May 07, 2009
Permalink

Tags: | marGEEKa | Flash | office life |
Comments (View) | 0 notes
Apr 14, 2009
Permalink

AS3 Tip

With AS3.0, we’ve been given a pretty cool new method for the TextField class: getCharBoundaries. This method returns the bounding box (in the form of a Rectangle) for a specified character in the TextField.

Here’s a way to animate a TextField to make it look as though it’s being typed, letter by letter, onto the stage:

/**
 * Create a "typing" effect on a TextField instance
 * @param	myRoot		the "root" displayObject which will parent the mask (should be the same as your TextField's parent)
 * @param	txtField	the instance of TextField to be animated
 * @param	time		the total amount of time allotted for the animation (leave blank for the default)
 */
public static function animateText(myRoot:DisplayObjectContainer, txtField:TextField, time:Number = 0):void {
	// If no time is specified, default to 0.1 second per character
	if (time == 0) time = (txtField.length * 100) / 1000;

	var txtMask:Sprite = new Sprite();
	txtField.mask = txtMask;
	// You should probably start your TextField out hidden in some way
	txtField.alpha = 1;
	txtField.visible = true;

	txtMask.x = txtField.x;
	txtMask.y = txtField.y;
	myRoot.addChild(txtMask);

	var g:Graphics = txtMask.graphics;
	g.lineStyle(0, 0, 0);

	/* Set up a timer to perform the "animation." Find out the length of time 
	 * for each letter by dividing the provided time by the length of the field */
	var maskAnim:Timer = new Timer((time * 1000)/txtField.length, txtField.length);

	var letterRect:Rectangle;
	maskAnim.addEventListener(TimerEvent.TIMER, function(e:TimerEvent) {
		// For each letter in the TextField, draw a rectangle on the mask
		letterRect = txtField.getCharBoundaries(maskAnim.currentCount-1);
		g.beginFill(0, 1);
		g.drawRect(letterRect.x, letterRect.y, letterRect.width, letterRect.height);
		g.endFill();
	});

	maskAnim.addEventListener(TimerEvent.TIMER_COMPLETE, function(e:TimerEvent) {
		// Once the animation is complete, remove and dispose of the mask
		txtField.mask = null;
		myRoot.removeChild(txtMask);
		txtMask = null;
	});

	maskAnim.start();
}

Tags: | Flash | marGEEKa |
Comments (View) | 0 notes