How to use gotoAndPlay() in actionscript file to target object on stage?

Good day!

Im new to actionscript 3, and id like to know how to use gotoAndPlay to target an object (drawn from hand to stage) on the stage using actionscript file?
My code is this:

    import flash.display.MovieClip;
    public class moveframe extends MovieClip
        public function moveframe()

It will only generate an error message saying: “Call to possibly undefined method gotoAndPlay through a reference with static type flash.display:DisplayObject.

I dont know what this error message means, but does anyone knows what the problem is?
I tried to trace the X position of the child named “stick” using: traced(parent.getChildByname(“stick”).x); to make sure that the object is already existed, but it produce the X position of my “stick” object which means that it is present. but when i try to use gotoAndPlay(2) it will make an error.

does anyone knows any alternative way to refference the movieclip object that has been put to stage?

thank you…