# Variable question: This has to be ridiculously easy to do, right?

**URL:** <https://forum.kirupa.com/t/variable-question-this-has-to-be-ridiculously-easy-to-do-right/283668>\
**Category:** flash\
**Created:** [March 9, 2009, 8:53pm UTC](https://forum.kirupa.com/t/variable-question-this-has-to-be-ridiculously-easy-to-do-right/283668 "2009-03-09T20:53:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![preciousroy](https://avatars.discourse-cdn.com/v4/letter/p/f14d63/32.png) [@preciousroy](https://forum.kirupa.com/u/preciousroy)\
**Post date:** [March 9, 2009, 8:53pm UTC](https://forum.kirupa.com/t/variable-question-this-has-to-be-ridiculously-easy-to-do-right/283668/1 "2009-03-09T20:53:56Z")

</div>

I’ve got a Custom Class written for generating a menu. It’s got values for things like the starting x position and y position of the menu.

So in the Custom Class I’ve got lines that read

private var startingxpos:int = 20  
private var startingypos:int = 5

So, my menu starts at (20,5). Fine.

But I would like to be able to re-use this menu in all kind of instances (the whole point of the Custom Class, right?), and on other pages and projects it will need a different staring x and y positions.

Question: How do I change this to where I can give the Custom Class’ ‘startingxpos’ and ‘startingypos’ variables their values from the ActionScript panel accessed from the timeline.

I thought it would be as simple as changing them to public variables, _not_ giving them an initial value in the Custom Class (e.g. “var startingxpost:int”), then giving the variable a value in the Actionscript Panel from the timeline (e.g. var startingxpos = 100).

This has to be really simple, right? Am I just getting something basic wrong?

Thanks
