# Help on basic variable

**URL:** https://forum.kirupa.com/t/help-on-basic-variable/301551
**Category:** Uncategorized
**Created:** [December 11, 2009, 4:31am UTC](https://forum.kirupa.com/t/help-on-basic-variable/301551 "2009-12-11T04:31:09Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![kitchie](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/kitchie/32/103_2.png) [@kitchie](https://forum.kirupa.com/u/kitchie)
#### Post date: [December 11, 2009, 4:31am UTC](https://forum.kirupa.com/t/help-on-basic-variable/301551/1 "2009-12-11T04:31:09Z")

</div>

sorry i only know AS2, and was not doing actionscript for a while. i can’t pass the variable to the object, please check what’s wrong with my script. i want to put a variable after the obj. so when it randomize, it pass the random number after the obj.  
Thanks in advance

obj1.\_visible = false;  
obj2.\_visible = false;  
function reveal() {  
var randomNumber = random(2)+1;  
obj[randomNumber].\_visible = true;  
}
