# Accessing variables

**URL:** <https://forum.kirupa.com/t/accessing-variables/231820>\
**Category:** flash\
**Created:** [July 8, 2007, 3:43pm UTC](https://forum.kirupa.com/t/accessing-variables/231820 "2007-07-08T15:43:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![superpeppe](https://avatars.discourse-cdn.com/v4/letter/s/a183cd/32.png) [@superpeppe](https://forum.kirupa.com/u/superpeppe)\
**Post date:** [July 8, 2007, 3:43pm UTC](https://forum.kirupa.com/t/accessing-variables/231820/1 "2007-07-08T15:43:17Z")

</div>

Hi

Lets say we have the following code in Main.as

```auto

package {
    import flash.display.Sprite;
    import Player;
    public class Main extends Sprite {
        public function Main() {
            public var deltaTime:uint;
            private var objPlayer:Player = new Player();
        }
    }
}

```

and the Player.as contains

```auto

package {
    import flash.display.Sprite;
    public class Player extends Sprite {
        public function Player() {
            x += 10*deltaTime;
        }
    }
}

```

But how do I access the deltaTime variable from Player function/Method?  
I have tried root.Main.deltaTime and more, but no one seems to work.

Thanks in advance
