Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 506883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T06:44:49+00:00 2026-05-13T06:44:49+00:00

I have a map. On this map I have points, and when you click

  • 0

I have a map. On this map I have points, and when you click on these points it goes to a URL.

The code setup is as follows:

  • Arrays to define the movieclip
    locations and another for the urls
    (this one is an associative array).

  • I then create a function loop to make
    an event listener for each point.
    When the point is clicked it will run
    another function that handles the
    URLs.

  • The URL function is to grab the
    target point that has been click, use
    the url array type to find the key,
    and then throw it in to the
    URLRequest.

So far I have this code:

var places:Array = new Array();
places = [
 map.paulsens, map.paraburdoo, map.plutonic, map.wiluna, map.gwalia, map.wallaby,
 map.sunrise, map.moora, map.marvel, map.flyingFox, map.ernest, map.rosebery,
 map.lyell, map.renison, kalMap.kanowna, kalMap.frogsLeg, kalMap.tindals,
 kalMap.miitel, kalMap.higginsville
];

var links:Array = new Array();
links[ "paulsens" ] = "http://mywebsite.com/";
links[ "paraburdoo" ] = "http://mywebsite.com/";
links[ "plutonic" ] = "http://mywebsite.com/";
links[ "wiluna" ] = "http://mywebsite.com/";
links[ "gwalia" ] = "http://mywebsite.com/";
links[ "wallaby" ] = "http://mywebsite.com/";
links[ "sunrise" ] = "http://mywebsite.com/";
links[ "moora" ] = "http://mywebsite.com/";
links[ "marvel" ] = "http://mywebsite.com/";
links[ "flyingFox" ] = "http://mywebsite.com/";
links[ "ernest" ] = "http://mywebsite.com/";
links[ "rosebery" ] = "http://mywebsite.com/";
links[ "lyell" ] = "http://mywebsite.com/";
links[ "renision" ] = "http://mywebsite.com/";
links[ "kanowna" ] = "http://mywebsite.com/";
links[ "frogsLeg" ] = "http://mywebsite.com/";
links[ "tindals" ] = "http://mywebsite.com/";
links[ "miitel" ] = "http://mywebsite.com/";
links[ "higginsville" ] = "http://mywebsite.com/";

function listenerLoop():void {
    var i:int;
    for( i = 0; i < places.length; i++ ) {
        ( places[ i ] as IEventDispatcher ).addEventListener( MouseEvent.CLICK, openLink );
    }
}

function openLink( event:MouseEvent ):void {
    var link:URLRequest = new URLRequest( links[ event.target ] );
    navigateToURL( link, "_blank" );
}

listenerLoop();

Now all works fine until I click on the point, giving me this error:

TypeError: Error #2007: Parameter url must be non-null.
at global/flash.net::navigateToURL()

at

navigateToURL( link, "_blank" );

It’s obvious to me that the openLink(); function isn’t doing what I want it to. I can kind of guess because event.target isn’t being turned in to a string or not pulling the array’s type?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T06:44:49+00:00Added an answer on May 13, 2026 at 6:44 am

    try

    var link:URLRequest = new URLRequest( links[ event.target.name ] );
    

    and since you define strings for you iterator it may be better do define your links as an object in favor of an array

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.