# Class & Variable Reference

**URL:** <https://forum.kirupa.com/t/class-variable-reference/272455>\
**Category:** flash\
**Created:** [October 5, 2008, 2:56pm UTC](https://forum.kirupa.com/t/class-variable-reference/272455 "2008-10-05T14:56:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gphilly77](https://avatars.discourse-cdn.com/v4/letter/g/5e9695/32.png) [@gphilly77](https://forum.kirupa.com/u/gphilly77)\
**Post date:** [October 5, 2008, 2:56pm UTC](https://forum.kirupa.com/t/class-variable-reference/272455/1 "2008-10-05T14:56:33Z")

</div>

I’m new to AS 3 and had a quick question about referencing a class variable value from another class.

Basically I have two classes. The one below inits a new class

public class ConfigureTripDesigner extends MovieClip  
{  
//public constructor//  
public function ConfigureTripDesigner()  
{  
var tripSelector:TripSelector = new TripSelector();  
trace(tripSelector.isSelectionComplete);  
}  
}

public class TripSelector extends MovieClip  
{  
var isSelectionComplete:Boolean = false;  
//public constructor//  
public function TripSelector ()  
{  
changeVariable();  
}  
function changeVariable():void  
{  
isSelectionComplete = true;  
}  
}

If I run a trace for the isSelectionComplete variable from the TripSelector class, I can see the value change from false to true.

However, if I trace isSelectionComplete from the TripSelector class the value is always true.

What gives? Thanks for the help, as I mentioned I’m a bit new to the OOP world and AS 3.

Thanks…GP
