# Text Field problem - URGENT

**URL:** <https://forum.kirupa.com/t/text-field-problem-urgent/111159>\
**Category:** Uncategorized\
**Created:** [May 24, 2004, 11:00am UTC](https://forum.kirupa.com/t/text-field-problem-urgent/111159 "2004-05-24T11:00:10Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Germaris](https://avatars.discourse-cdn.com/v4/letter/g/8797f3/32.png) [@Germaris](https://forum.kirupa.com/u/Germaris)\
**Post date:** [May 24, 2004, 11:00am UTC](https://forum.kirupa.com/t/text-field-problem-urgent/111159/1 "2004-05-24T11:00:10Z")

</div>

Hi there!

In my file, the search engine I built (which runs perfectly!) may return, amongst other variables, one called ‘mySearch.courriel’ which is an Email address. This variable populates a dynamic Text Field named ‘Srecipient’. Everything occurred at \_root Level. My file has no Scenes, navigation goes through Labels only.

I have a Movie Clip named ‘TOMAIL’ in which there is two frames : Frame 1 is empty, Frame 2 contains a button named ‘mailBtn’ which purpose is… to send an Email ! :-). Of course, each Frame has a ‘stop;’.

My goal is quite simple. When my Search engine does not return any Email Address (‘mySearch.courriel’ is null), ‘TOMAIL’ stays on its first frame and, of course, ‘mailBtn’ is not accessible and you can’t send an Email. On the other hand, when my Search engine returns an Email Address (‘mySearch.courriel’ is not null and a string exists), ‘TOMAIL’ goes to its second frame, ‘mailBtn’ is accessible and you can use it to send an Email to the address contained in ‘Srecipient’.

I unsuccessfully tried, in the Actions Layer Frame where ‘Srecipient’ and ‘TOMAIL’ are located to run the following script:

```auto

Srecipient.addListener(TOMAIL) 
Srecipient.onChanged(text.length>1); 
function() { 
if (onChanged = true) { 
_root.TOMAIL.gotoAndStop(2); 
} else { 
_root.TOMAIL.gotoAndStop(1); 
}
}
stop(); 

```

Who could tell me what’s wrong in my script and how to write an efficient one? You can ask me for any precision you may need, don’t be shy!

Thousands of thanks in advance!

Gerard
