Navigating timelines from class (newb question)

I’m finishing up writing my very first class (so any advice on other ways to improve my programming are always welcomed). The class is used to go to specific frames randomly without replacement (the frame can only be visited once). I’m having trouble using gotoAndStop/Play () to navigate though.

here is the code:

ActionScript Code:
[LEFT]</p>
<p>package [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#0000ff]import[/COLOR] flash.[COLOR=#000080]display[/COLOR].[COLOR=#0000ff]MovieClip[/COLOR];</p>
<p> [COLOR=#0000ff]public[/COLOR] [COLOR=#000000]class[/COLOR] RandomFrame [COLOR=#0000ff]extends[/COLOR] [COLOR=#0000ff]MovieClip[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> </p>
<p> [COLOR=#0000ff]private[/COLOR] [COLOR=#000000]var[/COLOR] numberFrames:uint;</p>
<p> [COLOR=#0000ff]public[/COLOR] [COLOR=#000000]var[/COLOR] FramesVisited:[COLOR=#0000ff]Array[/COLOR]=[COLOR=#000000]new[/COLOR] [COLOR=#0000ff]Array[/COLOR] ;</p>
<p> [COLOR=#0000ff]public[/COLOR] [COLOR=#000000]var[/COLOR] targetFrame:uint;</p>
<p> [COLOR=#0000ff]public[/COLOR] [COLOR=#000000]var[/COLOR] targetFrames:[COLOR=#0000ff]Array[/COLOR]=[COLOR=#000000]new[/COLOR] [COLOR=#0000ff]Array[/COLOR] ;</p>
<p> [COLOR=#0000ff]public[/COLOR] [COLOR=#000000]function[/COLOR] RandomFrame[COLOR=#000000]([/COLOR]… [COLOR=#000080]targetFrameNames[/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> numberFrames=targetFrameNames.[COLOR=#000080]length[/COLOR]</p>
<p> [COLOR=#0000ff]if[/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#0000ff]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]“Error: The number of Frames has to be more than 0.”[/COLOR][COLOR=#000000])[/COLOR];</p>
<p> [COLOR=#000000]}[/COLOR] [COLOR=#0000ff]else[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#0000ff]for[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#000000]var[/COLOR] i:uint=[COLOR=#000080]0[/COLOR]; i<targetFrameNames.[COLOR=#0000ff]length[/COLOR]; i++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> FramesVisited[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR]=[COLOR=#000000]false[/COLOR];</p>
<p> targetFrames[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR]=targetFrameNames[COLOR=#000000][[/COLOR][COLOR=#000080]0[/COLOR][COLOR=#000000]][/COLOR];</p>
<p> [COLOR=#000000]}[/COLOR]</p>
<p> [COLOR=#000000]}[/COLOR]</p>
<p> [COLOR=#000000]}[/COLOR]</p>
<p> [COLOR=#0000ff]public[/COLOR] [COLOR=#000000]function[/COLOR] gotoRandomFrameCOLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#000000]var[/COLOR] [COLOR=#0000ff]target[/COLOR]:uint=[COLOR=#0000ff]Math[/COLOR].[COLOR=#0000ff]floor[/COLOR]COLOR=#000000[/COLOR];</p>
<p> [COLOR=#0000ff]if[/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> targetFrame=[COLOR=#0000ff]target[/COLOR];</p>
<p> FramesVisited[COLOR=#000000][[/COLOR][COLOR=#0000ff]target[/COLOR][COLOR=#000000]][/COLOR]=[COLOR=#000000]true[/COLOR];</p>
<p> [COLOR=#0000ff]if[/COLOR] COLOR=#000000[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#0000ff]MovieClip[/COLOR]COLOR=#000000[/COLOR].[COLOR=#0000ff]gotoAndStop[/COLOR]COLOR=#000000[/COLOR];</p>
<p> [COLOR=#000000]}[/COLOR] [COLOR=#0000ff]else[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> [COLOR=#0000ff]MovieClip[/COLOR]COLOR=#000000[/COLOR].[COLOR=#0000ff]gotoAndPlay[/COLOR]COLOR=#000000[/COLOR];</p>
<p> [COLOR=#000000]}[/COLOR]</p>
<p> [COLOR=#000000]}[/COLOR] [COLOR=#0000ff]else[/COLOR] [COLOR=#000000]{[/COLOR]</p>
<p> gotoRandomFrameCOLOR=#000000[/COLOR];</p>
<p> [COLOR=#000000]}[/COLOR]</p>
<p> [COLOR=#000000]}[/COLOR]</p>
<p> [COLOR=#000000]}[/COLOR]</p>
<p>[COLOR=#000000]}[/COLOR]</p>
<p>
[/LEFT]

What do I need to change with the MovieClip(parent).gotoAndStop(targetFrames[target]); line, or is the problem elsewhere? Right now it is giving me a 1009 error.

edit: question2- Since gotoAndStop() acceptes both strings and uint’s for its parameters, I wanted set the type of the parameter in the constructor to strings or uint’s (which I dont think is possible directly) instead of leaving it un-typed. So I went to livedocs to see how Adobe set it, and the type for the gotoAndStop() parameter is :Object. As a beginner this did not help me. While this will not make or break my project, I would like to know what the experts would do.