DataDrawingCanvas from Ely Greenfield does have beginFill() and beginBitmapFill(), but misses beginGradientFill() and beginShaderFill(). Same with the CartesianDataCanvas and PolarDataCanvas present in Flex since SDK 3.0 which are derived from it.
Solution
Modify the DataDrawingCanvas and OpCode classes. Add the BEGIN_GRADIENT_FILL, BEGIN_SHADER_FILL, LINE_BITMAP_STYLE, LINE_GRADIENT_STYLE and LINE_SHADER_STYLE constants to the OpCode class. Modify the collectValues() and render() methods implementation to use them. Add the beginGradientFill(), beginShaderFill(), lineBitmapStyle(), lineGradientStyle() and lineShaderStyle() methods in the DataDrawingCanvas class.
In some situations we need to be sure whether the correct type of data has been passed within an array list for an argument of a method or has been received from a specific function.
Solution
Using the Vector class we can specify which type of data will be accepted in our list, allowing the insertion if only the type required was matched.
Though this is not necessarily for a specific problem, I have created a class through which we can make some operations on given date like add days, add seconds or find the difference between two dates by day,hour,min & sec etc..
Solution
I have create a class and sample code for various operations.
I want to create a pixel bender script that does this (linear algebraic multiplication) on 2 matrices:
for (j=0;j<$rows;j++) {
for (k=0;k<$columns;k++) {
for (s=0;s<m2.$rows;s++) $m[j][k] += m1.$m[j][s]*m2.$m[s][k];
}
}
}
}
If you are not embedding your Pixel Bender, you'll need to load it dynamically and apply it to a display object. This is just a sample code shows you how.
Solution
Use an URL Loader object to load the bytecode. Once it is loaded, use the bytecode to create a Shader object. Create a ShaderFilter object using the Shader object and apply it to a Flash Display object using the filter property setter.
In some situations we need to be sure whether the correct type of data has been passed within an array list for an argument of a method or has been received from a specific function.
Solution
Using the Vector class we can specify which type of data will be accepted in our list, allowing the insertion if only the type required was matched.
Though this is not necessarily for a specific problem, I have created a class through which we can make some operations on given date like add days, add seconds or find the difference between two dates by day,hour,min & sec etc..
Solution
I have create a class and sample code for various operations.
How to create cool popup window with animated shader filter.
Solution
I've created shader filter using PixelBender to add light point on the title bar. And using AnimateFilter add this shader. The light point moves under title bar from the left to the right all the time creating cool metallic effect.