Thanks guys!

Both ways work! (Slight syntax error in John's example, but was easy to work out)

@Gordon: the docs on setStyle say "Calling the setStyle() method can result in decreased performance. Use it only when necessary."
Do you know of any metrics round this?



On 9/27/06, Gordon Smith < [EMAIL PROTECTED]> wrote:

A showEffect is actually a style whose value is an Effect, so you'd do

 

    imgNewImage.setStyle("showEffect", fadeIn);

 

- Gordon

 


From: [EMAIL PROTECTED] ups.com [mailto:[EMAIL PROTECTED] ups.com] On Behalf Of David Harris
Sent: Monday, September 25, 2006 5:30 PM
To: [EMAIL PROTECTED]ups.com
Subject: [flexcoders] adding effects in action script

 

Hi

I am creating an Image in Script and then adding it to a tile.
I have added an event listner to the "complete" event of the image
that switches visible to "true"

I would like to add a showEffect to the image, but can't see how to do it...

Here is a snippet of code:
=================================================
var imgNewImage:Image = new mx.controls.Image();

imgNewImage.addEventListener("complete",imageCompleteHandler);

imgNewImage.source = "[Source URL of Image]";

imgNewImage.height = 75;
imgNewImage.width = 75;

imgNewImage.visible = false;

//add it to the tile
imageDisplayTile.addChild(imgNewImage);
=================================================
I looked in the docs and see that an image has a showEffect value,
which you call in the tag like this:
<mx:Image showEffect="{fadeIn}".... />
and you declare the effect like this (as per docs example):
<mx:Fade id="fadeIn" duration="1000" alphaFrom="0.0" alphaTo="1.0"/>

How do I assign my "fadeIn" fade effect to my imgNewImage in script?
imgNewImage.showEffect doesn't work.

Any ideas anyone?


__._,_.___

--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com





SPONSORED LINKS
Software development tool Software development Software development services
Home design software Software development company

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to