A while back the blog Flex Wares had a simple marquee component. But, I can’t seem to download it anymore, so, I decided to write my own. It was simple and only took a few minutes. Note, it may not be the most efficient, but, its just an example of using some of the Flex effect properties that don’t get as much press like repeatCount=0 (which makes an effect play forever) and repeatDelay. Here is the Flex Marquee in an Application:
The MyMarquee component is based on a Canvas, so you can change any of the properties or styles on it such as its width, height, backgroundColor etc. I’ve also added in a few other custom properties including:
direction: “left” or “right”. The default is “left”.
moveDuration: The time in milliseconds for the marquee to show the full text.;
marqueeText: The text displayed by the marquee;
textStyleName: A class selector defining the styles for the text. In the example, I change the default color, fontSize and fontWeight.
So, here is the code from my sample using the MyMarquee component:
|<MyMarquee id=”mm” width=”200″ moveDuration=”20000″
marqueeText=”Thunder and lightning are rare in San Francisco.”
textStyleName=”myText” backgroundColor=”0x000000″ borderStyle=”inset”