# Passing Variables Class and function

**URL:** <https://forum.kirupa.com/t/passing-variables-class-and-function/178249>\
**Category:** flash\
**Created:** [February 8, 2006, 8:41pm UTC](https://forum.kirupa.com/t/passing-variables-class-and-function/178249 "2006-02-08T20:41:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lamoose](https://avatars.discourse-cdn.com/v4/letter/l/8797f3/32.png) [@lamoose](https://forum.kirupa.com/u/lamoose)\
**Post date:** [February 8, 2006, 8:41pm UTC](https://forum.kirupa.com/t/passing-variables-class-and-function/178249/1 "2006-02-08T20:41:42Z")

</div>

ok, I’m still learning all this and can’t seem to figure out when I have access to my variables. I have the the follow code:

class Slider {  
var myVar = 4;

function Slider () {

var myVar = 6;  
}

function findValue () {  
trace (myVar);  
}  
}

The slider function is being called first to update the myVar value then the findValue function is called. How do I get the find Value function to output 6 ?

I want a function that updates the main classes’ variable so thet I can use it from any function. Any help??
