# AS3 Question - display an image from a string in a variable

**URL:** <https://forum.kirupa.com/t/as3-question-display-an-image-from-a-string-in-a-variable/309213>\
**Category:** flash\
**Created:** [May 10, 2010, 8:00am UTC](https://forum.kirupa.com/t/as3-question-display-an-image-from-a-string-in-a-variable/309213 "2010-05-10T08:00:06Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TomKub](https://avatars.discourse-cdn.com/v4/letter/t/85f322/32.png) [@TomKub](https://forum.kirupa.com/u/TomKub)\
**Post date:** [May 10, 2010, 8:00am UTC](https://forum.kirupa.com/t/as3-question-display-an-image-from-a-string-in-a-variable/309213/1 "2010-05-10T08:00:06Z")

</div>

_solved using htmlText with a textField_

Hi, quick question hoping someone may have an idea on how to achieve this.

I have this variable

var userPicLoc:String = “[http://tinyurl.com/2qk25q](http://tinyurl.com/2qk25q)”;

I would like to display this using AS3 in a movieclip used as a user pic when a user logs in. I do not want to load an actual image, but want to use the actual URL as the source for what is displayed.

In Flex, you are able to create a Label and make its Source a variable containing a URL String like the one above. It looks something like this:

\<mx:Image id=“userImg” source="{userPicLoc}"  
width=“50” height=“50” includeIn=“logout”/\>

I would like to do this in AS3 but I am not sure the best way to go about this, or if there is some easy way to do this.

Thanks in advance for any help!

TomKub
