Hey guys,
I have a very simple noob question, simplified example:
I have a movie clip already loaded on the stage called mcCenter
through actionscript I am loading inside that mcCenter a new mc called mcNoVideo.
My problem is that I want to center mcNoVideo inside mcCenter when mcNoVideo is clicked... but don't really getting it.
Code:
Code:
var mcNoVideo:McNoVideo = new McNoVideo();
public function StageMcAndNestedMcs() {
mcCenter.addChild(mcNoVideo); //correctly added and shown inside mcCenter.
mcNoVideo.addEventListener(MouseEvent.CLICK, onMcNoVideo);
}
function onMcNoVideo(event:MouseEvent)
{
trace("CLICKED ON mcNoVideo");
//CENTER mcNoVideo inside mcCenter (NOT CENTERING CORRECTLY)
mcNoVideo.x = (stage.fullScreenWidth - mcNoVideo.width) / 2;
mcNoVideo.y = (stage.fullScreenHeight - mcNoVideo.height) / 2;
//note: mcCenter = stage width and height
}
Any ideas?
Thanks a lot!