<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=Content-Type content="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]-->
<title>Re: [Golist] HydroTween Color Matrix solutions</title>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="PersonName"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:blue;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang=EN-US link=blue vlink=blue>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>I had to change the HydroTween.IDENTITY to
a public property to use, which I hope is ok?<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>And so shouldn’t the code just look
like this:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>public function set
inColor(bool:Boolean):void{<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> if(bool!=_inColor
|| !_setColor){<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> trace("\n\t
-- set color : "+_index);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> _inColor
= bool;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> _setColor
= true;<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> if(_inColor){
//--add color<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> trace("addColor");<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> HydroTween.go(this,
{ saturation:HydroTween.IDENTITY}, 1, 0, Quartic.easeOut);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> }else{
//--remove color<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> trace("removeColor");<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> HydroTween.go(this,
{ saturation:-1}, 1, 0, Quartic.easeOut);<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> }<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> }<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'> }<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Yet when addColor traces, my image is
still de-saturated…and it appears nothing is changing…<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Am I using this properly? <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Thanks<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>Shane Michael Colella<br>
<br>
</span></font><font color=navy><span style='color:navy'><o:p></o:p></span></font></p>
<p class=MsoNormal><font size=3 color=navy face=Arial><span style='font-size:
12.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
</div>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
golist-bounces@goasap.org [mailto:golist-bounces@goasap.org] <b><span
style='font-weight:bold'>On Behalf Of </span></b>donovan@hydrotik.com<br>
<b><span style='font-weight:bold'>Sent:</span></b> Friday, August 08, 2008 6:00
PM<br>
<b><span style='font-weight:bold'>To:</span></b> Mailing list for the Go
ActionScript Animation Platform<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [Golist] HydroTween
Color Matrix solutions</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=1 face=Verdana><span
style='font-size:9.0pt;font-family:Verdana'>Reset to the original color using
HydroTween.IDENTITY in the latest version.<br>
<br>
This will remove ANY CM tweens you have running on an Object.<br>
<br>
<br>
<br>
<br>
<br>
<br>
Also if you ran a couple CM tweens on an item and you want to tween to just one
CM prop you can do...<br>
<br>
</span></font><font size=2 face=Arial><span style='font-size:10.0pt;font-family:
Arial'>HydroTween.go(this, {contrast:1, saturation:1}, 1, 0, Quartic.easeOut);<br>
HydroTween.go(this, {color:0xFF0000}, 1, 0, Quartic.easeOut);<br>
HydroTween.go(this, {contrast:1, saturation:HydroTween.IDENTITY}, 1, 0,
Quartic.easeOut);<br>
<br>
This will reset the object color to it’s original state then apply the
contrast adjustment so you wind up tweening to the contrast value from whatever
the modified CM values have become. Make sure you put the IDENTITY const
last in the list of props! This is a hack trick that takes advantage the a loop
of objects runs in reverse so the resetting takes place first, then the
adjustments to the ColorMatrixFilter happen after.<br>
</span></font><font size=1 face=Verdana><span style='font-size:9.0pt;
font-family:Verdana'><br>
<br>
<br>
<br>
<br>
<br>
On 8/8/08 4:00 PM, "Shane Colella" <scolella@qorvis.com> wrote:</span></font><o:p></o:p></p>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=2 face=Arial><span
style='font-size:10.0pt;font-family:Arial'>Greetings everyone,<br>
<br>
I’m
currently working on a photo gallery which I have a line of pics that display
one after another. I’m sliding the line around depending on which
pic has been selected. The transitions are where I’m running into
difficulty. I’m using HydroTween to de-saturate and then saturate
the images, with the following code:<br>
<br>
public
function set inColor(bool:Boolean):void{<br>
<br>
if(bool!=_inColor
|| !_setColor){<br>
trace("\n\t
-- set color : "+_index);<br>
_inColor
= bool;<br>
_setColor
= true;<br>
if(_inColor){
//--add color<br>
HydroTween.go(this,
{ saturation:2.8}, 1, 0, Quartic.easeOut);<br>
}else{
//--remove color<br>
HydroTween.go(this,
{ saturation:-0.9}, 1, 0, Quartic.easeOut);<br>
}<br>
}<br>
}<br>
<br>
What’s interesting is the numbers I’ve had to use to get it to
“kinda” work. I realize that the colorMatrix is involved so
technically we are adding filters one after another, which eventually, if I
keep going back and forth, completely de-saturates the images.<br>
My question: <br>
Is there a clean way anyone has used to “reset” the filters so
I’m not cumulatively adding filters onto my pics. Basically, I want
to be able to just set saturation to 1, and let it display normal, and set it
to -1 to de-saturate, but that’s not working at all. <br>
<br>
Any thoughts from the team?<br>
<br>
I decided to post here feeling this may be a pretty common problem with the
colorMatrix side of HydroTween if one is just trying to go back and forth from
the same effect, in this case saturation…<br>
<br>
Thanks<br>
<br>
<br>
<br>
<br>
Shane Michael Colella<br>
<br>
</span></font><font size=1 face=Verdana><span style='font-size:9.0pt;
font-family:Verdana'><o:p></o:p></span></font></p>
<div class=MsoNormal align=center style='text-align:center'><font size=1
face=Verdana><span style='font-size:9.0pt;font-family:Verdana'>
<hr size=3 width="95%" align=center>
</span></font></div>
<p class=MsoNormal><font size=1 face="Courier New"><span style='font-size:7.5pt;
font-family:"Courier New"'>_______________________________________________<br>
GoList mailing list<br>
<st1:PersonName w:st="on">GoList@goasap.org</st1:PersonName><br>
<a href="http://goasap.org/mailman/listinfo/golist_goasap.org">http://goasap.org/mailman/listinfo/golist_goasap.org</a></span></font><o:p></o:p></p>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
</div>
</body>
</html>