Why is a space always added after each img ?

Hello,
I have an input TextField, in which I want to add text and images. But each time I add a new image in the textField (via an <img> tag), a space character is added after every other <img> in the TextField. Why is that ?
You can test it for yourself :
function test():void
            var tf:TextField = new TextField();
            tf.multiline = true;
            tf.text = "Hello World";
            trace("1/ tf.length", tf.length);
            trace("1/ tf.text", tf.text);
            trace("1/ tf.text.length", tf.text.length);
            trace("1/ tf.htmlText", tf.htmlText);
            trace("1/ tf.htmlText.length", tf.htmlText.length);
            var htmlText:String = tf.htmlText;
            htmlText += "<img src='image.gif' id='0'/>";
            tf.htmlText = htmlText;
            trace("2/ tf.length", tf.length);
            trace("2/ tf.text", tf.text);
            trace("2/ tf.text.length", tf.text.length);
            trace("2/ tf.htmlText", tf.htmlText);
            trace("2/ tf.htmlText.length", tf.htmlText.length);
            htmlText = tf.htmlText;
            htmlText += "<img src='image.gif' id='1'/>";
            tf.htmlText = htmlText;
            trace("3/ tf.length", tf.length);
            trace("3/ tf.text", tf.text);
            trace("3/ tf.text.length", tf.text.length);
            trace("3/ tf.htmlText", tf.htmlText);
            trace("3/ tf.htmlText.length", tf.htmlText.length);
Before the first image, the text equals "Hello World" (as expected)
Before the second image, the text is "Hello World\r "
And after the second image, it is "Hello World\r  \r "
So there are two spaces after the first image. And if you add a few images in the initial htmlText, they will have two more spaces at the end of the function.
Does anybody knows why is it, how to disable this behavior, or simply fix it ?
A big thanks to the one who can help me, I'm really stuck with this.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/text/TextField.ht ml#condenseWhite

