title: How can I send the user to a different URL using navigateToURL depending on clicked target?
body: <p>I have an SWF file of a "virtual map" with different locations. When each location is clicked, the user is redirected to a hyperlink. </p>
  
  <p>How would I make each location redirect to a different hyperlink?</p>
  
  <ul>
  <li>If the fountain was clicked, the user would be redirected to <a href="http://different.com">http://different.com</a></li>
  <li>If the castle was clicked, the user would be redirected to <a href="http://something.com" rel="nofollow noreferrer">http://something.com</a></li>
  </ul>
  
  <p>You can download the SWF from <a href="http://www.filedropper.com/aaa_2" rel="nofollow noreferrer">here</a> or view it online: <a href="http://www.fastswf.com/NInMHKU" rel="nofollow noreferrer">http://www.fastswf.com/NInMHKU</a></p>
  
  <p>Here is ActionScript code which makes possible for the user to be redirected when clicking on a location:</p>
  
  <pre><code>package
  {
     import flash.net.URLRequest;
     import flash.net.navigateToURL;
     import flash.events.MouseEvent;
  
     public class Map
     {
         public function Map()
         {
         }
  
         public function gotoLocation(param1:int) : void
         {
             if(param1 != 999)
             {
                 navigateToURL(new URLRequest("http://www.baidu.com"),"_blank");
              }
          }
  
          private function closeMap(param1:MouseEvent = null) : void
          {
  
          }
      }
  }
  </code></pre>
  
  <hr>
  
  <p>After decompiling the SWF file with a program called JPEXS Free Flash Decompiler, I discovered that there's two different AS files for each location on the map. As an example, below are the files for the fountain.</p>
  
  <p><strong>Source of: Flumsfountain_499.as</strong></p>
  
  <pre><code>package SkylandersSuperchargersMap_26_10_15_fla
  {
     import flash.display.MovieClip;
  
     public dynamic class Flumsfountain_499 extends MovieClip
     {
  
  
        public function Flumsfountain_499()
        {
           super();
           addFrameScript(0,this.frame1,1,this.frame2);
        }
  
        function frame1() : *
        {
           stop();
        }
  
        function frame2() : *
        {
           stop();
        }
     }
  }
  </code></pre>
  
  <p><strong>Source of: flumsfountainlPU_520.as</strong></p>
  
  <pre><code>package SkylandersSuperchargersMap_26_10_15_fla
  {
     import flash.display.MovieClip;
  
     public dynamic class flumsfountainlPU_520 extends MovieClip
     {
  
  
        public function flumsfountainlPU_520()
        {
           super();
           addFrameScript(18,this.frame19);
        }
  
        function frame19() : *
        {
           stop();
        }
     }
  }
  </code></pre>
  
  <p><Hr></p>
  
  <p><strong>Previously I tried...</strong></p>
  
  <p>I was able to use <a href="https://github.com/CyberShadow/RABCDAsm" rel="nofollow noreferrer"><strong>RABCDAsm</strong></a> to decompile the SWF into many different files and here is the code (<em>source file:</em> <code>Map.class.asasm</code>) which is produced by the AS3 project at the top of this question:</p>
  
  <pre><code>  trait method QName(PackageNamespace(""), "gotoLocation")
     method
      name "gotoLocation"
      refid "TestGotoLocationFunction/instance/gotoLocation"
      param QName(PackageNamespace(""), "int")
      returns QName(PackageNamespace(""), "void")
      flag HAS_PARAM_NAMES
      paramname "param1"
      body
       maxstack 4
       localcount 2
       initscopedepth 0
       maxscopedepth 1
       code
        getlocal0
        pushscope
  
        getlocal1
        pushshort           999
        ifeq                L13
  
        getlex              QName(PackageNamespace("flash.net"), "navigateToURL")
        getglobalscope
        findpropstrict      QName(PackageNamespace("flash.net"), "URLRequest")
        pushstring          "http://www.baidu.com"
        constructprop       QName(PackageNamespace("flash.net"), "URLRequest"), 1
        pushstring          "_blank"
        call                2
        pop
  L13:
        returnvoid
       end ; code
      end ; body
     end ; method
    end ; trait 
  </code></pre>