# Define Tweener in the document class

**URL:** <https://forum.kirupa.com/t/define-tweener-in-the-document-class/260665>\
**Category:** flash\
**Created:** [May 18, 2008, 1:31pm UTC](https://forum.kirupa.com/t/define-tweener-in-the-document-class/260665 "2008-05-18T13:31:56Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![MistaMoves](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@MistaMoves](https://forum.kirupa.com/u/MistaMoves)\
**Post date:** [May 18, 2008, 1:31pm UTC](https://forum.kirupa.com/t/define-tweener-in-the-document-class/260665/1 "2008-05-18T13:31:56Z")

</div>

I have a movieclip on stage with instance name top\_mc.

This is the code I want to apply to it:  
Tweener.addTween(top\_mc, {x:726, y:30, time:0.8, transition:“easeInOutCirc”, delay:0.1});

Can’t do it on stage! need to define it in the document class…

Can somewone give me the right code?

thanks

---

<div class="post-metadata">

**Author:** ![Groady](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/groady/32/3750_2.png) [@Groady](https://forum.kirupa.com/u/Groady)\
**Post date:** [May 19, 2008, 10:36am UTC](https://forum.kirupa.com/t/define-tweener-in-the-document-class/260665/2 "2008-05-19T10:36:52Z")

</div>

Assuming your code is on frame 1 of the timeline and your movieclip is on the stage with an instance name of top\_mc it will work. Dont forget you need to import the Tweener class before it will work.

```auto
import caurina.transitions.Tweener;

```

---

<div class="post-metadata">

**Author:** ![MistaMoves](https://avatars.discourse-cdn.com/v4/letter/m/f08c70/32.png) [@MistaMoves](https://forum.kirupa.com/u/MistaMoves)\
**Post date:** [May 19, 2008, 7:54pm UTC](https://forum.kirupa.com/t/define-tweener-in-the-document-class/260665/3 "2008-05-19T19:54:20Z")

</div>

No, I started writing the code for my movieclip in the main timeline and it worked good.  
By when I started to write some code in the document class (fileReference…) the main timeline code can’t trigger the Movieclips anymore. so I want to learn how to define them in the Doc. Class. And I haven’t found a good tutorial so far…

thanks.

---

<div class="post-metadata">

**Author:** ![tpspoons](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@tpspoons](https://forum.kirupa.com/u/tpspoons)\
**Post date:** [May 19, 2008, 8:10pm UTC](https://forum.kirupa.com/t/define-tweener-in-the-document-class/260665/4 "2008-05-19T20:10:40Z")

</div>

When you include a document class, it acts as the timeline. If your using a document class you should remove all code and movie clips from your main timeline.

Edit: Senocular has a good post about it: [http://www.kirupa.com/forum/showpost.php?p=1950401&postcount=209](http://www.kirupa.com/forum/showpost.php?p=1950401&postcount=209)

---

<div class="post-metadata">

**Author:** ![McGuffin](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mcguffin/32/408_2.png) [@McGuffin](https://forum.kirupa.com/u/McGuffin)\
**Post date:** [May 19, 2008, 8:18pm UTC](https://forum.kirupa.com/t/define-tweener-in-the-document-class/260665/5 "2008-05-19T20:18:08Z")

</div>

^ Not at all. Your document class behaves as the timeline and receives all of the timeline’s variables and children as a consequence.

---

<div class="post-metadata">

**Author:** ![tpspoons](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@tpspoons](https://forum.kirupa.com/u/tpspoons)\
**Post date:** [May 19, 2008, 8:25pm UTC](https://forum.kirupa.com/t/define-tweener-in-the-document-class/260665/6 "2008-05-19T20:25:40Z")

</div>

My bad 😃