Similar Messages

  • When paste to vim xterm, blanks lines are added after each line

    Need expert's help:
    When I copy from windows Firefox to my vnc's vim xterm, somehow after each line, several blank lines are added after every single line/paragraph. This is really annoying!
    I don't know how to solve it. I changed a my .vimrc to a very simple one, still not working.
    thanks!
    Qian

    You may have a fileformat problem.  I'm pretty sure this will work but I only did one small test.
    To display the current vim fileformat – this should return either 'dos' or 'unix'.
    :set ff
    Vim usually correctly sets the fileformat automatically upon opening a file but will default to using 'unix' if the format can't be determined.  After pasting the text, try the command,
    :update
    'update' will save the file only if changes to the buffer have occurred.  This command may change the fileformat and all the line endings are now CR-LFs (CR=carriage return; LF=line feed).  Check the fileformat again with
    :set ff
    If ':update' didn't change the line endings, or the file is now a mix of CR-LFs and LF-only line endings, try this,
    :e! ++ff=dos
    This should force rereading the buffer as a dos (Windows) format and properly display the lines. All line endings should now be CR-LF.  You can then manually set the fileformat to 'unix' with
    :set ff=unix
    and finally, save the file with
    :w

  • HP 6180c always fails after each Apple/HP update

    I have a HP 6180c All-in-One which is a lot like my old Jaguar car. When it works it is great.
    My HP 6190c ALWAYS fails on scanning after EVERY Mac HP driver update. I have to uninstall (sounds like Windows) and reinstall the HP drivers, then all is well. That is until the next update, when this ritual is repeated all over. When I call HP they say to do exactly what I do and seem proud to tell me that. Anyone know of a real solution to this? Only the scan fails.

    The HP updates are just like an update to iPhoto or iTunes and are not connected to any OS updates. For example, 10.6.1 didn't contain any updates to HP printers, but there was an HP update that came out around the same time.
    If the OS updates are causing you problems, it could be that the printer queue is getting deleted and you just need to add the printer again from System Preferences.

  • How to add spaces in outline after each heading

    I like to use outlines a lot.  However, I noticed that everytime I press enter to start a new line, the cursor is placed immediately after the header.  I'm used to there at least being one space put in by default when I press enter.
    Is there a way to add these auto spaces into my outline format? 
    Example:
    I want:     
    I.  New topic
    not
    I.New Topic

    Use the style Numbered list from the style drawer. It adds a space between the number and the paragraph line

  • Why many unwanted spaces are present after conversion by PDF to WORD?

    Sorry, can you help me?

    I would suggest you look at the fonts that are being used. It may be a font issue that is not properly being read by the translation program.

  • 5.2 Pages, how to create white space before and after paragraphs?

    Hi everyone,
    I'm having a very frustrating time with the new 5.2 version of pages after upgrading from a prior version. In the previous version, you could easily adjust the exact amount of white space before and after each paragraph. You were able to do this from within the inspector, but for the life of me, I cannot find it ANYWHERE in the new version and I'm ripping my hair out trying to find it.
    Surely you must be able to control the amount of space before and after each paragraph? It's totally useless to me if I can't; I want to be able to format my documents how I want; ie. plenty of white space between paragraphs and list points, not all bunched up together.
    Someone please help me! Thank you so much!

    Try telling Apple that. Start by rating/reviewing Pages in the App Store.
    I have been told repeatedly by Apple staff that the new User Interface makes it "Much simpler".
    When I ask how? …and point out how many (more) hidden steps there are, they don't want to talk anymore.
    Apple's standard response to just about everything lately, unfortunately.
    btw If you have the choice, use Pages '09 instead. Less buggy and way more features, better laid out.
    Peter

  • Time machine always unlocks after restarting

    Time machine always unlocks after each restart - only on MBA my MBP 2010 always stays locked and I need to put in password to open it -- any advice please I mean the locked to prevent changes lock

    Turn off TM, delete the file com.apple.timemachine.plist from the folder ~/Library/Preferences, reboot, and re-set-up TM. See if that helps.

  • Why bookmarks have 4 spaces added after the update from FF3.6 to 13?

    Why bookmarks have 4 spaces added after the update from FF3.6 to 13?

    Problems with bookmarks and history not working properly can be caused by a corrupted places.sqlite database file.
    *http://kb.mozillazine.org/Bookmarks_history_and_toolbar_buttons_not_working_-_Firefox
    *https://support.mozilla.org/kb/Bookmarks+not+saved#w_fix-the-bookmarks-file
    You can also try to repair the places database with this extension:
    *https://addons.mozilla.org/firefox/addon/places-maintenance/

  • Spooling a file adding spaces after each line

    Hi
    I am spooling a result of an sql in a csv file in linux os. But the file generates lot of blank lines after each row. How this can be eliminated while spooling
    Thanks in advance
    Sas

    Thanks a lot for your reply. Is there any way to supress the display of query result. I dont want to see the result. I want just the output file.
    Thanks
    Sas
    Edited by: SasDutta on Mar 24, 2010 4:20 PM

  • Lost disk space after each reinstall.

    I've had to reinstall leopard on my macbook three times in the last week for different reasons. After each reinstall(erase and install) it appeared that I lost a little more GB to the HDD. I have a 250GB HDD, and I know it actualls reads as 232.87, but without uploading any media and only using the reinstall disks that came with the box, I have only 218 or so GB. Is this normal? I can't find the numbers anywhere; they just don't add up.

    Anthony Turtzo wrote:
    I can't find the numbers anywhere; they just don't add up.
    My guess is that you have added up the sizes of the folders visible in Finder at the root level of the drive (Applications, Library, System, & Users) & compared that total to the total space used on the drive. The two numbers will not match because there are also hidden files & folders at the root level of the drive that Finder does not normally show. The hidden items are necessary for the proper operation of the Mac & in normal use are managed by the system. Since users should not tamper with them directly without good reason & it requires expert knowledge to do so without breaking anything, they have been made invisible in the Finder view.
    It is normal for the drive space used by these items to fluctuate, & for the total to grow somewhat after first installing the OS. Some of the items contain temporary files that are created & destroyed as needed. Some contain usage, crash, & other informational logs that are managed by routines that the system automatically runs periodically to keep their total from becoming too large. Others contain initialization data gathered over time that the system uses to start up or to run processes efficiently.
    Thus, there is no fixed correct number for their total size since that depends on the history & current state of the machine. On my iMac G5, one large hidden folder ("var") currently uses about 1.05 GB of drive space, but consider that only a ballpark number since it may be considerably different on different Macs at different times.
    If you are still concerned about the health of the drive, especially that something is eating up disk space unnecessarily, then run Disk Utility to check it. In the "First Aid" tab select your drive & click the "Verify Disk" button. If this reports no problems then you can be pretty sure there is nothing to worry about.

  • SVN Tab Complete issues (space after each complete)

    Morning all,
    I've got a weird issue with my SVN tab complete using Bash, it adds a space after each item it completes - for example: Say there is a directory 'foobar' with a file 'zomg' within that, I'd type 'svn add fo' and then hit tab - however, this results in 'svn add foobar ' (note the space). This is highly annoying, as I can no longer hit 'z' then tab to complete it to 'foobar/zomg', I have to remove the space, then go again (it does it for everything, so adding something like 'foobar/zomg/wtf/bbq' is a nightmare.)
    So far it only does it with Bash, I've not been able to test it on other shells. Subversion 1.4.6-4 on an up-to-date Arch install with core, extra and community repos enabled (however it has done it from the very start of me using Arch, so it's not a recent update that killed it).
    Regards,
    Last edited by AlexC_ (2008-09-20 16:13:48)

    Hi AlexC_ :-)
    I suspect that it may be an issue with /etc/bash_completion. This is the relevant part from my /etc/bash_completion.
    # svn completion
    have svn &&
    _svn()
    local cur prev commands options command
    COMPREPLY=()
    cur=${COMP_WORDS[COMP_CWORD]}
    commands='add blame praise annotate ann cat checkout co cleanup commit \
    ci copy cp delete del remove rm diff di export help ? h import \
    info list ls lock log merge mkdir move mv rename ren \
    propdel pdel pd propedit pedit pe propget pget pg \
    proplist plist pl propset pset ps resolved revert \
    status stat st switch sw unlock update up'
    if [[ $COMP_CWORD -eq 1 ]] ; then
    if [[ "$cur" == -* ]]; then
    COMPREPLY=( $( compgen -W '--version' -- $cur ) )
    else
    COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
    fi
    else
    prev=${COMP_WORDS[COMP_CWORD-1]}
    case $prev in
    --config-dir)
    _filedir -d
    return 0;
    -@(F|-file|-targets))
    _filedir
    return 0;
    --encoding)
    COMPREPLY=( $( compgen -W \
    '$( iconv --list | sed -e "s@//@@;" )' \
    -- "$cur" ) )
    return 0;
    --@(editor|diff|diff3)-cmd)
    COMP_WORDS=(COMP_WORDS[0] $cur)
    COMP_CWORD=1
    _command
    return 0;
    esac
    command=${COMP_WORDS[1]}
    if [[ "$cur" == -* ]]; then
    # possible options for the command
    case $command in
    add)
    options='--auto-props --no-auto-props \
    --force --targets --no-ignore \
    --non-recursive -N -q --quiet'
    @(blame|annotate|ann|praise))
    options='-r --revisions --username \
    --password --no-auth-cache \
    --non-interactive -v \
    --verbose --incremental --xml'
    cat)
    options='-r --revision --username \
    --password --no-auth-cache \
    --non-interactive'
    @(checkout|co))
    options='-r --revision -q --quiet -N \
    --non-recursive --username \
    --password --no-auth-cache \
    --non-interactive \
    --ignore-externals'
    cleanup)
    options='--diff3-cmd'
    @(commit|ci))
    options='-m --message -F --file \
    --encoding --force-log -q \
    --quiet --non-recursive -N \
    --targets --editor-cmd \
    --username --password \
    --no-auth-cache \
    --non-interactive --no-unlock'
    @(copy|cp))
    options='-m --message -F --file \
    --encoding --force-log -r \
    --revision -q --quiet \
    --editor-cmd -username \
    --password --no-auth-cache \
    --non-interactive'
    @(delete|del|remove|rm))
    options='--force -m --message -F \
    --file --encoding --force-log \
    -q --quiet --targets \
    --editor-cmd -username \
    --password --no-auth-cache \
    --non-interactive'
    @(diff|di))
    options='-r --revision -x --extensions \
    --diff-cmd --no-diff-deleted \
    -N --non-recursive --username \
    --password --no-auth-cache \
    --non-interactive --force \
    --old --new --notice-ancestry'
    export)
    options='-r --revision -q --quiet \
    --username --password \
    --no-auth-cache \
    --non-interactive -N \
    --non-recursive --force \
    --native-eol --ignore-externals'
    import)
    options='--auto-props --no-auto-props \
    -m --message -F --file \
    --encoding --force-log -q \
    --quiet --non-recursive \
    --no-ignore --editor-cmd \
    --username --password \
    --no-auth-cache \
    --non-interactive'
    info)
    options='--username --password \
    --no-auth-cache \
    --non-interactive -r \
    --revision --xml --targets \
    -R --recursive --incremental'
    @(list|ls))
    options='-r --revision -v --verbose -R \
    --recursive --username \
    --password --no-auth-cache \
    --non-interactive \
    --incremental --xml'
    lock)
    options='-m --message -F --file \
    --encoding --force-log \
    --targets --force --username \
    --password --no-auth-cache \
    --non-interactive'
    log)
    options='-r --revision -v --verbose \
    --targets --username \
    --password --no-auth-cache \
    --non-interactive \
    --stop-on-copy --incremental \
    --xml -q --quiet --limit'
    merge)
    options='-r --revision -N \
    --non-recursive -q --quiet \
    --force --dry-run --diff3-cmd \
    --username --password \
    --no-auth-cache \
    --non-interactive \
    --ignore-ancestry'
    mkdir)
    options='-m --message -F --file \
    --encoding --force-log -q \
    --quiet --editor-cmd \
    --username --password \
    --no-auth-cache \
    --non-interactive'
    @(move|mv|rename|ren))
    options='-m --message -F --file \
    --encoding --force-log -r \
    --revision -q --quiet \
    --force --editor-cmd \
    --username --password \
    --no-auth-cache \
    --non-interactive'
    @(propdel|pdel|pd))
    options='-q --quiet -R --recursive -r \
    --revision --revprop \
    --username --password \
    --no-auth-cache \
    --non-interactive'
    @(propedit|pedit|pe))
    options='-r --revision --revprop \
    --encoding --editor-cmd \
    --username --password \
    --no-auth-cache \
    --non-interactive --force'
    @(propget|pget|pg))
    options='-R --recursive -r --revision \
    --revprop --strict --username \
    --password --no-auth-cache \
    --non-interactive'
    @(proplist|plist|pl))
    options='-v --verbose -R --recursive \
    -r --revision --revprop -q \
    --quiet --username --password \
    --no-auth-cache \
    --non-interactive'
    @(propset|pset|ps))
    options='-F --file -q --quiet \
    --targets -R --recursive \
    --revprop --encoding \
    --username --password \
    --no-auth-cache \
    --non-interactive -r \
    --revision --force'
    resolved)
    options='--targets -R --recursive -q \
    --quiet'
    revert)
    options='--targets -R --recursive -q \
    --quiet'
    @(status|stat|st))
    options='-u --show-updates -v \
    --verbose -N --non-recursive \
    -q --quiet --username \
    --password --no-auth-cache \
    --non-interactive --no-ignore \
    --ignore-externals \
    --incremental --xml'
    @(switch|sw))
    options='--relocate -r --revision -N \
    --non-recursive -q --quiet \
    --username --password \
    --no-auth-cache \
    --non-interactive --diff3-cmd'
    unlock)
    options='--targets --force --username \
    --password --no-auth-cache \
    --non-interactive'
    @(update|up))
    options='-r --revision -N \
    --non-recursive -q --quiet \
    --username --password \
    --no-auth-cache \
    --non-interactive \
    --diff3-cmd --ignore-externals'
    esac
    options="$options --help -h --config-dir"
    COMPREPLY=( $( compgen -W "$options" -- $cur ) )
    else
    if [[ "$command" == @(help|h|\?) ]]; then
    COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
    else
    _filedir
    fi
    fi
    fi
    return 0
    complete -F _svn $default svn
    _svnadmin()
    local cur prev commands options mode
    COMPREPLY=()
    cur=${COMP_WORDS[COMP_CWORD]}
    commands='create deltify dump help ? hotcopy list-dblogs \
    list-unused-dblogs load lslocks lstxns recover rmlocks \
    rmtxns setlog verify'
    if [[ $COMP_CWORD -eq 1 ]] ; then
    if [[ "$cur" == -* ]]; then
    COMPREPLY=( $( compgen -W '--version' -- $cur ) )
    else
    COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
    fi
    else
    prev=${COMP_WORDS[COMP_CWORD-1]}
    case $prev in
    --config-dir)
    _filedir -d
    return 0;
    --fs-type)
    COMPREPLY=( $( compgen -W 'fsfs bdb' -- $cur ) )
    return 0;
    esac
    command=${COMP_WORDS[1]}
    if [[ "$cur" == -* ]]; then
    # possible options for the command
    case $command in
    create)
    options='--bdb-txn-nosync \
    --bdb-log-keep --config-dir \
    --fs-type'
    deltify)
    options='-r --revision -q --quiet'
    dump)
    options='-r --revision --incremental \
    -q --quiet --deltas'
    hotcopy)
    options='--clean-logs'
    load)
    options='--ignore-uuid --force-uuid \
    --parent-dir -q --quiet \
    --use-pre-commit-hook \
    --use-post-commit-hook'
    rmtxns)
    options='-q --quiet'
    setlog)
    options='-r --revision --bypass-hooks'
    esac
    options="$options --help -h"
    COMPREPLY=( $( compgen -W "$options" -- $cur ) )
    else
    if [[ "$command" == @(help|h|\?) ]]; then
    COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
    else
    _filedir
    fi
    fi
    fi
    return 0
    complete -F _svnadmin $default svnadmin
    _svnlook()
    local cur prev commands options mode
    COMPREPLY=()
    cur=${COMP_WORDS[COMP_CWORD]}
    commands='author cat changed date diff dirs-changed help ? h history \
    info lock log propget pget pg proplist plist pl tree uuid \
    youngest'
    if [[ $COMP_CWORD -eq 1 ]] ; then
    if [[ "$cur" == -* ]]; then
    COMPREPLY=( $( compgen -W '--version' -- $cur ) )
    else
    COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
    fi
    else
    command=${COMP_WORDS[1]}
    if [[ "$cur" == -* ]]; then
    # possible options for the command
    case $command in
    @(author|cat|date|dirs-changed|info|log))
    options='-r --revision -t \
    --transaction'
    changed)
    options='-r --revision -t \
    --transaction --copy-info'
    diff)
    options='-r --revision -t \
    --transaction \
    --no-diff-deleted \
    --no-diff-added \
    --diff-copy-from'
    history)
    options='-r --revision --show-ids'
    prop@(get|list))
    options='-r --revision -t \
    --transaction --revprop'
    tree)
    options='-r --revision -t \
    --transaction --show-ids \
    --full-paths'
    esac
    options="$options --help -h"
    COMPREPLY=( $( compgen -W "$options" -- $cur ) )
    else
    if [[ "$command" == @(help|h|\?) ]]; then
    COMPREPLY=( $( compgen -W "$commands" -- $cur ) )
    else
    _filedir
    fi
    fi
    fi
    return 0
    complete -F _svnlook $default svnlook
    Hope this helps.
    Last edited by alanhaggai (2008-09-21 02:08:12)

  • Why my JTree always collasped after refreshing?

    Hello,
    I have been spending whole day trying to figure out why my JTree always collasped after refreshing, but I haven't got any fruit.
    I have a Tree and it is collasped in the beginning, and I can expand and do some work(adding nodes or deleting nodes - no problem)
    But there is a button which validates the tree, and if a node has problem, its background changes which part is working Okay.
    but the tree always goes back to collasped(original state)
    I tried every methods that I searched, but nothing is working.
    Below is the codes..
    private void validateManifest() {
                CP_EditorHandler.checkManifestErrors(_contentPackage, false);
            ManifestTree manifestTree = _manifestPanel.getManifestTree();
         // get the selected node before updating
            ManifestTreeNode selectedNode = (ManifestTreeNode) manifestTree.getSelectedNode();
         // get the selected path before updating
            TreePath selectedPath = (TreePath) manifestTree.getSelectionPath();
         // below code is the part that recreates nodes of the tree and updates nodes' background
            manifestTree.getModel().setContentPackage(_contentPackage);
         // I set below code to expand to selected path
            manifestTree.setExpandsSelectedPaths(true);
         // I even added this code to make it sure
            manifestTree.setExpandedState(selectedPath, true);
    }I even added addTreeWillExpandListener in the tree constructor, but it doesn't work either.
             addTreeWillExpandListener
             (new TreeWillExpandListener() {
               public void treeWillExpand(TreeExpansionEvent e) { }
               public void treeWillCollapse(TreeExpansionEvent e)
                    throws ExpandVetoException {
                throw new ExpandVetoException(e, "you can't collapse this JTree");
               });What did I do wrong or what should I do to make it work?
    I really appreciate your help.

    I have been spending whole day trying to figure out why...no, you've spent your day cross-posting this.
    I don't know where to post the solution, l so I won't bother.

  • Text input - how set an automated space after each word?

    When typing in text and using the qwerty assisted text - how can i get it to automatically add a space after each word? My Droid original did that automatically... Thanks

    lovetennis7 wrote:
    When typing in text and using the qwerty assisted text - how can i get it to automatically add a space after each word? My Droid original did that automatically... Thanks
    I have confirmed that this feature was not included with the basic software package of the Incredible 2. 

  • In CS6, why the file size remains same after croping? And how do I reduce the size after each cropin

    In CS6, why the file size remains same after croping? And how do I reduce the size after each croping? Thx

    Select the Crop Tool and check the box [  ] Delete Cropped Pixels and you should see a reduction in file size.  With the box unchecked, the data is still maintained in the document, you just can't see it.
    -Noel

  • Why are contacts not showing up after added

    why are contacts not showing up after added. Don't show up after they added when I want to select then for a new email

    I am replying to my post with the hopes that someone can please help me!
    I am adding new episodes, but they don't show up on the main page. The most recent one to show up is from 10/29/07. I added a new episode today, but it doesn't appear on the main page (before you subscribe). Is there a limit to the # of podcasts that can appear on the main page? Has anyone else had this problem? All the relevant info is above.
    Your help is much appreciated.
    Message was edited by: oneness_podcaster

Maybe you are looking for

  • Purchase Order Good Receipt and Invoicing

    Is there a easy way to see all the Purchase Orders that have been received in the system but not invoiced? I have tried to use SE16N amd ME2K bu these transactions do not seem to help. Im trying to see what Purchase Orders have been placed that we ha

  • XDD Vs Offset file usage -Which is better approach

    Hi, We are designing a new workspace (on Documaker 11.5) for a client sending a flat file input. To reduce the impact of offset driven changes we are planning to use either of the below: 1) XDD 2) OFFSET.DAT file for which we can update AFGJOB.JDT wi

  • HCM : workflow not triggered

    Hi expert, when i tes my process (hcm fomrs and porcess), i have thi error message Workl item not created !! the worklfow is customze correctly (te exit, type linkage is ok, su53 too) ? what could be the raison ? Thanks

  • Movie file sizing

    I am trying to burn a movie file to disc using iDVD, but it keeps telling me that the file is too large for the disc, even after adjusting in project info.  How can I compress the file to get it on the DVD, without compromising picture quality?

  • I have a generation 1 Verizon Droid and firefox mobile keeps freezing, anybody else have this issue?

    I have a 1st generation Verizon Droid (running Android OS 2.2). Firefox for Android Beta keeps freezing and I physically have to remove the battery for it to reboot my phone. Does anybody else have this issue?