Specifically, there is a movie clip of a planet, and I want to make a button that goes to URL (A) while you see the front side of the planet. When the user clicks a separate button to spin the planet, I want to link to a different URL (
Current code:
stop();
var currentPlanetSide;
import flash.events.MouseEvent;
btn_MainMenu.addEventListener(MouseEvent.CLICK, clickMainMenu_btn);
btn_FullScreen.addEventListener(MouseEvent.CLICK, goFull);
//------------------btn_Spin
btn_Spin.addEventListener(MouseEvent.CLICK, click_Spin );
function click_Spin(event:MouseEvent):void
{
if (planet_mc.currentFrame == 1 || planet_mc.currentFrame == 27 ){
planet_mc.play();
}
}
//------------------btn_selectPlanetSide
btn_selectPlanetSide.addEventListener(MouseEvent.CLICK, click_PlanetSide );
function click_PlanetSide(event:MouseEvent):void
{
if (currentPlanetSide == "front" ){
var targetURL:URLRequest = new URLRequest("www.google.com");
} else if (currentPlanetSide == "back"){
var targetURL:URLRequest = new URLRequest("www.google.com");
}
navigateToURL(targetURL, "_blank");
}
I'm currently getting this error:
TypeError: Error #2007: Parameter request must be non-null.
at global/flash.net::navigateToURL()
at PRINT_menu_fla::MainTimeline/click_PlanetSide()

New Topic/Question
Reply


MultiQuote





|