Hello there
I am stuck with a really silly example. I did this:
- I put a Button on the stage.
- I convert this Button into a Movie Clip.
- I link this MovieClip to a Class like this:
import mx.controls.Button;
import mx.utils.Delegate;
class Caca{
var b1:Button;
function onLoad(){
b1.addEventListener(“click”, Delegate.create(this,b1_onClick));
}
public function b1_onClick()
{
b1._parent.gotoAndStop(“open”);
trace(“HELLO”);
}
}
-
I click twice inside the Movie Clip which I just created to go inside of this movie clip for the next steps.
-
I add a keyframe in the frame number 10.
-
I draw a circle on the stage inside of frame number 10 right besides the button.
-
I put “open” as the frame label for frame number 10.
-
I put stop() in the actions corresponding to frame number 1 and 10.
When I test the application, I can see the Message “HELLO”, but I cannot see the circle I drew. That is to say, the gotoAndStop is not working to modify the current frame in the timeline of the movieclip as I expected. Does anyone know how to solve this?
What I do know is that if I replace b1._parent.gotoAndStop(“open”) with
gotoAndStop(“open”), the effect is that the frame of the main timeline gets modified. Nonetheless, that is not the effect I am looking for. What I want, is changing the frame in the timeline associated with the movieclip.
Thanks in advance