# LoadVars - Write to server

**URL:** <https://forum.kirupa.com/t/loadvars-write-to-server/669>\
**Category:** flash\
**Created:** [July 25, 2002, 10:29am UTC](https://forum.kirupa.com/t/loadvars-write-to-server/669 "2002-07-25T10:29:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![puma](https://avatars.discourse-cdn.com/v4/letter/p/ed8c4c/32.png) [@puma](https://forum.kirupa.com/u/puma)\
**Post date:** [July 25, 2002, 10:29am UTC](https://forum.kirupa.com/t/loadvars-write-to-server/669/1 "2002-07-25T10:29:35Z")

</div>

i’d like to program a film that can communicate with an other client.

so its necessary to write sth to the server. (and after that to read that information by the other clients)

but i dont get that first problem to solve. here my .fla and .php file. why doesnt it work?

source in flash:

on (release) {  
\_root.mybutton.onRelease = function() {  
var c = new LoadVars();  
c.datenstring = “test”;  
c.send(“writer.php”);  
stop();  
};  
}

thx 4 any help  
puma

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 25, 2002, 10:56am UTC](https://forum.kirupa.com/t/loadvars-write-to-server/669/2 "2002-07-25T10:56:29Z")

</div>

Start by changing your script to

```auto
on (release) {
	var c = new LoadVars();
	c.datenstring = "test";
	c.send("writer.php");
	stop();
}

```

Because you were assigning a onPress event to the button when you pressed it…  
Did you try to simply echo the variable on the PHP side?

pom :asian:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 25, 2002, 11:42am UTC](https://forum.kirupa.com/t/loadvars-write-to-server/669/3 "2002-07-25T11:42:35Z")

</div>

oh yes, of course!!! i that way it’s working on the 2nd mouse click.

well i’ve edited it. thanks for your answer.

but it doesnt work well. nothing happens with:  
c.send(“writer.php”);

but writer.php writes the file with:  
c.send(“writer.php”, this);

but i dont want to open a new window, and thats what happens with that ‘this’.

puma

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 25, 2002, 1:35pm UTC](https://forum.kirupa.com/t/loadvars-write-to-server/669/4 "2002-07-25T13:35:57Z")

</div>

I honnestly have 0 idea. Sorry.

pom :asian:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 25, 2002, 3:57pm UTC](https://forum.kirupa.com/t/loadvars-write-to-server/669/5 "2002-07-25T15:57:47Z")

</div>

thx 4 your honesty 😉

well, i’ve found an alternative with loadVariables.

writing works fine, but not reading… thats strange. could you have a look?

puma

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [July 29, 2002, 10:07am UTC](https://forum.kirupa.com/t/loadvars-write-to-server/669/6 "2002-07-29T10:07:47Z")

</div>

Having the same kind of problems but I’m trying to use Perl.This may help you for your php stuff.

[http://actionscript-toolbox.com/samplemx\_loadvars.php](http://actionscript-toolbox.com/samplemx_loadvars.php)

Hope it helps.🙂
