5/24/2010 6:41:13 AM
Title:
Error #1010: A term is undefined and has no properties. - color transform
hi all,
plzz fix it.....i want to change the color of the image which is dynamically loaded whenever the mouse is over the image and comes back to actual image color when the mouse is out
the as code is in script block...
private var myColorTransform:ColorTransform;
private function onImageMouseOver():void{
img.transform.colorTransform = new ColorTransform(1, 1, 1, 1,255, 255, 255, 0);
}
private function onImageMouseOut():void{
myColorTransform = new ColorTransform();
img.transform.colorTransform = myColorTransform;
}
<mx:Image id="img" source="{rp2.currentItem.@mediahubthumbnail}"
mouseOver="onImageMouseOver()" mouseOut="onImageMouseOut()"/>
5/24/2010 7:18:02 AM
it's working absolutely fine.Changed the image source to mine image. Here is your code that I used
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="1024" minHeight="768">
<mx:Script>
<![CDATA[
private var myColorTransform:ColorTransform;
private function onImageMouseOver():void{
img.transform.colorTransform = new ColorTransform(1, 1, 1, 1,255, 255, 255, 0);
}
private function onImageMouseOut():void{
myColorTransform = new ColorTransform();
img.transform.colorTransform = myColorTransform;
}
]]>
</mx:Script>
<mx:Image id="img" source="sampleImage.png"
mouseOver="onImageMouseOver()" mouseOut="onImageMouseOut()"/>
</mx:Application>
you can try including the colorTransform class
import flash.geom.ColorTransform;
5/24/2010 7:22:32 AM
the error occurs when something is not recognized by flash. It should not occur on colorTransform class since its a flash native class. Which compiler sdk are you using. I checked on flex 3.4 with flash player 9. It works fine .
5/24/2010 7:28:37 AM
@nannu your email address with "@yahoo.co.in" address is bouncing mails/ is not valid. You will not be able to receive answer mails. Unless its a valid address.
Thanks
5/24/2010 7:35:11 AM
hi all,
bran ,is it due to image is in repeaters,i have used two repeaters to access the image arg
from the xml doc
well thank u...
hi admin team,
i am receiving the answer mails ,dont understand why it is bouncing back.
well i have provided another id.
thank u for ur support