# Catch variable outside MC

**URL:** <https://forum.kirupa.com/t/catch-variable-outside-mc/280082>\
**Category:** Uncategorized\
**Created:** [January 22, 2009, 12:41pm UTC](https://forum.kirupa.com/t/catch-variable-outside-mc/280082 "2009-01-22T12:41:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ruiganga](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/ruiganga/32/3679_2.png) [@ruiganga](https://forum.kirupa.com/u/ruiganga)\
**Post date:** [January 22, 2009, 12:41pm UTC](https://forum.kirupa.com/t/catch-variable-outside-mc/280082/1 "2009-01-22T12:41:58Z")

</div>

Hi

I have a problem. Easy to do in AS2 but I can’t do in AS3.

I have a variable called:

var pageNumber:Number = 2;

the variable was created in the main timeline

And I have 2 MC, one inside the other, animation\_mc and content\_mc, the content is inside animation.

Inside the animation\_mc I wrote in the timeline:

contentMc.gotoAndStop(pagenumber);

it gives an error. flash can’t find the variable pageNumber.

how can I do this?

thanks
