# Basic stuff

**URL:** <https://forum.kirupa.com/t/basic-stuff/852>\
**Category:** Uncategorized\
**Created:** [July 31, 2002, 10:31pm UTC](https://forum.kirupa.com/t/basic-stuff/852 "2002-07-31T22:31:06Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![fazal](https://avatars.discourse-cdn.com/v4/letter/f/ed655f/32.png) [@fazal](https://forum.kirupa.com/u/fazal)\
**Post date:** [July 31, 2002, 10:31pm UTC](https://forum.kirupa.com/t/basic-stuff/852/1 "2002-07-31T22:31:06Z")

</div>

basic stuff

hey, im really new to actionscripting

im experimenting for stuff, trying to get a good feel of actionscript.

i’m stuck on this d=rt calculator im trying to make.

here is the code i put into the first frame:

function Formula (t, d) {  
this.time = t;  
this.distance = d;  
this.getSpeed = function(){return this.time / this.distance}  
}

i have an input text field, and its variable is t

i have a button which is supposed to submit what you type in to the text field. the code for it is:

on (release) {  
setProperty(" \_root.Formula", \_time, t)  
}

there is an error in the code for the button. this is the error the debugger gives me:

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 2: Property name expected in GetProperty.  
setProperty(" \_root.Formula", \_time, t)

what am i doing wrong?  
i have been trying to figure this out, and i cant…  
thanks  
=) =) =)

---

<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:** [August 1, 2002, 12:03am UTC](https://forum.kirupa.com/t/basic-stuff/852/2 "2002-08-01T00:03:03Z")

</div>

Try using this code instead, it might make things more easy for you. Give your textfield an instance name

on(release){  
\_root.holdtext.onChanged = function(){  
}

this reacts with whatever you enter or type into the textfield. You can then add your own actions after this.

Hope this helps.

Kyle

---

<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:** [August 1, 2002, 1:45pm UTC](https://forum.kirupa.com/t/basic-stuff/852/3 "2002-08-01T13:45:53Z")

</div>

thanks! ill try that  
:cool:

---

<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:** [August 1, 2002, 3:06pm UTC](https://forum.kirupa.com/t/basic-stuff/852/4 "2002-08-01T15:06:26Z")

</div>

hmm… won’t that invoke the Onchange everytime you press a key inside of the input box?

---

<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:** [August 1, 2002, 6:14pm UTC](https://forum.kirupa.com/t/basic-stuff/852/5 "2002-08-01T18:14:00Z")

</div>

```auto
on (release) {
setProperty(" _root.Formula", _time, t)
}

```

is equivalent to

```auto
on (release) {_root.Formula._time=t;}

```

Flash 4 syntax…

Anyway, there’s no \_time property in the object Formula, and there is no Formula object to start with.

Try that

```auto
on (release){_root.Formula(t,d);}

```

but your textboxes have to be called ‘t’ and ‘d’.

pom :asian:
