# Talking between Classes

**URL:** <https://forum.kirupa.com/t/talking-between-classes/226717>\
**Category:** flash\
**Created:** [May 23, 2007, 1:19pm UTC](https://forum.kirupa.com/t/talking-between-classes/226717 "2007-05-23T13:19:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Wedge\_Man](https://avatars.discourse-cdn.com/v4/letter/w/f07891/32.png) [@Wedge\_Man](https://forum.kirupa.com/u/Wedge_Man)\
**Post date:** [May 23, 2007, 1:19pm UTC](https://forum.kirupa.com/t/talking-between-classes/226717/1 "2007-05-23T13:19:44Z")

</div>

Hey Guys,

I’m hoping you can help me out with either a method or maybe I just need a better understanding to wrap my head around.

I’ve been building Flash programs with classes for years now but I’ve always only been able to talk “down” the heirarchy. If i wanted to talk “up” then I just referenced the root.

For example (OLD WAY AS2.0 days)

```auto
 
class Main_Program {

 [INDENT]var myList:Array; [/INDENT]

[INDENT]var otherList:Second_Class;[/INDENT]

[INDENT]function Main_Program() {[/INDENT]

[INDENT][INDENT]otherlist = new Second_Class();[/INDENT]

[INDENT]myList = [global values that all classes should use];[/INDENT]

[/INDENT][INDENT]}[/INDENT]
 

[INDENT]function talkDown() {[INDENT]//talking "down" to the class to use it's functions.[/INDENT]

[INDENT]otherList.sendData();[/INDENT]
}

[/INDENT]}

```

And then for the Second\_Class in order to talk “up” i’d do something like this.

```auto
 

class Second_Class {[INDENT]function talkUp() {[INDENT]//talking "up" to the Main_Program class by referencing the root.[/INDENT]

[INDENT]var usingGlobalValue = _root.mainProgram.myList[0];[/INDENT]
}

[/INDENT]}

```

So my question is this, in AS3.0 the only way i can “talk” up, is if i pass the value to the function which needless to say is very cumbersome and annoying.

What should I be doing to communicate between classes?

Thanks!
