1 Reply Latest reply on Mar 31, 2008 1:27 PM by davidortinau

    Display <img> in TextField from remote domain

    davidortinau
      The goal: display an image in a TextField from an external domain. In context, the image is part of a weather feed from an MSN RSS.

      The following code works in Flash Player 9 with AS 3.0, but not in AIR. I've been reading up on security in LiveDocs and elsewhere giving me nothing more than a headache.

      I don't have to use a TextField...I'd use a Lable or a TextArea or a FlibbertyGidget if it'd show the stinking image and not silently bow out with a security error.

      Any assistance is much appreciated. I'm working in Flash CS3.

      Dave

      import fl.controls.TextField;

      var tf:TextField = new TextField();
      tf.multiline = true;
      tf.border = true;
      tf.borderColor = 0x000000;
      tf.width = 250;
      tf.height = 200;
      tf.x = 5;
      tf.y = 5;
      tf.htmlText = "IMAGE:<br>" + "<img src=\" http://blst.msn.com/as/wea3/i/en-us/law/28.gif\">";

      var format:TextFormat = new TextFormat();
      format.font = "Verdana";
      format.color = 0xFF0000;
      format.size = 10;
      format.underline = true;

      tf.defaultTextFormat = format;
      addChild(tf);