0 Replies Latest reply on Mar 22, 2009 12:07 PM by wision

    text editor - insert a picture into html code

    wision Level 1
      Hi Adobe!

      I've a great problem! I make a text editor in Flash (AS2) and I want to have a possibility of adding a picture into the HTML text. How can I do it?
      For example: the URL-add button code is the next:

      butURL.onRelease = function() {
      tfm = richArea.getTextFormat(selstart, selend);
      tfm.url= URLinput;
      tfm.target= "_blank";
      tfm.underline = true;
      richArea.setTextFormat(selstart, selend, tfm);
      mtfm.url= URLinput;
      mtfm.target= "_blank";
      mtfm.underline = true;

      where 'selstart' and 'selend' is the start end the end of the selected area in the text, 'richArea' is the name of the HTML textfield. So I' ve a button for BOLD, ITALIC, UNDERLINED, etc.
      My question is: how can I add a picture into the text? I try the next code, but doesn't work:

      butPIC.onRelease = function() {
      tfm = richArea.getTextFormat(selstart, selend);
      PICinput = "house.gif";
      PICinputki = "<IMG SRC=\"" + PICinput + "\">";
      tfm.htmlText = PICinputki;
      richArea.setTextFormat(selstart, selend, tfm);
      mtfm.htmlText = PICinputki; }

      Thank you for the answer(s), WISION