You can use Strings, but they might need to be fully qualified when doing it from ActionScript instead of CSS. You can also use
obj.setStyle("moveEffect", Move); and obj.setStyle("moveEffect", myMoveInstance); Note that "myMoveInstance" would be an instance of mx.effects.Move, *not* an instance of mx.effects.effectClasses.MoveInstance -Josh 2009/1/21 oneworld95 <oneworl...@yahoo.com> > Haven't tested this, but this might be a way to accomplish it: > > var btn:Button = new Button(); > btn.setStyle("mouseDownEffect", "glowImage"); > btn.setStyle("mouseUpEffect", "unglowEffect"); > > Will try it in the morning. Didn't realize effects were set using styles. > > - Alex > > --- In flexcoders@yahoogroups.com, "oneworld95" <oneworl...@...> wrote: > > > > Is there a way to add mouseDown and mouseUp effects to a button that's > > being added dynamically via ActionScript? > > > > For example, if the button were created via MXML, it would look like > this, > > > > <mx:Button label="Help" > > mouseDownEffect="{glowImage}" mouseUpEffect="{unglowImage}" > > click="showHelp()" /> > > > > - Alex > > > > > > ------------------------------------ > > -- > Flexcoders Mailing List > FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt > Alternative FAQ location: > https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 > Search Archives: > http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups > Links > > > > -- "Therefore, send not to know For whom the bell tolls. It tolls for thee." Like the cut of my jib? Check out my Flex blog! :: Josh 'G-Funk' McDonald :: 0437 221 380 :: j...@gfunk007.com :: http://flex.joshmcdonald.info/ :: http://twitter.com/sophistifunk