Img tag in TextField : a nightmare ?

After reading of the documentation about Flash TextField
class (used by Label and Text), I was expected a lot of this
component, especially about the
img tag.
I spent a lot of hours trying to make it working as the doc
says. Each time I have runtime errors.
Using link to jpeg or png files I have Error #1034 (I comment
a "resolve" bug in the JIRA adobe bug system).
Then I try to embed images with a link identifier to a
movieclip symbol (seams to be the only way to use embedded images).
After spending a long time to understand what that was meaning
(just ONE example should have save half day of work !!! may be the
Adobe guy should be advised that not all the Flex developpers comes
from Flash !), I was abled to use a swf file made with fresh
downloaded Flash CS3.
But that time if the first assignment to htmlText property is
ok, when I change the value I have error #2025 (DisplayObject must
be a child of the caller - translate from french).
So I am quite disappointed about Flex choice today...
I was abled to add a support for the missing <table>
tag but I don't know how to easily rewrite a complete TextField
which can insert images (embedded in swf).
If anybody has success with images in TextField, let me know
Thanks.

I've had the same problem. Using an img tag in a dynamically
generated text field does not work the same published for AIR as it
does published for Flash Player. If I use a relative path for the
image or the class name of a symbol in the library in Flash it
works perfectly, but neither work if the same code is published for
AIR. Is there a solution to this that anyone knows of?
Here's an example:
var optionFont:Font = new UniversBold();
var optionFormat = new TextFormat();
optionFormat.color = 0x27318b;
optionFormat.bold = true;
optionFormat.size = 38;
optionFormat.font = optionFont.fontName;
var field:TextField = new TextField();
field.embedFonts = true;
field.autoSize = TextFieldAutoSize.LEFT;
field.defaultTextFormat = optionFormat;
field.selectable = false;
field.htmlText = "Hi There <img src='GTE38'> Hi There";
field.wordWrap = true;
field.width = 200;
addChild( field );
UniversBold and GTE38 are classes in the library. This works
when published for Flash, but if republished for AIR, the image
does not show up.

