How to simply add a sprite to a text area?

How do I go about adding (not just changing the entire text area to this img, actually adding) a simple sprite of 25x25 images to the text area in the flex project? using actionscript? (not mxml)

(it should be a component of the spark text area, mainly because it is a flexible mobile project and everything that is optimized for mobile devices)

edit: I guess I should have said this, I know that html text is a way to go about this. But my real confusion is that it is Sprite first, so I have no link to the link. This is the actual sprite var (this will be a file sent over the network in bytes and stored in the sprite object.), And then the second part, where im lost, Takes it into a text file, so it does not replace any text already in text area and will scroll in the text area.

also remember that i am trying to add this to the SPARK TEXT AREA component. I know that I can simply create an instance of a text field, but it is not, but I cannot find any information about adding this to the text area.

EDIT AGAIN: SInce there was some confusion that the sprite im trying to add, so the image is transmitted,

, ..

var fs:FileStream = new FileStream();
fs.open(new File(imageURL), FileMode.READ);
var bytes:ByteArray = new ByteArray();
fs.readBytes(bytes);
fs.close();
if (bytes == null) 
{
    trace("Image bytes is null!");

} 
else 
{
    var message:Object = new Object();
    message.type = "pic";
    message.bytes = bytes;
    netGroup.post(message);
    trace("Picture sent!");
}

var loaderContext:LoaderContext = new LoaderContext();
loaderContext.allowCodeImport = false;
var loader:Loader = new Loader();
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onPicLoaded,false,0,true);
loader.loadBytes(message.bytes, loaderContext);
// add a new sprite to hold image
imageSprite = new Sprite();
imageSprite.addChild(loader);

, , imageSprite... , TEXT AERA. , , iphone.

+5
4

, . , ( ), "" . , , TextField, BitmapImage, TextField BitmapImage.

:

  • , TextField BitmapImage.
  • , KeyUp, , TextField. TextField, TextField . BitmapImage, BitmapImage, TextField TextField, BitmapImage
  • . , .

, TextField "emoticon". , , , , .

+1

- htmlText. , , .:)

import flash.text.TextField;

var TF:TextField = new TextField();
this.TF.width = 200;
this.TF.height = 200;
this.TF.htmlText="Image in textfield: <img src='http://upload.pusha.se/3/HittaTidning_75.jpg' hspace='0' vspace='0'>";

this.addChild(this.TF);
0

, , .

, ?

" , , , URL-. , . RichEditableText."

RichText http://docs.huihoo.com/flex/4/spark/components/RichText.html

RichEditableText http://docs.huihoo.com/flex/4/spark/components/RichEditableText.html


flex, , , ? , , - , ...

<s:RichEditableText id="richTxt" textAlign="justify" width="100%">
            <s:textFlow>
                <s:TextFlow>
                    <s:p>
                        <s:img source="@Embed(source='../assets/butterfly.gif')" height="100" width="100"/>
                    </s:p>
                </s:TextFlow>
            </s:textFlow>
        </s:RichEditableText>

: TLF

0

All Articles