# If Statement

**URL:** <https://forum.kirupa.com/t/if-statement/159957>\
**Category:** Uncategorized\
**Created:** [August 22, 2005, 10:55am UTC](https://forum.kirupa.com/t/if-statement/159957 "2005-08-22T10:55:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![toast](https://avatars.discourse-cdn.com/v4/letter/t/6f9a4e/32.png) [@toast](https://forum.kirupa.com/u/toast)\
**Post date:** [August 22, 2005, 10:55am UTC](https://forum.kirupa.com/t/if-statement/159957/1 "2005-08-22T10:55:17Z")

</div>

Hi,

I’ve got a dynamic text field [var = NameLast] that is given a value when I an ASP page to call the database. When NameLast is equal to a certain value, I would like it to call a function that loads an image.

I’m sure this is simple, but I can’t seem to get it to work.

Here’s my code:

if (NameLast=“Smith”) {  
\_root.createEmptyMovieClip(“container”,2);  
loadMovie(“mag1.jpg”,“container”);  
container.\_x = 30 ;  
container.\_y = 30 ;  
}

Thanks.
