# Problem with Abstract Data Types

**URL:** <https://forum.kirupa.com/t/problem-with-abstract-data-types/258015>\
**Category:** flash\
**Created:** [April 19, 2008, 5:49pm UTC](https://forum.kirupa.com/t/problem-with-abstract-data-types/258015 "2008-04-19T17:49:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![lixus](https://avatars.discourse-cdn.com/v4/letter/l/9fc348/32.png) [@lixus](https://forum.kirupa.com/u/lixus)\
**Post date:** [April 19, 2008, 5:49pm UTC](https://forum.kirupa.com/t/problem-with-abstract-data-types/258015/1 "2008-04-19T17:49:41Z")

</div>

Hey everyone…  
I’m new to OOP with Actionscript, and i guess i understand the basics, but the following costed me half the day and i still don’t understand it:

I have two classes, Node.as and Player.as.

I have this public function in my Node class:

```auto
public function getName():String {
        return nodeName;
}

```

Now in the constructor of my Player class, i want to access this function:

```auto
public function Player(startNode:Node) {
        trace ("node: " + startNode.getName());
}

```

The interesting part of my main actionscript:

```auto
var q:Node = new Node("q", 150, 225);
var player:Player = new Player(q);

```

My constructor always traces “node: undefined”.

So did i make a stupid mistake somewhere or is it just not possible to use classes in this way?
