Thursday, November 17, 2011

Flash Image smoothing

Sometime we have to resize JPGs in Flash on a "loadMovie" script by making the target scale - just because. However, this usually makes the image jagged and pixelated - hate it!

So let's fix it. I found this here:

import flash.display.*;

function loadBitmapSmoothed(url:String, target:MovieClip) {
// Create a movie clip which will contain our
// unsmoothed bitmap
var bmc:MovieClip = target.createEmptyMovieClip(
"bmc",
target.getNextHighestDepth());

// Create a listener which will notify us when
// the bitmap loaded successfully
var listener:Object = new Object();

// Track the target
listener.tmc = target;

// If the bitmap loaded successfully we redraw the
// movie into a BitmapData object and then attach
// that BitmapData to the target movie clip with
// the smoothing flag turned on.
listener.onLoadInit = function(mc:MovieClip) {
mc._visible = false;

var bitmap:BitmapData = new BitmapData(
mc._width,
mc._height,
true);

this.tmc.attachBitmap(
bitmap,
this.tmc.getNextHighestDepth(),
"auto",
true);

bitmap.draw(mc);
};

// Do it, load the bitmap now
var loader:MovieClipLoader = new MovieClipLoader();
loader.addListener(listener);
loader.loadClip(url, bmc);
}


Then all that is left to do is add:

createEmptyMovieClip("myMC",getNextHighestDepth());
loadBitmapSmoothed("mypic.jpg",myMC);



Wednesday, October 19, 2011

More Wiggle

Just moves on the Y-axis

With the object selected, choose the parameter you want to effect (e.g. position, scale, anchor point, etc.)

w = wiggle(.2,100);
// Above is my variable "w" that will hold my wiggle (home many times per second, how much)
[value[0],w[1],value[2]]
// 0 = x-axis, 1 = y-axis, 2 = z-axis
// "value" says just hold the normal value

Thursday, September 29, 2011

H.264 Codec settings

I've been struggling to get my Adobe Media Encoder to make H.264 videos right for the iPhone 3. It was working on the iPhone 4. Just learned some "default" settings are incorrect. Found this:

"When encoding, please make sure you are using H.264 Baseline Profile Level 3.0 or lower with no more than three reference frames, AAC Low Complexity Profile, and an MP4 container if you want to support older iProducts."

Wednesday, September 28, 2011

AfterEffects MotionScript - "random" position

Wiggle is a cool little function in AfterEffects.

Clicking on the "transform parameter" select SHIFT+ALT "=", Animation > Add Expression. Then past this:

wiggle(.2,25)

The first value is the frequency, the second is the amount/change.

AfterEffect MotionScript - Random Scale

segMin = .75; //minimum segment duration
segMax = 1.25; //maximum segment duration
minVal = 5;
maxVal = 10;

end = 0;
j = 0;
while ( time >= end){
j += 1;
seedRandom(j,true);
start = end;
end += random(segMin,segMax);
}
s = random(minVal,maxVal);
endVal = [s,s];
seedRandom(j-1,true);
dummy=random(); //this is a throw-away value
s = random(minVal,maxVal);
startVal = [s,s]
ease(time,start,end,startVal,endVal)

Tuesday, June 14, 2011

Mobile Browser Detect

This is a great PHP script to detect the type of device that is visiting your site and redirecting to a different version. It detects all major phone operating systems (android, iphone, blackberry, windows, etc.). The script is free for non-profit and only $50 if your company is for profit.

Monday, June 6, 2011

HTML5 Fonts

Great resource for generating CSS and all font files needed for HTML5 broswers:

http://www.fontsquirrel.com/fontface/generator

MySQL Joins made Simple

Sometimes JOINs in MySQL can get confusing. This article will help make it super simple for you!

INNER_JOIN.png

This is the simplest, most understood Join and is the most common. This query will return all of the records in the left table (table A) that have a matching record in the right table (table B).


Tuesday, February 1, 2011

Force IE6, IE7 and IE8 to be more compliant

Pretty cool project going on that forces older versions of IE to be more compliant. It relies on javascript to allow for some of the newer CSS styling (but not all). It even has a transparent PNG fix for IE 6.

Target IE6 and IE7 with CSS

Very nice way to target IE6 or IE7 specifically within your CSS doc.

#myelement
{ color: #999; /* shows in all browsers */ 
*color: #999; /* notice the * before the property - shows in IE7 and below */ 
_color: #999; /* notice the _ before the property - shows in IE6 and below */ 
}