Cyman666
2009-03-23 15:38:02 UTC
Ok, i have a scene, the background is a movie clip named "landscape_mc" which
is an animation stopped on frame 1.
on a layer above that i have another movieclip named "navigate_mc",within
this movieclip i have a set of buttons.
What i'd like to be able to do is when i click on one of these buttons it goes
to frame 39 of the "landscape_mc" movieclip.
the movieclip "navigate_mc" is also set to be draggable.
ive tried a few things but keep getting "Access of undefined property" errors.
Im guessing because my button instances names are set within its own movieclip
that it doesnt recognise them when playing the scene.
heres my code:
navigate_mc.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
navigate_mc.addEventListener(MouseEvent.MOUSE_UP, mouseReleasedHandler);
function mouseDownHandler(e:MouseEvent):void {
navigate_mc.startDrag();
}
function mouseReleasedHandler(e:MouseEvent):void {
navigate_mc.stopDrag();
}
portal_btn.addEventListener(MouseEvent.CLICK,gotoframe);
function gotoframe(evt:Event):void {
landscape_mc.gotoAndStop ("39");
}
stop();
im fairly new to AS3 so im hoping theres a simple fix :)
many thanks in advance
is an animation stopped on frame 1.
on a layer above that i have another movieclip named "navigate_mc",within
this movieclip i have a set of buttons.
What i'd like to be able to do is when i click on one of these buttons it goes
to frame 39 of the "landscape_mc" movieclip.
the movieclip "navigate_mc" is also set to be draggable.
ive tried a few things but keep getting "Access of undefined property" errors.
Im guessing because my button instances names are set within its own movieclip
that it doesnt recognise them when playing the scene.
heres my code:
navigate_mc.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
navigate_mc.addEventListener(MouseEvent.MOUSE_UP, mouseReleasedHandler);
function mouseDownHandler(e:MouseEvent):void {
navigate_mc.startDrag();
}
function mouseReleasedHandler(e:MouseEvent):void {
navigate_mc.stopDrag();
}
portal_btn.addEventListener(MouseEvent.CLICK,gotoframe);
function gotoframe(evt:Event):void {
landscape_mc.gotoAndStop ("39");
}
stop();
im fairly new to AS3 so im hoping theres a simple fix :)
many thanks in advance