# Why doesnt this code work?

**URL:** <https://forum.kirupa.com/t/why-doesnt-this-code-work/283605>\
**Category:** flash\
**Created:** [March 9, 2009, 3:00am UTC](https://forum.kirupa.com/t/why-doesnt-this-code-work/283605 "2009-03-09T03:00:11Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![helpflash0](https://avatars.discourse-cdn.com/v4/letter/h/ecae2f/32.png) [@helpflash0](https://forum.kirupa.com/u/helpflash0)\
**Post date:** [March 9, 2009, 3:00am UTC](https://forum.kirupa.com/t/why-doesnt-this-code-work/283605/1 "2009-03-09T03:00:11Z")

</div>

ok i am using as2 and zinc 3.0

Can anyone tell me why these codes are different?

I have 2 textboxes and a button all on the same frame on the same layer.

called sendAnswer, box1.text and box2.text.

This code doesnt work. it saves the txt file as var1=&var2=

```auto
var myFile = mdm.Application.path+"text2.txt";
var var1 = box1.text
var var2 = box2.text
var myString:String = "var1="+var1+"&var2="+var2;
sendAnswer.onRelease = function() {
mdm.FileSystem.saveFile(myFile, myString)};

```

but this code works.

```auto
var myFile = mdm.Application.path+"text2working.txt";
 
sendAnswer.onRelease = function() {
mdm.FileSystem.saveFile(myFile, box1.text+"|"+box2.text)};

```

What am i doing wrong with the string?

Also if someone could tell me how to load it back into the same textboxes that would help as well.
