AS3 - TextField - HTML Text

Hi,
I would like to find a nice solution to the following
problem:
I have a large HTML text containing text and images
(<img>) inside a source TextField. I need to split this
content into several TextField's of a fix width and height so that
no scrolling is required.
I tried to use all the new goodies that AS3 provides
(getLineText(), bottomScrollV, etc). They are very helpful and if I
had normal text (no HTML tags) to deal with, I could split the
content without a problem. My problem is to do this on a HTML
content. It is very difficult to find the HTML version of a
splitted content.
Does anybody have an idea I could do this job?
Any help is greatly appreciated.

no, your small textfields can be assigned text until they
their maxScrollV property exceeds one. then remove text from the
end of the small textfield's text property until its maxScrollV
property decreases to one AND you have a logical place to break the
text at which point you start assigning text to the next small
textfield.

Similar Messages

  • Buttons to send html text to textfield

    How do I insert html text to a dynamic textfield?
    The textfield's instance is called myDynamic. The first button is called button1_btn. I've read on htmlText and multiline, but I can't figure out how to simply attach a text to a button and, when the button is pressed, the htmlText is sent to the field.
    var firstText = "";
    firstText.multiline = true;
    firstText.htmlText = "<p>test.</p>";
    button1_btn.addEventListener(MouseEvent.CLICK, myInner);
    function myInner (m:MouseEvent):void {
      myDynamic.htmlText = firstText;

    That should be working, but for some reason it's not, so I'm guessing the problem lies with the textfield, because I tested the button by changing the function to gotoAndStop and it seems to be working, but only under some odd condition. I created the textfield manually, not with AS3, but that shouldn't make any difference, since I gave it an instance name. I work with scenes (not my choice) and I'm noticing some odd behavior, and I wonder if it may have anything to do with my problem.
    For example, when I change the function to gotoAndStop (1, "del2"), the button, which is directed to del2 (part 2) will not work if you click on del3 (part 3) right away; however, if you click on del2 first, then on del3 again, and you click the button, then it's working. As for the textfield, it won't work either way; the only thing I've noticed is that if you go to del2 and back to del3, a mystical "e" appears. I wish I could explain myself better, so instead I invite you to check it out (it will only take you 20 seconds).
    How to reproduce the 'error':
    1. Go to http://studenter.miun.se/~stti1400/test2.swf;
    2. Click on Del3;
    3. Click on the yellow button in the upper left corner, under "1" (it doesn't work);
    4. Now click on Del2;
    5. Click on Del3;
    6. Notice the "e"; now click the same button as before (it takes you to del2).
    In case you want to check the fla-file: http://studenter.miun.se/~stti1400/test2.fla
    I played around a bit, changing the text of the variable to something else, like "okokokokok"; the "e" doesn't appear then. I first thought the "e" was a fragment of the text, with the rest of the text not showing.

  • Getting the value of a html:text property in javascript function

    Hi all,
    I am using struts framework and I need to get a value in a textfield both in java part and javascript part
    <td><html:text property="identityNumber"> </td>
    I dont know how can I reach the value user entered in that field in the javascript function
    function verifyID(){
              var identityUserEntered = ????
    alert(identity);
    }

    the javascript expression document.forms[0].identityNumber.value should do it.
    You do realise you can't run java and javascript at the same time though right? The only way javascript can communicate with java is to submit an http request (normally submit form)

  • ComboBox  over HTML text shows link

    I have a ComboBox that opens over an HTML text field. The
    HTML text field contains html text as links i.e. "<a href="">
    etc which change colour on rollOver. Rolling over a link in the
    open ComboBox also triggers the rollOver on the underlying html
    text!
    It's as if the ComboBox is transparent, but I can't get it's
    background to be solid so as not to trigger the rollovers
    underneath. BTW the html links do not respond in any way other than
    to the rollOver. They do not link anywhere if a mouse click happens
    in the ComboBox. If the box is closed however, they do link as
    designed, to other pages.

    The HTML_FORMAT was renamed to TEXT_FIELD_HTML_FORMAT to reflect the fact that it is specific to the htmlText property in TextField, not a general html implementation.
    This is working correctly for me:
                var _text:String = "<html><body><span>first line of text, <i>this is italic</i> and <a href='cnn.com'>a link to cnn</a>, 2nd line of text.</span></body></html>";
                var _flow:TextFlow = TextConverter.importToFlow( _text, TextConverter.TEXT_FIELD_HTML_FORMAT);
                _flow.fontLookup = FontLookup.DEVICE;
                _flow.renderingMode = RenderingMode.NORMAL;
                _flow.fontFamily = "Arial";
                var s:Sprite = new Sprite();
                s.x = 30;
                s.y = 30;
                _flow.flowComposer.addController(new ContainerController(s, 300, 500));
                _flow.flowComposer.updateAllControllers();
                addChild(s);

  • Is there a way to get the cursor position index of html text field

    I'm trying to work on a text pad like MC with "insert text at
    position X" and "find and replace" can anyone tell me how to find
    the cursor index of an html text field. Selection.getBeginIndex() ,
    Selection.getEndIndex(), Selection.getCaretIndex() as far as I know
    these methods only work with text and not htmltext.
    What I'm trying to do is assign different parts of the string
    to variables so that I can combine them to reconstitute my html
    string.

    enfantterrible:
    If I understand correctly, you want the corresponding
    position in the
    htmlText propery of the caret index (which as you point out
    is only the
    position in the plain text version of the textfield content).
    Below is how I would do it. Maybe there's an easier or more
    efficient
    way (using XML objects etc), but I don't know it. You could
    conduct all
    your string searches in the plain text and then convert the
    result to
    the html positions. I didn't build this to accept negative
    parameters
    for the pos parameter (e.g. from end of string backwards) but
    the
    function could be adapted to do this too if necessary. The
    test data is
    not proper html from a text field, but it doesn't really
    matter what it
    is so long as its formatted correctly. It just separates the
    tags from
    the content to enable apples with apples comparison.
    //some test data
    var testStringXML = "<format>Hel<b>lo i can't
    t<i>ell you h</i>ow hap</b>py I
    am.</format>";
    var undecoratedString = "Hello i can't tell you how happy I
    am.";
    //the conversion function
    function findDecoratedPosition(pos:Number, xmlString:String,
    test:Boolean):Number {
    //anything between '<' and '>' should be excluded from
    plain text search.
    //create an array of array elements (n=2) consisting of tag
    then plain text
    //requires correctly formatted xml/html
    var tempArr:Array = xmlString.split("<");
    for (var aa = 0; aa<tempArr.length; aa++) {
    tempArr[aa] = tempArr[aa].split(">");
    //remove the first and last elements of the new array (these
    are empty)
    tempArr.pop();
    tempArr.shift();
    //find the corresponding plaintext location and calculate
    the "decorated" position
    var retPos:Number = 0;
    var posCount:Number = 0;
    for (var aa = 0; aa<tempArr.length; aa++) {
    retPos += tempArr[aa][0].length+2+tempArr[aa][1].length;
    //+2 allows for missing < and >
    posCount += tempArr[aa][1].length;
    if (posCount>pos) {
    return (retPos+(pos-posCount));
    //out of range
    return -1;
    //test code:
    for (var aa = 0; aa<undecoratedString.length; aa++) {
    var altPos = findDecoratedPosition(aa, testStringXML);
    trace(undecoratedString.charAt(aa)+" in position "+aa+"
    plainText equates to position "+altPos+" in the decorated version
    ["+testStringXML.charAt(altPos)+"]");
    }

  • Explorer HTML text flash bug?

    Hello!
    I have the following problem for a dynamically created
    textfield:
    mytext.text = "<b>bold text</b><span
    class='green'>green</span>";
    Even tough it works great in the Flash environment, it will
    render differently in an IE7 browser.
    In Firefox, it renders the bold and class tags correctly. IE7
    doesn't render anything, it show only plain text: "<b>bold
    text</b><span class='green'>green</span>"...
    If I change text to htmlText, IE7 will render the bold tags
    but no class [stylesheet] tags correctly... and Firefox will only
    show the bold tags, no line breaks and no class [stylesheet] tags
    correctly?
    AS2 had some bugs regarding html rendering but I don't think
    I ever had this problem regarding html text back then...
    Any thoughts? Thanks in advance,
    T.

    I too am experiencing the same bug with my own site. The only
    thing that makes me feel better about the situation is this problem
    is seen on Adobe's home page as well. If you pull up a browser in
    Linux and view the homepage, you will notice that the pull down
    menu on this site falls under the flash animation.
    My only solution so far is to check the clients OS and if
    it's reported as a Linux box then to serve up a static image
    instead. This only works if the OS is being reported correctly to
    the server... Not a good overall solution though.
    Does anyone know if any fix is underway?

  • Open hyperlinks in html text using StageWebView instead of external browser

    My iPad app downloads xml data from a server and displays it as html text. The text may contain hyperlinks and currently these are correctly displayed as links in my app. However when I click on the link, it opens the link in an external browser.
    Any idea how I could instead open the links using StageWebView - I know how to open a link using StageWebView - the problem is intercepting whatever causes it to open in the external browser and instead use StageWebView.
    Thanks in advance

    Hi, John, welcome to Apple's user-to-user discussion forums.
    Does anyone here know of a way to open new windows without using command click in a tab?
    If you want links on a web page to open in a new tab, you need to command-click on them. This will work both for links set up to open in the same window and those set up to open in a new window. There is no setting in Preferences to make links on a web page automatically open in a new tab.
    There is a preference setting to open links from other programs, such as Mail, in a new tab. In Safari's Preferences, click on the General icon. Towards the bottom where it says "Open links from applications", check "in a new tab in the current window".

  • Swing JEditorPane how to divide a html text in equals pages

    Hi,
    I want to load a html text from a file into a JEditorPane and divide its content in pages with the same number of lines. I want to create a look like in pdf or microsoft word. I found somewhere an example wich create the editor as I want but it is made using shapes and draw them.
    The look is that that I want, but being shapes they aren't editable or selectable.
    Can you give me any ideea how can I make this?
    Thanks in advance!

    You can use this
    http://java-sl.com/Pagination_In_JEditorPane.html
    And this
    http://java-sl.com/JEditorPanePrinter.html
    To see my attempts to achieve the behaviour
    Regards,
    Stas

  • TS3899 I recently discovered that I can no longer access websites pointed to within the content of an email message on my iPad Air by clicking on the highlighted HTML text or symbols. What should I do to correct this issue?

    I recently discovered that I can no longer access websites pointed to within the content of an email message on my iPad Air by clicking on the highlighted HTML text or symbols. What have I done to create, and what should I now do to correct, this issue?

    Or you could include a width to your body style:
    body {
    background-image: url(Logo/sky1.jpg);
    background-position: center center;
    background-attachment: fixed;
    width: 75%;}
    It might work or not depending on your other color scheme.

  • Need to compare html text area values by using java script

    I have one html text area in my JSP file. when i click on that text area, a pop-up will come, in that pop-up i have list of items. So after selecting a item from that pop-up list, need to click okay. so that text area will update with the selected value.
    In this case, i need to compare the first text area value and updated text area value. How can i do that in Java Script.

    I suggest you look for a Javascript forum to ask questions about Javascript. This is a Java forum.

  • Need to Remove html text in Saved PDF from OBIEE Dashboard

    Hi,
    It's OBIEE 10g related issue...
    Customer wants a Dashboard as PDF, Dashboard has a footer which has a HTML link. While saving this Dashboard into PDF file, it has the HTML text in footer place rather than HTML link.
    Can you please help me on this issue that how to resolve this.
    Thanks in advance...

    Hi,
    This is a known bug in OBIEE. Refer to :
    BUG:7369585 - SUPPORT OF HTML TAGS IN PRINT TO PDF (NARRATIVE VIEW, DASHBOARD TEXT OBJECT)
    BUG:7476622 - HTML TO PDF NARRATIVE AND OTHER FORMATTING DIFFERS
    BUG:8787191 - NARRATIVE DOES NOT DISPLAY CORRECT FONT SIZE AND CENTER IN PDF
    BUG:9372634 - HTML TAGS SHOWN WHEN PRINT/EXPORT TO PDF
    NOTE:749246.1 - OBIEE 10g: When a Report is Downloaded to PDF Format it Shows the Embedded HTML Option Tag Values in the Report.
    BUG:12826562 - HTML TAGS AND CODE USED IN COLUMN FORMULA ARE VISIBLE IN REPORT PDF
    BUG:5747757 - NARRATIVE VIEW IN PDF DOES NOT KEEP FORMAT
    The workaround is to print the report to Excel or HTML.
    Thanks,
    -Amith.

  • Static  text corrupts randomly in html text region

    Hi,
    I am creating on a page a series of hide/show regions with static html containing images stored in the database. The tags in the html are pretty straight forward, just a few &lt;p&gt;, &lt;br&gt; and <img></img>. The size of the region is about 400-1000 characters. The problem is when I run the page and display the region, I see characters missing from the displayed page or are corrupted. For example an "&lt;br&gt;" tag I inserted would turn into "&amp;lt;br>" or an image name "SummaryOutput.jpg" would be "SumaryOutput.jpg". Sometime the missing character are not even in the text I generate but in the substitution string like #WORKSPACE_IMAGES# where some images gets complete path while others are missing one character in the uri (e.g. "et" instead of "get"). This happens about 70% of the time for some regions with multiple images. The ones with only one image link don't seem to have the problem.
    How I created the region is this.
    1. creating an an HTML Text Region, hide/show (although I did tried switching to no-template and the problem still existed).
    2. upload the images into the db and not assign them to any application.
    3. create my html doc using MS Word and save as "filtered htm".
    4. open the html doc using TextPad and edit the image links to using the db image (e.g. <img src="#WORKSPACE_IMAGES#imagename.extension" alt="Image Title">
    5. Cut&Paste the html code into the Resource textarea of the HTML Text Region. Click "Apply Changes"
    6. Display the page. Most of the times the page displays fine, but when there are two or three images (less than 70kb each) contained in the html code I often see the randomly missing characters.
    7. When I do view source on the page, I see that the link to the images are corrupted.
    8. When I do edit page and look at the region->source. Sometimes I see the characters changed but sometimes not (eg. The name of the jpg is correct in the textarea but wrong in the output page)
    Here are the things I've tried which did not work.
    1. Remove all html tags from the html, keeping only the <img> tags. So only plain text and <img>
    2. Do all the work in one IE6 browser window instead of using two sessions of FireFox and an IE. I thought maybe session states are conflicting.
    3. I see the same problems in both IE and Firefox so I don't think it's a browser issue, at least on the viewing end.
    4. There are no items in these regions, just text and images.
    The behavior I am seeing is completely buzzard to me and I've exhausted all my methods of debugging. I did some searching on the forum and did not see any problems approaching what I am seeing on my server. Has anyone seeing anything like this or have an idea where to look for the problem?
    Thanks,
    Wayne
    Edited by: [email protected] on Jun 25, 2009 1:10 AM

    nope - it's set to static. I do have a link embedded using
    the properties panel and thought that might be the reason. It
    wasn't. Strangest thing. I've recreated some of the text boxes and
    they are working. It's happened a few times to me - and I'm
    beginning to think it is a quirk in Flash 8.

  • Firefox will not display my HTML file as its contents - only displays the HTML text (firefox 5.0).

    I can download a file as a Firefox file (zipped) and it displays successfully. Then I can save the file as a text file and see the HTML text.
    When I work on the HTML text file and then try to display the modified file in Firefox 5.0 and Windows XP, Firefox will only show the HTML text, not the display of the contents of the file.

    Make sure that the file has a .html file extension if you want Firefox to render the content.
    Your above posted system details show outdated plugin(s) with known security and stability risks.
    *Shockwave Flash 10.0 r32
    Update the [[Managing the Flash plugin|Flash]] plugin to the latest version.
    *http://www.adobe.com/software/flash/about/

  • Use jbo:InputRender instead of html:text

    I'm currently trying JDev 10g preview and i'm using Business Components with Struts. When i use the data control palette to create an input form in a JSP page, all the input are html:text. Is there a way to set the default type of all inputs to jbo:InputRender instead of html:text?
    Thanks
    J�r�

    No, i would like to set the type of each input in my Business Component instead of in the JSP pages. This way, if i want to change the type of an input, i will have to change my business component, not my JSP pages.
    So, to be able to do this, i have to change every input from html:text to jbo:InputRender in all my forms. Which i think is not optional, because if the input type is not indicated, jbo:InputRender use the input type (which in most case, except for dates, is html:text).

  • Gallery with HTML text under image

    I'm working on a gallery of images with thumbnails on the left and larger photos on the right. My problem is the larger photos on the right need some text under them. I've been adding the text to the photos in photoshop and doing this as a standard swap image/swap image restore. What I was wondering, is there a way to add this text as HTML. When I do the swap image I would need to swap out the HTML text also. I've done this as a layered div in the past, but it gets cumbersome when you have 30 thumbnails. Hopefully someone has a good solution for this. I'm thinking about giving up on Dreamweaver and doing this sort of thing in Flash.
    ----Here's the website I'm working on -- http://www.elyssabassdesigns.com/fashion_collection/fashion_cuffs.html

    There are literally hundreds of CSS, DHTML or jQuery solutions you could use.
    http://www.1stwebdesigner.com/resources/57-free-image-gallery-slideshow-and-lightbox-solut ions/
    http://www.dynamicdrive.com/dynamicindex14/index.html
    www.JAlbum.net
    Nancy O.
    Alt-Web Design & Publishing
    Web | Graphics | Print | Media  Specialists
    www.alt-web.com/
    www.twitter.com/altweb
    www.alt-web.blogspot.com

Maybe you are looking for

  • Configure New TM on a New Macbook pro with retina display Issue

    I have bought a new New Macbook pro with retina display laptop (Lion moutain OS)and a new TM (2TB). I have an internet router with wireless connect. I plugged TM to the router with an ethernet cable. Connect my TM to my macbook with an ethernet cable

  • [CS1][CS2][CS3][CS4][VB][VBS] flipped GraphicLines - bug ...

    hi could you please run this script: set myindi=createobject("InDesign.Application") set mydoc=myindi.activedocument for a=1 to 10     set myLine = mydoc.pages.item(1).graphiclines.add     myline.geometricbounds = array(0,50,200,a*10) next (I think c

  • Cannot Find Symbol Class helpppp !!!!

    i need help really fast i cant get my inner class to work here is the code this is the class public class Tools      public Tools()      class ToolsA           int quantityTool;           public void setquantityTool(int a)                quantityTool

  • Can't connect to Remote time capsule in Lion

    I have several Macs: in my office, at home in the UK and in the US. I also have time capsules in the three different locations.  (Office, home and US).  All time capsules are set to share over WAN. My MacBookPro2011 and MacBookAir2011 both run OSX Li

  • RMAN Crosscheck Command

    I trying to run very simple command and for the life of me and I can't seem to get it correct. I want to run a .cmd file that will log into rman and do a crosscheck arhivelog all; command. Here's what I have which does not work: rman target=/ nocatal