# Changing opacity based on external variable value - possible?

**URL:** <https://forum.kirupa.com/t/changing-opacity-based-on-external-variable-value-possible/226858>\
**Category:** flash\
**Created:** [May 24, 2007, 4:28pm UTC](https://forum.kirupa.com/t/changing-opacity-based-on-external-variable-value-possible/226858 "2007-05-24T16:28:03Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tmccann](https://avatars.discourse-cdn.com/v4/letter/t/85e7bf/32.png) [@tmccann](https://forum.kirupa.com/u/tmccann)\
**Post date:** [May 24, 2007, 4:28pm UTC](https://forum.kirupa.com/t/changing-opacity-based-on-external-variable-value-possible/226858/1 "2007-05-24T16:28:03Z")

</div>

I am a newbie to actionscript so please help me. :crying: The is for an interactive community map. The goal is the change the opacity of the lot buttons based on if the variable loaded from a text file is defined as “AVAILABLE” or “SOLD”. There will be 800 or so lots so making this very simple is important. Here is what i have tried so far but of course it is not working:

[COLOR=DarkRed]loadVariables(“lots001\_100.txt”,"\_root");  
onEnterFrame = function() {  
\_root.lotavailability = lot001availability;  
if (\_root.lot001availability == AVAILABLE) {  
\_root.currentlots.setProperty(“lot001”, \_alpha, 50);  
} else {  
\_root.currentlots.setProperty(“lot001”, \_alpha, 0);  
}  
}[/COLOR]

lotavailability is a dynamic text field loading the variable lot001availability = this works  
currentlots is the instance name of a mc holding all of the lots (buttons)  
lot001 is the instance name of the button I’m trying to change the \_alpha of.

Each lot will have a variable named lot002availability, lot003availability, etc… and there will be either “SOLD” or “AVAILABLE” as the value of the variable.

In my mind this should work but it’s not. What am I missing? Can this even be done?
