# Testing Value of Variable

**URL:** <https://forum.kirupa.com/t/testing-value-of-variable/187249>\
**Category:** flash\
**Created:** [April 27, 2006, 7:27pm UTC](https://forum.kirupa.com/t/testing-value-of-variable/187249 "2006-04-27T19:27:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jflint](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/jflint/32/2115_2.png) [@jflint](https://forum.kirupa.com/u/jflint)\
**Post date:** [April 27, 2006, 7:27pm UTC](https://forum.kirupa.com/t/testing-value-of-variable/187249/1 "2006-04-27T19:27:05Z")

</div>

[FONT=Arial][SIZE=2]I am loading contents of a text file into a variable in my flash movie (this is a hybrid director/flash app - the director loads the contents of a text file into a variable in the flash movie).[/SIZE][/FONT]

[FONT=Arial][SIZE=2]How would I test that variable to see if it is empty?[/SIZE][/FONT]

[FONT=Arial][SIZE=2]I am wanting to write a chunk of code so that if the variable has nothing in it, the movie jumps to a certain marker. Here is what I have so far:[/SIZE][/FONT]

```auto
if (variablename == "") {
     gotoAndPlay ("marker2")
 } else {
     gotoAndPlay ("marker1")
 }
 

```

[SIZE=2][FONT=Arial]

Am I on the right track? The textfield that is the variable sits at the root level, and I am testing it from a movie clip, so should i make it \_root.variablename?  
[/FONT][/SIZE]
