--- In [email protected], "thegators_2002" <[EMAIL PROTECTED]>
wrote:
>
> Thanks again Dan!
>
> Taking your suggestion, I created a custom component for both lines
with
> a footnote marker in them, and the footnote at the bottom of a page. 
I
> used an HBox, with two or more Text boxes inside them.  Each text box
> can have a different size, so it looks like superscript.  I reduced
the
> horizontal gap of the HBox to 0 so they are next to each other, and
play
> with the padding, including using negative numbers, to position the
> footnote marker just right.  I also added setters to set the number,
the
> text, and the font-size of each textbox.  Here is my custom component
> code for the footnote text at the bottom of a page for anyone else
> interested:
>
> <?xml version="1.0" encoding="utf-8"?>
> <mx:HBox xmlns:mx="http://www.adobe.com/2006/mxml"; horizontalGap="0">
>      <mx:Script>
>          <![CDATA[
>              [Bindable]
>              private var fns1:Number = 8;
>              [Bindable]
>              private var fns2:Number = 10;
>
>              // Set method.
>              public function set FootnoteNumber(val:String):void {
>                  fnNumber.text = val;
>              }
>
>              // Set method.
>              public function set FootnoteNumberSize(val:Number):void {
>                  fns1 = val;
>              }
>
>              // Set method.
>              public function set FootnoteText(val:String):void {
>                  fnText.text = val;
>              }
>
>              // Set method.
>              public function set FootnoteTextSize(val:Number):void {
>                  fns2 = val;
>              }
>
>
>           ]]>
>      </mx:Script>
>      <mx:Text id="fnNumber" paddingRight="2" fontSize="{fns1}"
text="1"/>
>      <mx:Text id="fnText" fontSize="{fns2}" text="Text goes here."/>
>
> </mx:HBox>
>
>
>
> In my application, I drop this control onto a canvas, and using the
> creationComplete event, call the following function to set the text
and
> the sizes at run-time, though this can obviously be done at
design-time
> as well:
>
> private function Test():void
>          {
>              this.fn1.FootnoteNumber = "2";
>              this.fn1.FootnoteNumberSize = 8;
>              this.fn1.FootnoteText = "Hello World";
>              this.fn1.FootnoteTextSize = 16;
>          }
>
>
> It actually looks decent, and is completely re-usable.
>
> Pete
> --- In [email protected], "Daniel Freiman" FreimanCQ@
> wrote:
> >
> > The ideas in your original question might be the way to go then. 
Some
> > simplification can be done by making your own component
> (FootnoteTextArea).
> > Throw a UITextField on a UIComponent and then overlay the footnotes
> (images
> > or additional UITextFields) as children to the FootnoteTextArea
> (simplifies
> > the origin point).  You can re-layout the footnotes on resize of the
> > FootnoteTextArea or the change event of UITextField.  The a
> placeholder for
> > the footnotes can be represented in the UITextField by a space
> character in
> > a special font that won't otherwise be used. You can search for
these
> > placeholder characters and then use the getCharBoundaries() to find
> out
> > where the footnote should be placed.
> >
> > It's not simplest solution...unless there isn't an alternate
solution.
> >
> > I'm going to need to implement superscript in a few months, so I'd
be
> > interested to hear if you ever find a solution.
> >
> > Good luck,
> >
> > - Dan
> >
> > On 11/7/06, thegators_2002 thegators_2002@ wrote:
> > >
> > > Thanks, Dan!
> > >
> > > I tried your suggestion and made a small SWF.  I embedded it in a
> line
> > > of htmlText using the <img> tag.
> > >
> > > <mx:htmlText><![CDATA[Total Amount<img
src='Images/Superscript.swf'>
> > > Required Today: <font color="#ff0000">$0</font>]]></mx:htmlText>
> > >
> > > Unfortunately, Flex doesn't seem to render it correctly.  The
image
> > > only appears when I have a text control that is expanded to be
> several
> > > lines long.  In other words, I can't just put a simple 1-line text
> > > field on the canvas and generate the text.  I have to use a
> multi-line
> > > text field or text area, and even then the image appears at the
end
> of
> > > the text.
> > >
> > > In the help, it says "The <img> tag is not fully supported in Flex
> 2,
> > > and might not work in some cases" and also "This tag is supported
> only
> > > in dynamic and input text fields that are multiline and wrap their
> > > text".  There is an example about how to make text flow around an
> > > image.  I can't really do this for a simple superscript footnote
> > > number, unfortunately.
> > >
> > > Does anyone have any other ideas I can try?  It seems odd that
> > > something so simple should be so impossible!  :(
> > >
> > > Thanks for any help,
> > > Pete
> > >
> > >
> > >
> > >
> > >
> > > --- In [email protected], "Daniel Freiman" FreimanCQ@
> wrote:
> > > >
> > > > to the best of my knowledge, there's not a great way to do this.
> My
> > > best
> > > > idea would be to create a footnote swf and embed it in the
textbox
> > > with the
> > > > img tag.  Each swf could be passed a number (and/or possibly
some
> > > formating
> > > > information) and would simply display that number in a small
font
> in a
> > > > textfield (autosize left).  you would need to keep track of the
> number
> > > > within the textbox so that if one gets deleted the rest get
> renumbered
> > > > automatically (or i guess you could let them edit it manually
> too).
> > > >
> > > > - Dan
> > > >
> > > > On 11/6/06, thegators_2002 thegators_2002@ wrote:
> > > > >
> > > > > Hi,
> > > > >
> > > > > My Flex app will have lots of text that must be footnoted on
the
> > > > > screen.  Some of the text includes dynamically generated
> numbers, so
> > > > > the size of the textbox is indeterminate at design-time.
> > > > >
> > > > > I have read that superscript/subscript HTML tags are not
> supported in
> > > > > the HtmlText sections of the text controls.  And, because the
> text
> > > > > fields are dynamically sized, I can't just pop a shrunken
> footnote
> > > > > image or text control on the canvas overlaying the textbox.
> Does
> > > > > anyone know of a way I could dynamically add superscript to a
> line of
> > > > > text generated at runtime?
> > > > >
> > > > > Thanks,
> > > > > Pete
> > > > >
> > > > >
> > > > >
> > > > >
> > > > > --
> > > > > Flexcoders Mailing List
> > > > > FAQ:
> http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > > > > Search Archives:
> > > http://www.mail-archive.com/flexcoders%40yahoogroups.com
> > > > > Yahoo! Groups Links
> > > > >
> > > > >
> > > > >
> > > > >
> > > > >
> > > >
> > >
> > >
> > >
> > >
> > >
> > > --
> > > Flexcoders Mailing List
> > > FAQ:
> http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > > Search Archives:
> http://www.mail-archive.com/flexcoders%40yahoogroups.com
> > > Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> >
>



Reply via email to