last day (15 days later) » 

6:22 PM
0
A: TweenLite/TweenMax support for ConvolutionFilter

BotMasterNothing to do with TweenMax here since your code is the one making the mistake. This correctly removes all current filter and apply only one: bitmap.filters = [conv]; Since filters property is either null or is an Array. To add a filter to the list you use array operation and reapply the array...

 
I've tried that and it isn't working. I'd rather not use TweenLite, but the syntax for applying filters makes it so easy. I've also tried doing bitmap.filters = [bitmaps.filters, conv];
 
The tween is running at the same time and messing up the whole filters property. Not sure if TweenLite supports running 2 filters at the same time but either way you can easily do it yourself. I'll show you how if you need to.
why is the tween time set to 0?
 
I tried adding a timeout of 1 second to apply the convolution filter and no luck. I am simply using TweenLite because of its easy syntax of applying brightness, saturation and contrast. I am looking into how to apply those effects without tweenlite because I think I could solve the problem that way. The 0 second tween time is because I don't need it to actually tween.
 
then apply it directly in the filters property directly.
 
That is the problem. I haven't found an easy solution for brightness, saturation and contrast using colorTransform. That is why I went with TweenLite; a simple syntax for apply those filters I needed. I am doing this right now: pastie.org/10448670 after I push conv into filters it still says only 1 filter..hmm
 
6:22 PM
read my new edits.
 
I don't think colorMatrix[effects[i].effect] is a thing. colorMatrix[saturation] would be what it'd look like. It's hard debugging because I am loading the bitmap through an angular app so I can't directly test the swf in the flash IDE. I am using a lot of ExternalInterface
maybe this could help: chargedweb.com/labs/2010/04/30/…
 
if it's a prop that can be tweened then yes it's a thing. colorMatrix[saturation] would actually not work. Just try the code.
 
I did try the code. I got an error, but like I said its hard to debug since I am using the javascript console to debug since I cant test in the flash IDE. I get an error on this line colorMatrix[effects[i].effect] = effects[i].amount;
 
what error did you get?
 
hey, thanks for the help so far. Sorry this is such a pain. I've been trying to figure this out the last few days. Anyway, the error is going to be very generic since the error I receive is sent from flash through ExternalInterface to my JS console. I will show you in a sec
The error is simply Error: Error: An invalid exception was thrown. and that is directly point to this line colorMatrix[effects[i].effect] = effects[i].amount;
 
6:27 PM
do you control the props that you are passing? For now you can just wrap assigning those props in between a try and catch.
you have no access to trace correct?
 
I do have control over the props. I have several sliders written in angular, one each for brightness, contrast and saturation. Angular send those values to the SWF and the SWF calls this applyEffects function. It works fine using tween lite and the orginal way, I just need to add this sharpen filter. I sort of have access to trace. I have a function in the SWF called log() that calls externalinterface of console.log() so I can see some things in the JS console
I'm thinking the AdjustColor class is the route I need to go
 
I see using TweenLite there's a special syntax that you need to use to get the ColorMatrixFilter to work. Are you saying you do not know how to use a ColorMatrixFilter and you are using TweenLite because of its convenient shortcuts?
If that is the case then better would be to tell me what kind of color transformation you are trying to acheive.
 
Correct, tweenlite offers the abilty to easily change the contrast, saturation and brightness. That is really the only reason I am using it. I am working on an AdjustColor() solution
 
6:43 PM
AdjustColor will get you the correct matrix to pass to a ColorMatrixFilter so that should help you.
 
Yep, I got it working with adjust color and the sharpen filter
 
But if you plan to use this with slider for a real time interaction there's few more steps you will have to take.
 
The values range from -100 to 100 which kind of sucks. I want to try and make them not as fine. I could use a multiplier I suppose
I have the values changing at real time already actually
 

last day (15 days later) »