Similar Messages

  • Img Tag in textfield adobe air problem help :(

    Hi there,
    i ve got a textfield on the stage and wanted to give it a img
    tag.
    If i am using flash 9 in publishing, it is no problem.
    if i change to adobe air. There is no img in the textfield.
    Is this a bug???

    I've had the same problem. Using an img tag in a dynamically
    generated text field does not work the same published for AIR as it
    does published for Flash Player. If I use a relative path for the
    image or the class name of a symbol in the library in Flash it
    works perfectly, but neither work if the same code is published for
    AIR. Is there a solution to this that anyone knows of?
    Here's an example:
    var optionFont:Font = new UniversBold();
    var optionFormat = new TextFormat();
    optionFormat.color = 0x27318b;
    optionFormat.bold = true;
    optionFormat.size = 38;
    optionFormat.font = optionFont.fontName;
    var field:TextField = new TextField();
    field.embedFonts = true;
    field.autoSize = TextFieldAutoSize.LEFT;
    field.defaultTextFormat = optionFormat;
    field.selectable = false;
    field.htmlText = "Hi There <img src='GTE38'> Hi There";
    field.wordWrap = true;
    field.width = 200;
    addChild( field );
    UniversBold and GTE38 are classes in the library. This works
    when published for Flash, but if republished for AIR, the image
    does not show up.

  • Air not support img tag on textField?

    I try this:
    text_txt.htmlText = "<IMG src='myimage.jpg' id='image' /><P>This is my picture</P>";
    text_txt.text = text_txt.htmlText ;
    on Flash player
    out put is : <IMG src='myimage.jpg' id='image' /><P>This is my picture</P>;
    but on Air
    out put is : <P>This is my picture</P>;
    What's happened?
    Can you help me?
    and Sorry about my english.

    Hello,
    Any possibility you could use the HTML control instead?  The textField control does not support the <img> tag in AIR due to security issues.  Here's the comment from the documentation:
    For AIR content in the application security sandbox, AIR ignores img tags in HTML content in ActionScript TextField objects. This is to prevent possible phishing attacks.
    Thanks,
    Chris

  • HTML embeded in Flash and img tag

    I'm currently developing an application in flash, which
    consist of a hand-drawn screen, in which HTML page appears. To
    achieve this I used a TextField with html option. Unfortunately,
    TextFiles show only some simple tags – is there any other way
    to show more complicated ones in Flash CS3 (and AS3)? I have also a
    problem with the <img> tag. Picture loaded via <img>
    doesn’t print from TextField. My printing code attached -
    webpage_txt is control to print. Do you konw why it doesn't print?
    Thanks in advance for help.

    Currently, no, there are only simple HTML tags available.
    Though, FlashPlayer10 promises to have much greater support for
    text, including inline tables, etc.. You may just have to make do
    with what you have for now, and wait for the new player.
    As for your picture woes, I unfortunately am unable to help
    you there, with very little printJob experience myself.

  • Img tag limitation

    this.createTextField("mysmileys",1,10,10,500,300);
    mysmileys.html = true;
    mysmileys.wordWrap = true;
    mysmileys.multiline = true;
    mysmileys.htmlText = "These are smileys <img src='smiley.jpg' /><img src='smiley.jpg' /> who are angry";
    I'm expecting:
    These are smileys which are angry
    But I get:
    These are smileys    which are angry
    This is some limitation of Flash regarding img tags? That an image is place on a new line following the line with the img tag? Or is there a workaround?

    In my own experience with htmlText dealings, which is not at all vast, I've found that incorporating images is a losing battle in terms of controlling where they land and how they behave with text.
    Your best bet might be to just take a screen shot of what you just showed, with the images and text cmbined into an image, and place that in your textfield.  It is probably the easiest solution compared to whatever other finagling you might have to using CSS or something, if that is even possible to use to make it work.
    I did take a look thru Google regarding this issue, but the search terms I used aren't leading to the problem you are facing, except one where the answer appeared to be to not use Flash.

  • Arrrgh... img tags! 

    Hi All,
    I'm having problems with embedded <img> tags. I
    stripped out a single dynamic text box out of a larger application
    just to test the functionality (or non-functionality) of the
    <img> tags to see if it was something that I was doing in the
    larger app. I have about 6 inline icons that are 24x22 px that I
    would like to have placed inline with the text. All I have is a
    single textbox on the stage named topicText...nothing else and the
    attached code. The output shows two of the 5 or 6 inline images and
    they are one on top of the other on the left hand side. All others
    are missing, I'm assuming they are probably on top of each other.
    I've tried stripping the commas out of the text (which was
    suggested in another post), and I got a different two icons
    showing...which was strange in itself.
    Even more baffling to me was in the larger app, I load the
    code from XML and I get the same broken lineup of the two icons on
    either the right or left (depending on my align=""
    attribute)...buuuut, they display elsewhere on the stage...not even
    in a textfield???? It's almost as if Flash decided to create a
    brand new textfield on it's own and center itself somewhere on the
    stage. Any ideas?

    I am having a similar problem and was wondering if it is even
    possible for img tags to be inline with text in flash since I have
    not been able to get it to work yet.

  • How can I get a parameter back into a servlet invoked from an IMG tag ?

    I'm using a servlet to create several graphical plots per JSP i.e. per HTML page. Each graph is supposed to be different, according to a parameter which I want to pass back from my JSP. I'm getting several plots but they're all the same!
    I've tried setting an attribute in the session object before each IMG SRC= , but all I get is each plot the same! In fact, my debugging efforts show that the servlet is only called once despite 3 calls, each with a different session parameter value. I'm not sure the session parameter values are getting used properly.
    I just can't find a way of getting a parameter back into my servlet which is invoked from the IMG tag (i.e. SRC= "servlet name").
    Can anyone tell me the best way to pass a parameter back into a servlet which is invoked from an IMG tag? Can the request object be used? I can't, at the moment, see how it could be used?
    I'll certainly be very grateful if anyone can help with this - could even be useful for others as well!

    You said that, "by moving a copy of Mobile Docs back to the Library, from which I had moved it, my documents reapperared in Cloud." That says that you actually moved it. Obviously, I can't tell exactly what you did, but it sounds like you may have thought you were just putting it in the sidebar, but you actually put it somewhere else. The sidebar is not a location to put things, just a way to create a quick shortcut to access a file or folder, so you can't put things "back" from there.

  • Getting img tags to work in sub page using jstl core import tag

    Am trying to bring disparate system page reports together under one web app. This means using the jstl core import tag (I dont want to redirect as I want to hide the urls, this web app provides better security than those it calls).
    Use of the import tag works to a degree but any resources (ie. img tags) don't load.
    Have created a much simplified example that demonstrates..
    So heres the jsp...
    <%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
    <h3>Delivery Performance Report</h3>
    <c:url value="http://localhost/mycontext/subpage.html" var="myUrl"/>
    <c:import url="${myUrl}" />and a simple sub page (note plain html, no jsp, this mimics my project as the other systems are hidden source, non jsp)
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
    <HTML>
    <HEAD>
    <TITLE>sub page</TITLE>
    </HEAD>
    <BODY>
         This is the sub page<br>
         <img src="images/banner_image.jpg" />
    </BODY>
    </HTML>While I dont get any errors what I do get is ..
    Delivery Performance Report
    This is the sub page
    ...but image fails to load.
    If I redirect instead of import it works, but as I said I need to hide the url from the user as security is an issue.
    Any help appreciated, really pulling my hair out with this final stage of something that will make a real difference to us!
    regards,
    G.

    Thanks for the answer but Im afraid thicko here doesnt get it.
    The img src is relative to the sub page, and I have tried it with an absolute address (ie. http://localhost/.....) with the same result.
    If I call the sub page direct (get with browser) the image tag works. Its just if the sub page is imported with the jstl core import tag.
    I've not tried a base tag. The real project always returns pages containing absolute urls... http://ourReportServer/reports?....plenty of params so dont belive relevant, please correct me if Im wrong here though.
    thanks, G.

  • XSLT problem with img tag in Saxon

    Hi,
    Iam getting a problem with <img> tag when transforming a document using Saxon transformer. In the input XSLT I have proper closing tag for <img>, but the output of the transformation is not well formed as the closing tag for <img> does not appear. I need to feed the output to a FO object to generate a print preview, but the output is not well-formed.
    Kindly help to resolve the issue.
    Kind Regards,
    Abhinandan

    Perhaps that is because you are generating HTML as your output? As I recall, <img> tags don't have to be closed in HTML. So try generating XML instead if you need XML.

  • IE problem with img tag calling stored procedure

    I have an img tag in my JSP which looks like this (it has a very long src value):
    <img src="http://www.enetrix.com/cores/net_charts.display_temp_chart?vChartDef_in=ChartType%20=%20DIALCHART;Chart
    . . . and so on and so on . . .
    26,%2075.0);&vChartType_in=PNG&vChartURL_in=http://333.333.33.333/j2ee/servlet/chart"/>
    In short, the img calls a stored procedure and passes it a servlet among many other things. The procedure passes back an image to the browser.
    The image shows up in Firefox but not IE 7. I don't think its an issue with the stored procedure but I can't understand why IE doesn't show the image. Is there something I'm missing? I've tried both jpeg and png.
    Thanks
    Eric

    As the related posts suggest, you will need to use direct JDBC code for this.
    Also I'm not sure JDBC supports the RECORD type, so you may need to wrap your stored functions with ones that either flatten the record out, or take OBJECT types.

  • Generate image with CFIMAGE - but need to use img tag to serve the content

    I create a new image with cfimage, that already works without
    any problems.
    But instead of using the action="writetobrowser" I need to be
    able to use the script inside a img tag:
    Example: <img
    src="myscript.cfm?somedata=iwanttheimagetocreate>
    I found one webpage that deals with that problem (
    http://www.webdevelopernews.com/2007/09/14/serving-up-cfimages-via-image-tags/)
    but the image served to the browser, when using the code below, is
    of a very low quality and another point is that you can't serve
    .gif's to the browser.
    <cfcontent type="image/jpg"
    variable="#ImageGetBlob(backgroundimage)#">
    Any suggestions/solutions?
    Thanks,
    Phil

    In that entry Raymond mentions:
    "The WriteToBrowser action actually generates HTML that points
    to a ‘magic’ URL to serve the image.". ie <img
    src="/CFFileServlet/_cf_image/_cfimg-12345036853711072.PNG" alt=""
    />
    Perhaps you could create a function that captures the
    generated html by using <cfsavecontent>.
    <cfsavecontent variable="imageTagHTML">
    <cfimage action="writeToBrower" ..>
    </cfsavecontent>
    Then uses a regular expression to extract and return the url
    portion only. ie
    "/CFFileServlet/_cf_image/_cfimg-12345036853711072.PNG"
    <cfset ExtractedURLHere = SomeFunction(arguments...)>
    <cfoutput><img
    src="#ExtractedURLHere#"></cfoutput>
    Though you could also use the entire html string directly
    <cfoutput>#imageTagHTML#</cfoutput>

  • How to display JPEG in JSP w/o IMG tag?

    I have a working application where a jpeg image is ecoded on the server via a JavaBean. The bean is then forwarded to a JSP, which gets the unique jpeg filename from the bean and displays it with an html <IMG> tag. All's fine and well, but I'd like to get away from having lots of image files laying around on the server and just display the image encoded in the current request. I tried creating a custom tag to encode and display the jpeg using the com.sun.image.codec.jpeg.* package in this manner:
    ServletResponse res = pageContext.getResponse();
    OutputStream os = res.getOutputStream();
    JPEGImageEncoder encoder = JPEGCodec.createJPEGEncoder(os);
    encoder.encode(imageRef); //-- imageRef is instance of BufferedImage
    and in the JSP:
    html, other tags, etc.
    <graph:image imageRef='<%= imageBean.getImage() %>'/>
    The image displays, but nothing else in the JSP (ie. html, other custom tags). In all other tags I've written, JSPWriter is used for output, but I need an OutputStream for the createJPEGEncoder() method.
    Can anyone tell me if what I want to do is possible? I'm chasing my tail at the moment.
    TIA Mark

    Would this work for you:
    Create the IMG tag in the JSP with the SRC as a servlet.
    Also, add any parameters you may need to tell the servlet what image to send back.
    Something like this:out.print("<IMG SRC=\"/servlet/ImageProducerServlet?WhichImage=");
    out.print("MySpecialImage");
    ...The ImageProducerServlet can be setup to send back the JPEG image file.

  • Title in img tag

    I wish there was a field for title in the img tag like there
    is for the alt. As it is, when I want to put a title on an image, I
    have to do it in the code view.
    For those who don't know, the title tag will create a
    "tooltip" when someone hovers over an image, either in IE or
    FireFox. Works well, and better than using the "alt" for a tooltip.
    I'd rather use "alt" for a description of the image for screen
    readers.

    Tag inspector panel has it.
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "Malcolm N_" <[email protected]> wrote in message
    news:[email protected]..
    > On Thu, 19 Jul 2007 18:20:30 +0000 (UTC), "typist"
    > <[email protected]> wrote:
    >
    >>Well, I have to admit I hand code quite a bit,
    Michael. But I insert
    >>pictures
    >>using design view because it will include the height
    and width for me.
    >>
    >
    >
    > Well if you hand code the
    > img src="/img/test.jpg" alt="test" />
    > that's fine
    >
    > If you then select the above code in code view - go to
    the properties
    > panel - click on the W ( width ) and H ( height )
    letters - DW puts in
    > the width and height info for you :-)
    >
    > I only discovered this by accident after using DW for
    about 6 years !
    >
    > Not sure how to add the title in a similar way - I agree
    the
    > properties panel should have it.
    >
    >
    >
    > --
    >
    > ~Malcolm N....
    > ~

  • Unclosed meta/img tag. Output method= xml / xhtml / xml

    Hello,
    Im trying to parse from a Document to an String, in the usually way, as follows:
        public static String parseDocument(Document document) {
            try {
                if (document== null) {
                    return null;
                TransformerFactory tFactory =
                        TransformerFactory.newInstance();
                Transformer transformer = tFactory.newTransformer();
                DOMSource source = new DOMSource(document);
                StringWriter sw = new StringWriter();
                StreamResult result = new StreamResult(sw);
                transformer.transform(source, result);
                String xmlString = sw.toString();
                return xmlString;
    //TODO: error handling
            } catch (TransformerConfigurationException ex) {
                return null;
            } catch (TransformerException ex) {
                return null;
            } catch (Exception ex) {
                return null;
    }Ive maked a test that creates a Document:
      public static Document createFromDoc(){
            try {
                DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
                DocumentBuilder builder = factory.newDocumentBuilder();
                DOMImplementation impl = builder.getDOMImplementation();
                Document doc = impl.createDocument(null, null, null);
                Element root = doc.createElement("html");
                doc.appendChild(root);
                Element head = doc.createElement("head");
                root.appendChild(head);
                Element meta = doc.createElement("meta");
                meta.setAttribute("http-equiv", "Content-Type");
                meta.setAttribute("content", "text/xml");
                meta.setAttribute("charset", "UTF-8");
                head.appendChild(meta);
                Element title = doc.createElement("title");
                head.appendChild(title);
                Element body = doc.createElement("body");
                root.appendChild(body);
                Element div = doc.createElement("div");
                div.appendChild(doc.createTextNode("Created with docs."));
                body.appendChild(div);
                return doc;
            } catch (ParserConfigurationException ex) {
                Logger.getLogger(Main.class.getName()).log(Level.SEVERE, null, ex);
                return null;
        }Well, you can see the test method "prueba1". Y:
        public static void prueba1(){
            Document doc1 = Main.createFromDoc();
            //String doc2 = Main.createFromString();
            String doc1Str = GestorXMLDoc.parseDocument(doc1);
            return;
        }Why my method public static String parseDocument(Document document) adds this extra meta tag when it transforms a Document to an String:
    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
    and modifies the other meta tag as follows (I mean, unclosing it):
    <meta charset="UTF-8" content="text/xhtml" http-equiv="Content-Type">
    You can see the full String result:
    <html>
    <head>
    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="UTF-8" content="text/xhtml" http-equiv="Content-Type">
    <title></title>
    </head>
    <body>
    <div>Created with docs.</div>
    </body>
    </html>I tried parsing with a fake XSLT Template with output: XML, and it doesnt works. I tried changing the meta content data with "text/xml".
    This method makes the document not compatible with XML, because it doesnt close the meta tag. I need work with this XHTML doc as a valid XML document, not as a HTML (W3C allows set meta/link/img tags unclosed) to add new nodes.
    Thank you ppl =)

    First of all, what you are trying to do is transforming, not parsing. Parsing is converting an XML document into an internal form, and you already have the XML in the internal form (org.w3c.dom.Document).
    Anyway, XSLT has special rules for transforming a document whose root element's name is "html". It looks like those rules are being applied in your case. If you don't want them to be applied (which you don't if you are producing XHTML) then you have to tell the transformer you want XML as your output and not HTML.
    If you had an XSLT document you would use <xsl:output method="xml"/>, but you don't have one in this case. So you do it like this:
    transformer.setOutputProperty(OutputKeys.METHOD, "xml");

  • Using img tag with htmlText

    I'm trying to display images within mx:Text components using htmlText.  However, no matter what I try, I can't get an image to display.  The application just displays whitespace where the <img> tag is.  My current code looks something like:
                <mx:Text id="test_html" width="100%" height="100%">
                    <mx:htmlText>
                        <![CDATA[
                            <p>Why can't I include an image =(</p><img src='assets/add_icon.gif' width='20' height='20' align='left' hspace='10' vspace='10' />
                        ]]>
                    </mx:htmlText>
                </mx:Text>
    What I get displayed when I view this is:
    I've tried essentially every permutation that I can think of -- setting the htmlText in actionScript, using all different paths (app:/assets/add_icon.gif, ../assets/add_icon.gif, add_icon.gif, embedding the image and using {<classname>.addIcon}).  I have other images embedded in the application using the path "../assets/<image file>" and they work fine (they're not being used in htmlText).
    Has anyone had this kind of trouble before?  Any idea what might be going wrong?

    does anybody know anything? how long do i need to wait to see
    if someone replies? I just need to know if it is possible or not.

Maybe you are looking for

  • MacBook Pro 13" Hard Drive and other questions

    Hi there, I've just purchased a 13" MBP which I absolutely love but have a few questions about upgrading it. I want to swap out the hard drive for a larger capacity but just want to make sure I purchase one that will fit. I'll number the questions fo

  • Why can't I buy the new Iphone?

    Is anyone as ****** off as me that I cannot buy the new Iphone without paying $499? I purchased the first phone for $700, the second phone for $500 all on the day they came out. Now Apple will let anyone who didn't buy it before get it for $299 but I

  • ASA/Router Exec Authorization

    Hello Everyone, After a user is authenticated using  TACACS+, he/she must be authorized to access the IOS or ASA shell.  However, when i just configured authentication (without authorization),  the user can still access the level 15 shell after authe

  • Imac is completely locked up

    Our computer is completely locked up.  We have tried to shut it down completley by turning it off at the electrical source. but when rebooted, still has same pages on screen and cursor will not click on anything.  The box for preferred network appear

  • Unable to create files from FORMs6i Patch11

    Hi Frnds, I'm executing a stored procedure from the back-end to create an XML file.This is working fine with the back-end i.e. ORACLE10g. But when the stored procedure is executed within the FORMS then it executes without any error but the file is no