# Passing the timeline to a class

**URL:** <https://forum.kirupa.com/t/passing-the-timeline-to-a-class/296544>\
**Category:** flash\
**Created:** [September 16, 2009, 11:14am UTC](https://forum.kirupa.com/t/passing-the-timeline-to-a-class/296544 "2009-09-16T11:14:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Extrakun](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/extrakun/32/2008_2.png) [@Extrakun](https://forum.kirupa.com/u/Extrakun)\
**Post date:** [September 16, 2009, 11:14am UTC](https://forum.kirupa.com/t/passing-the-timeline-to-a-class/296544/1 "2009-09-16T11:14:07Z")

</div>

Suppose I have the following class

```auto
package {

    import flash.display.Stage;

    public class CustomObject {

        private var stage:Stage;

        public function CustomObject(stageRef:Stage) {

            // stage access through
            // constructor argument
            stage = stageRef;
        }
    }
}

```

Which is not a document class. I wish to pass the stage of the main timeline into the class, say on frame 1

```auto
stop();
var c:CustomObject = new CustomObject(this.stage);

```

Is this the right way of passing the stage of the main timeline into another class?
