# Weird coding

**URL:** <https://forum.kirupa.com/t/weird-coding/118670>\
**Category:** Uncategorized\
**Created:** [August 8, 2004, 12:58am UTC](https://forum.kirupa.com/t/weird-coding/118670 "2004-08-08T00:58:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![BirdMan](https://avatars.discourse-cdn.com/v4/letter/b/90ced4/32.png) [@BirdMan](https://forum.kirupa.com/u/BirdMan)\
**Post date:** [August 8, 2004, 12:58am UTC](https://forum.kirupa.com/t/weird-coding/118670/1 "2004-08-08T00:58:21Z")

</div>

i was doing a bluesfear tutorial on motion and there was this code that wasnt even in the list of scripts?  
waht does accelflag mean?  
onClipEvent (enterFrame) {  
if (this.\_rotation == 0) {  
rotateIncrement = .1;  
}  
if (rotateIncrement\<=1) {  
accelFlag = 1;  
}  
if (rotateIncrement\>30) {  
accelFlag = 0;  
}  
if (accelFlag == 1) {  
rotateIncrement = rotateIncrement\*1.1;  
}  
if (accelFlag == 0) {  
rotateIncrement = .1;  
}  
this.\_rotation += rotateIncrement;  
}  
how did he get it to work with a code that is not even in the list?

---

<div class="post-metadata">

**Author:** ![Skribble](https://avatars.discourse-cdn.com/v4/letter/s/b487fb/32.png) [@Skribble](https://forum.kirupa.com/u/Skribble)\
**Post date:** [August 8, 2004, 2:21am UTC](https://forum.kirupa.com/t/weird-coding/118670/2 "2004-08-08T02:21:09Z")

</div>

accelFlag is a variable. a variable can be any name u want

number = 5;

enemy = jumping;

character = dying;

---

<div class="post-metadata">

**Author:** ![BirdMan](https://avatars.discourse-cdn.com/v4/letter/b/90ced4/32.png) [@BirdMan](https://forum.kirupa.com/u/BirdMan)\
**Post date:** [August 8, 2004, 3:15pm UTC](https://forum.kirupa.com/t/weird-coding/118670/3 "2004-08-08T15:15:35Z")

</div>

how do u insert and when do u insert a var?

---

<div class="post-metadata">

**Author:** ![lastchance](https://avatars.discourse-cdn.com/v4/letter/l/f04885/32.png) [@lastchance](https://forum.kirupa.com/u/lastchance)\
**Post date:** [August 8, 2004, 4:24pm UTC](https://forum.kirupa.com/t/weird-coding/118670/4 "2004-08-08T16:24:10Z")

</div>

Once you create a variable, you can call it at anytime during you movie. Lets say your making a game and you want your character to have 100 coins… you would do something like…

```auto
  
var coins:Number = 100;

```

now you have created temorary information. So wheneva you call ‘coins’ in your script the 100 value is returned. Lets say you have a dynamic text box where you want the characters amount of money to be displayed. You can call on the coin variable. Say the money display box is called moneyLeft\_txt…

```auto

moneyLeft_txt.text = coins;

```

now in the money left box will be the number 100 as that is what the variable coins contains.

---

<div class="post-metadata">

**Author:** ![BirdMan](https://avatars.discourse-cdn.com/v4/letter/b/90ced4/32.png) [@BirdMan](https://forum.kirupa.com/u/BirdMan)\
**Post date:** [August 9, 2004, 3:02am UTC](https://forum.kirupa.com/t/weird-coding/118670/5 "2004-08-09T03:02:08Z")

</div>

i dont get how it reads it though  
thx for the hhelp
