Image

Imageeri_chan wrote in Imageflashdev 😡frustrated

I'm seriously struggling with the switch over to Flash CS3 and ActionScript 3.0 - it just doesn't make sense to me, I'm not really a programmer, and although I never did anything more complicated than a getURL action in Flash 8, at least I understood how to do it so it'd work. I can't even do that much in CS3.

I've got a flash banner being used for on the splash page of a website, with 5 buttons being used for navigation. After hours and hours of work and research I was able to make the buttons work correctly a far as loading the right page, but I can't for the life of me figure out how to keep them from opening a new window by default. I found the correct variable SOMEWHERE in the help program, but now I can't find it again. Not that it matters, really, because I used a quick-and-dirty method to get the links working in the first place and I couldn't figure out how to work the variable into the code I'd already written.

The code I have written so far is behind the cut - can someone please help me figure out how to make the links open in the parent window??

//"About" link button code starts here

var aboutLink:URLRequest = new URLRequest("/about/index.php");

aboutBtn.addEventListener(MouseEvent.CLICK, onClickAbout);

function onClickAbout(event:MouseEvent):void
{
navigateToURL(aboutLink);
}

//"Programs" link button code starts here

var programsLink:URLRequest = new URLRequest("/programs/index.php");

programsBtn.addEventListener(MouseEvent.CLICK, onClickPrograms);

function onClickPrograms(event:MouseEvent):void
{
navigateToURL(programsLink);
}

//"Students" link button code starts here

var studentsLink:URLRequest = new URLRequest("/students/index.php");

studentsBtn.addEventListener(MouseEvent.CLICK, onClickStudents);

function onClickStudents(event:MouseEvent):void
{
navigateToURL(studentsLink);
}

//"Faculty" link button code starts here

var facultyLink:URLRequest = new URLRequest("/faculty/index.php");

facultyBtn.addEventListener(MouseEvent.CLICK, onClickFaculty);

function onClickFaculty(event:MouseEvent):void
{
navigateToURL(facultyLink);
}

//"Contact" link button code starts here

var contactLink:URLRequest = new URLRequest("/contact/index.php");

contactBtn.addEventListener(MouseEvent.CLICK, onClickContact);

function onClickContact(event:MouseEvent):void
{
navigateToURL(contactLink);
}


I know there is a better way to do what I've already done, too, I just honestly can't figure out how to do it :(