# Javascript and flash mx

**URL:** <https://forum.kirupa.com/t/javascript-and-flash-mx/6522>\
**Category:** Uncategorized\
**Created:** [October 9, 2002, 4:20pm UTC](https://forum.kirupa.com/t/javascript-and-flash-mx/6522 "2002-10-09T16:20:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pelegk1](https://avatars.discourse-cdn.com/v4/letter/p/9dc877/32.png) [@pelegk1](https://forum.kirupa.com/u/pelegk1)\
**Post date:** [October 9, 2002, 4:20pm UTC](https://forum.kirupa.com/t/javascript-and-flash-mx/6522/1 "2002-10-09T16:20:05Z")

</div>

i am trying to get values from an html page by using a javascript function!  
i have made a butoon with the code :  
on (release) {  
getURL(“javascript:changeText()”);  
myTxt.text=gUserID;  
}

and in the html page i made a java script function :

\<SCRIPT LANGUAGE=“JavaScript”\>  
function changeText() {  
window.document.js.SetVariable(“gUserID”, “111”);

}

but what happens is that i get the value “111” only after i press the button twice!!! and not once!  
why is that?  
what can i do to make it work?  
Thanks in advace  
Peleg
