How would I go about appending (not just changing the entire text area to this img, actually appending at the end of the current text) a simple 25x25 image sprite into a Spark TextArea in a flex project? using actionscript?(not mxml so it can be added during run time) and It has to be a Spark TextArea because this is a Flex Mobile Project
I've read html text is the way to go about it. But my real confusion lies with first it being a Sprite, so i dont have a url to link to. It's an actual sprite var (it would be a file sent over the network in bytes, and saved in a sprite object.)
and then the second part where im lost is actually APPENDING the htmlText to the Spark TextArea inline, so it doesnt replace any of the text already in the text area, and will be scrollable in the text area.
also, remember im trying to append this to a SPARK TEXT AREA component. I know i could just make a text field instance and thats it, but i cant find any information about appending this to a text area
EDIT AGAIN: SInce there was some confusion about the sprite im trying to append, this is how the image is being transmitted,
it's starting out as just a standard cameraphone image, then..
var fs:FileStream = new FileStream();
fs.open(new File(imageURL), FileMode.READ);
var bytes:ByteArray = new ByteArray();
if (bytes == null)
trace("Image bytes is null!");
var message:Object = new Object();
message.type = "pic";
message.bytes = bytes;
Then i'm reciving it like this
var loaderContext:LoaderContext = new LoaderContext();
loaderContext.allowCodeImport = false;
var loader:Loader = new Loader();
// add a new sprite to hold image
imageSprite = new Sprite();
So then finally I have the image in imageSprite... and that brings us to my main problem appending this image in a SPARK TEXT AERA.
I'm looking for an end result that will have the look of a picture message sent on an android or iphone.
You want to copy and manipulate the TextFlow data structure that represents
the text. You will be able to add an InlineGraphicElement whose source
property points to your display object.
Do you know of any examples of doing this with a textArea?
No, but maybe you'll find an example of someone using an
InlineGraphicElement so you can see how that is done.