5 Replies Latest reply on Apr 9, 2009 10:21 PM by Michael Borbor

    Examples of a 'read more' button implementaion wanted

    Jim Daniel

      I'm looking for examples of how to implement 'read more' buttons with Flex 3.  I'd like examples of as many ways these buttons are implemented, but I really want both the drop-down text window and pop-up text window.

        • 1. Re: Examples of a 'read more' button implementaion wanted
          Michael Borbor Level 4

          What do you mean by 'read more' button?

          • 2. Re: Examples of a 'read more' button implementaion wanted
            Jim Daniel Level 1

            It's like you see on the blogs all the time, beneath the text is a button (or link button) that can be clicked that then shows the complete text.  There are are several styles of this operation and I'm looking for examples of how they can be done in Flex 3.

            • 4. Re: Examples of a 'read more' button implementaion wanted
              Jim Daniel Level 1

              Close, but now do the same thing but with TextArea inplace of the ToolTip.

              • 5. Re: Examples of a 'read more' button implementaion wanted
                Michael Borbor Level 4

                You could also use viewStates, maybe this example will work for you.

                 

                 

                <?xml version="1.0" encoding="utf-8"?>
                <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">
                     <mx:states>
                          <mx:State name="viewFull">
                               <mx:RemoveChild target="{text1}"/>
                               <mx:RemoveChild target="{button1}"/>
                               <mx:AddChild relativeTo="{titlewindow1}" position="lastChild">
                                    <mx:TextArea text="{myText}" width="100%" height="250" />
                               </mx:AddChild>
                               <mx:AddChild relativeTo="{titlewindow1}" position="lastChild">
                                    <mx:Button label="Less" click="currentState=''" />
                               </mx:AddChild>
                          </mx:State>
                     </mx:states>
                     <mx:Script>
                          <![CDATA[
                               [Bindable]
                               private var myText:String="Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Praesent aliquam, justo convallis luctus rutrum, erat nulla fermentum diam, at nonummy quam ante ac quam. Maecenas urna purus, fermentum id, molestie in, commodo porttitor, felis. Nam blandit quam ut lacus. Quisque ornare risus quis ligula. Phasellus tristique purus a augue condimentum adipiscing. Aenean sagittis. Etiam leo pede, rhoncus venenatis, tristique in, vulputate at, odio. Donec et ipsum et sapien vehicula nonummy. Suspendisse potenti. Fusce varius urna id quam. Sed neque mi, varius eget, tincidunt nec, suscipit id, libero. In eget purus. Vestibulum ut nisl. Donec eu mi sed turpis feugiat feugiat. Integer turpis arcu, pellentesque eget, cursus et, fermentum ut, sapien. Fusce metus mi, eleifend sollicitudin, molestie id, varius et, nibh. Donec nec libero.";
                               
                          ]]>
                     </mx:Script>
                     <mx:TitleWindow x="127" y="97" width="70%" height="400" id="titlewindow1">
                          <mx:Text text="{myText.substr(1,100)}"  x="258" y="134" id="text1"/>
                          <mx:Button label="More" click="currentState='viewFull'"  id="button1"/>
                     </mx:TitleWindow>
                </mx:Application>