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:
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