# How to simplify this code?

**URL:** https://forum.kirupa.com/t/how-to-simplify-this-code/13795
**Category:** Uncategorized
**Created:** [February 18, 2003, 6:43am UTC](https://forum.kirupa.com/t/how-to-simplify-this-code/13795 "2003-02-18T06:43:20Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![thybalt](https://avatars.discourse-cdn.com/v4/letter/t/e5b9ba/32.png) [@thybalt](https://forum.kirupa.com/u/thybalt)
#### Post date: [February 18, 2003, 6:43am UTC](https://forum.kirupa.com/t/how-to-simplify-this-code/13795/1 "2003-02-18T06:43:20Z")

</div>

hi guys whats the correct way to simplify this into 1 line?

* * *

## \_root.tutorial-=1; \_root.tutorial+=“t”;

basically i have this variable called tutorial which is a int.  
lets say \_root.tutorial=4;

I want it to decrease by 1 and then concat a letter ‘t’ to it, thus changing it into a string.

The above code works but when i change it to:

* * *

## \_root.tutorial-=1+“t”;

i get some funny value.

btw just to be sure, flash automatically converts between data types right? if not, how do i convert ints to strs and vice versa?

Int.parseInt(variable); ???  
Int.(variable); ???

I need answers!

Thank you=)

---

<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: [February 18, 2003, 8:59am UTC](https://forum.kirupa.com/t/how-to-simplify-this-code/13795/2 "2003-02-18T08:59:50Z")

</div>

i’d try: eval(\_root.tut -=1) add “t”;  
untested though…

---

<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: [February 18, 2003, 10:36am UTC](https://forum.kirupa.com/t/how-to-simplify-this-code/13795/3 "2003-02-18T10:36:53Z")

</div>

thanks man i’ll try it later:eye:

---

<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: [February 18, 2003, 10:49am UTC](https://forum.kirupa.com/t/how-to-simplify-this-code/13795/4 "2003-02-18T10:49:44Z")

</div>

you can certainly do it in one line but not with a -= or a += operator and not without reusing the variable name

\_root.tutorial = \_root.tutorial - 1 + “t”;

---

<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: [February 18, 2003, 12:54pm UTC](https://forum.kirupa.com/t/how-to-simplify-this-code/13795/5 "2003-02-18T12:54:40Z")

</div>

thanks everyone 😏

---

<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: [February 18, 2003, 4:01pm UTC](https://forum.kirupa.com/t/how-to-simplify-this-code/13795/6 "2003-02-18T16:01:25Z")

</div>

hey thybalt i was checking out yer liquid design and was wondering what font do u use for your text?

---

<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: [February 19, 2003, 12:48am UTC](https://forum.kirupa.com/t/how-to-simplify-this-code/13795/7 "2003-02-19T00:48:21Z")

</div>

It’s hooch and you can d/l it here  
[http://www.flashkit.com/fonts/H/hooge-hoogeAut-1200/index.php](http://www.flashkit.com/fonts/H/hooge-hoogeAut-1200/index.php)

cheers :goatee:
