I seem to have hit a block when it comes to the AS3 coding, iv managed to get all of my code working but when it comes to adding buttons to connect to a url in the same page i cannot get the code to work. Can any one help me as im alot stumped.
var ful_scr:Boolean = false;
full_screen_mc.mouseChildren = prev_mc.mouseChildren = next_mc.mouseChildren = false;
full_screen_mc.buttonMode = prev_mc.buttonMode = next_mc.buttonMode = true;
full_screen_mc.addEventListener(MouseEvent.MOUSE_DOWN,onMD);
prev_mc.addEventListener(MouseEvent.MOUSE_DOWN,navigate);
next_mc.addEventListener(MouseEvent.MOUSE_DOWN,navigate);
full_screen_mc.addEventListener(MouseEvent.MOUSE_OVER,onMOver);
prev_mc.addEventListener(MouseEvent.MOUSE_OVER,onMOver);
next_mc.addEventListener(MouseEvent.MOUSE_OVER,onMOver);
full_screen_mc.addEventListener(MouseEvent.MOUSE_OUT,onMOut);
prev_mc.addEventListener(MouseEvent.MOUSE_OUT,onMOut);
next_mc.addEventListener(MouseEvent.MOUSE_OUT,onMOut);
---- its this section here which wont work
animation_mc.buttonMode = true;
animation_mc.addEventListener(MouseEvent.CLICK, onClick);
animation_mc.addEventListener(MouseEvent.MOUSE_OVER, over);
animation_mc.addEventListener(MouseEvent.MOUSE_OUT, out);
function over(e:Event) {
animation_mc.gotoAndPlay("in");
}
function out(e:Event) {
animation_mc.gotoAndPlay("out");
}
function onClick(event: MouseEvent) {
var home:URLRequest = new URLRequest("http://www.facebook.com");
navigateToURL(home);
}
stage.addEventListener(Event.FULLSCREEN,checkIfIsFullscreen);
function checkIfIsFullscreen(e:Event):void {
if (stage.displayState == StageDisplayState.FULL_SCREEN) {
full_screen_mc.text_txt.text = "| RETURN |";
ful_scr = true;
} else {
full_screen_mc.text_txt.text = "| MAXIMISE |";
ful_scr = false;
}
}
function onMOver(e:MouseEvent):void {
e.currentTarget.gotoAndPlay("s1");
}
function onMOut(e:MouseEvent):void {
e.currentTarget.gotoAndPlay("s2");
}
function onMD(e:MouseEvent):void {
if (ful_scr == false) {
stage.displayState = StageDisplayState.FULL_SCREEN;
full_screen_mc.text_txt.text = "- normal screen -";
ful_scr = true;
} else {
stage.displayState = StageDisplayState.NORMAL;
full_screen_mc.text_txt.text = "+ full screen +";
ful_scr = false;
}
}
function navigate(e:MouseEvent):void {
if (e.currentTarget == prev_mc) {
if (stage.getChildAt(0).cur_index >0) {
stage.getChildAt(0).cur_index --;
stage.getChildAt(0).loadBigImages(stage.getChildAt(0).cur_index);
}
} else {
if (stage.getChildAt(0).cur_index < stage.getChildAt(0)._image_ar.length - 1) {
stage.getChildAt(0).cur_index ++;
stage.getChildAt(0).loadBigImages(stage.getChildAt(0).cur_index);
}
}
updateText();
}
function updateText():void {
if (stage.getChildAt(0).cur_index3 < 9) {
if ( stage.getChildAt(0)._xml_length > 9) {
info_mc.text_txt.text = "0" + (stage.getChildAt(0).cur_index3 + 1) + " / " + stage.getChildAt(0)._xml_length ;
} else {
info_mc.text_txt.text = "0" + (stage.getChildAt(0).cur_index3 + 1) + " / 0" + stage.getChildAt(0)._xml_length ;
}
} else {
info_mc.text_txt.text = (stage.getChildAt(0).cur_index3 + 1) + " / " + stage.getChildAt(0)._xml_length;
}
}
Pls help thank you![]()





Bookmarks