<?xml version="1.0" encoding="utf-8" ?>
        <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"; xmlns="*">
  <mx:Style>.myText { fontWeight: "bold"; fontSize: 20; color:
#FF0000; }</mx:Style>
  <MyMarquee id="mm" width="200" moveDuration="20000"
marqueeText="Thunder and lightning are rare in San Francisco."
textStyleName="myText" backgroundColor="0x000000" borderStyle="inset"
borderThickness="2" />
  <mx:TextInput id="ti" width="200" />
  <mx:Button label="change marquee text"
click="mm.marqueeText=ti.text" />
  </mx:Application
**************MyMarquee Component*********************
<?xml version="1.0" encoding="utf-8"?>
<mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml"; paddingTop="20"
paddingBottom="20"
    paddingRight="0" paddingLeft="0" creationComplete="createEffect()"
horizontalScrollPolicy="off" >

    <mx:Script>
    <![CDATA[

        import mx.effects.Move;

        [Bindable]
        public var direction:String;

        [Bindable]
        public var moveDuration:Number;

        [Bindable]
        public var marqueeText:String;

        [Bindable]
        public var textStyleName:Object;

        public function createEffect(): void
        {
           var newEffect:Move = new Move();

           //set the duration of the Move effect. The default is 10000
ms.
           if(newEffect==null)
           {
               newEffect.duration = 10000;
           }
           else
           {
               newEffect.duration = moveDuration;
           }

           // set the xFrom and xTo values of the Move Effect
depending on the
           // 'direction' specified. The default is movement from
right to left.
           if(direction == "right")
           {
               newEffect.xFrom=0-theText.width;
               newEffect.xTo=width;
           }
           else if (direction == "left" || direction == null)
           {
              newEffect.xFrom=width;
              newEffect.xTo=0-theText.width;
           }

           newEffect.repeatCount=0;
           newEffect.repeatDelay=100;

           newEffect.play([theText]);
        }

    ]]>
   </mx:Script>

<mx:Label id="theText" styleName="{textStyleName}"
text="{marqueeText}" />
</mx:Canvas>
---
The above code will help you to create a marquee effect on  a text.

Thanks,
RD



On May 18, 7:41 pm, [email protected] wrote:
> Can you send sample code?
>
>
>
>
>
> On Mon, May 18, 2009 at 2:45 AM, Renu Danu <[email protected]> wrote:
> > You can use effects for this i.e. Move effect.
>
> > Thanks,
> > RD
>
> > On Sun, May 17, 2009 at 6:43 PM, Abhinav Mehta <[email protected]>wrote:
>
> >>  Guys.....
>
> >> Can anybody help me how to create in simple way, a marquee a-like
> >> tag.....which can move horizontally as well vertically.
>
> >> Thanks in-advance.
>
> >> Regards
> >> Abhinav Mehta
> >> MSRIT | Bangalore
>
> > --
> > WITH WARM REGARDS
> > RENU
>
> --
> Sincerely
> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
> Edwin Melendez
> Print/Web/Media
> 646-246-4368- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Flex 
India Community" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/flex_india?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to