Game Development Reference
In-Depth Information
updateDissolve();
}
}
/**
* External interface to query if dissolve is done
* @return
*
*/
public function isDone():Boolean {
return m_isDone;
}
/**
* Private method to create the filter.
*
*/
private function updateDissolve():void {
var i:int;
var matrix:Array = new Array();
matrix = matrix.concat([1, 0, 0, 0, 0]); // red
matrix = matrix.concat([0, 1, 0, 0, 0]); // green
matrix = matrix.concat([0, 0, 1, 0, 0]); // blue
matrix = matrix.concat([0, 0, 0, m_alpha, 0]); // alpha
var filter:ColorMatrixFilter;
filter = new ColorMatrixFilter(matrix);
for ( i=0; i<m_targets.length; i++ ) {
var s:Sprite = m_targets[i];
applyFilter(s, filter);
}
}
/**
* Convenience method to apply the filter.
* This method assumes that there are no other
* filters applied to the sprites
* during the dissolve process.
*
* @param s the sprite to apply the filter to
* @param filter The filter itself
*
*/
private function applyFilter(s:Sprite,
filter:ColorMatrixFilter):void {
var filters:Array = s.filters;
if ( m_count > 1 ) {
 
Search WWH ::




Custom Search