-
[F8] help with the color matrix
ok so I am working on a new site for myself. In the background I have a moving red image that loops every 40 frames or so. Now as the user navigates my site I would like the background image color (the red) to change. I don't want to load a new movie I just want to use the adjust color filter to color the existing movieclip. Through my searches I have found that using the "color matrix" does the job. My question is how do I fade in the color change? I can't for the life of me think how to tell the color matrix to fade the new color onto the loop when a user presses a button. I appreciate any help. I am writing this post so I can hopefully get a conversation started about the process. Thanks in advance for any help or advice.
-
Banned
var matrix:Array = new Array();
matrix = matrix.concat([1, 0, 0, 0, 0]);
matrix = matrix.concat([0, 1, 0, 0, 0]);
matrix = matrix.concat([0, 0, 1, 0, 0]);
matrix = matrix.concat([0, 0, 0, 1, 0]); // alpha value
The last row is responsible for your fading effect. So, on changing the value of alpha dynamically you can control over your fade.
Give it a try
-
Hey deepakflash,
Sounds interesting, the only problem is I'm not that experienced with arrays. I don't know how to target that alpha variable and increase or decrease it. All my fades have always been created with onEnterFrame functions and if statements.
I realize asking you how to do this is way out of line but if you knew of a link where i could get the info that would be awesome !!. thanks so much for taking the time to try and help me.
-
Banned
the alphaValue in the last row can range between 0.0 and 1.0
matrix = matrix.concat([1, 0, 0, 0, 0]);
matrix = matrix.concat([0, 1, 0, 0, 0]);
matrix = matrix.concat([0, 0, 1, 0, 0]);
matrix = matrix.concat([0, 0, 0, alphaValue , 0]);
So you can have a variable(example: var alphaValue) that keeps incrementing or decrementing between 0.0 and 1.0. Substitute this value in that matrix array. This alphaValue will decide on the range of your fade.
I haven't tried yet. you can play around with it and may be you get what you need.
You may refer here for more.
-
thanks deep,
I'll give it try. If you come up with anything in the future let me know. Thanks for all the help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|