# Change \_global variables to \_global array?

**URL:** <https://forum.kirupa.com/t/change--global-variables-to--global-array/80562>\
**Category:** flash\
**Created:** [February 23, 2005, 1:56am UTC](https://forum.kirupa.com/t/change--global-variables-to--global-array/80562 "2005-02-23T01:56:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![earph](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/earph/32/79_2.png) [@earph](https://forum.kirupa.com/u/earph)\
**Post date:** [February 23, 2005, 1:56am UTC](https://forum.kirupa.com/t/change--global-variables-to--global-array/80562/1 "2005-02-23T01:56:42Z")

</div>

I’m having a problem with conflicting \_global variables and was told that an array may solve my problem. I need to convert the code below to an array, but I’m a newbie when it comes to \_global arrays.

How can I convert this?

> 

//ROLLOVER  
/////////////////////////////////////////////

on (rollOver) { this.button2 = true; }  
on (rollOut) { this.button2 = false; }

//SETS BUTTON OVER STATES  
/////////////////////////////////////////////

on(press) {  
for (var i in \_global) delete \_global\*;  
\_global.button2\_on = true; }

// ROLLOVER FUNCTION (First Frame of MC)  
/////////////////////////////////////////////////

this.onEnterFrame = function() {

if (button2) {  
this.gotoAndStop(9);  
\_global.main\_over = true;  
} else {  
this.prevFrame();  
}

if (button2\_on) {  
this.gotoAndStop(9);  
\_global.main\_on = true;  
}  
};

Here’s an example of the menu: [www.earph.com/test.html](http://www.earph.com/test.html)
