# Couple of little doubts :)

**URL:** <https://forum.kirupa.com/t/couple-of-little-doubts/302901>\
**Category:** flash\
**Created:** [January 9, 2010, 4:49pm UTC](https://forum.kirupa.com/t/couple-of-little-doubts/302901 "2010-01-09T16:49:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lucy\_87](https://avatars.discourse-cdn.com/v4/letter/l/6de8d8/32.png) [@Lucy\_87](https://forum.kirupa.com/u/Lucy_87)\
**Post date:** [January 9, 2010, 4:49pm UTC](https://forum.kirupa.com/t/couple-of-little-doubts/302901/1 "2010-01-09T16:49:12Z")

</div>

Hello guys,

Would someone be kind to solve my two little problems please?  
Thank you!!😛

First, I have a problem accessing the .x of an Sprite inside a class I made.

I have class A which in his constructor I have three _addChild(B)_, then in class B’s constructor I have _addChild(sprite\_C)_.

So, in a function in class B I want to get the .x of the others sprites in the others classes B.

The code I have in that function inside B now is this but its not working ☹  
c=0;  
while (c\<parent.numChildren) {  
trace(parent.getChildAt©.sprite\_C.x);  
c=c+1;  
}

The second problem may be an easy one for you.

Why with this code inside my button class my program just jumps to frame 3 when I push my button?

public function on\_Release(e:Event) {  
if (MovieClip(root).currentFrame == 1){  
MovieClip(root).gotoAndStop(2);  
}  
if (MovieClip(root).currentFrame == 2){  
MovieClip(root).gotoAndStop(3);  
}  
}

Thanks in advance !  
;_;_
