3 Replies Latest reply on Jun 28, 2008 10:33 AM by Whitetimer

    NavigateToURL

    Whitetimer Level 1
      Hi All Again ..

      Another quick question .... This is what i have (4 seperate function) but would i write these as one function using IF & Else statements .... ?

      private function email1():void {
      var u:URLRequest = new URLRequest("mailto:info@uwth.co.uk");
      navigateToURL(u, "_parent");
      }

      private function email2():void {
      var u:URLRequest = new URLRequest("mailto:healing@uwth.co.uk");
      navigateToURL(u, "_parent");
      }

      private function email3():void {
      var u:URLRequest = new URLRequest("mailto:wt@uwth.co.uk");
      navigateToURL(u, "_parent");
      }

      private function email4():void {
      var u:URLRequest = new URLRequest("mailto:net@uwth.co.uk");
      navigateToURL(u, "_parent");
      }

      Many thanks again

      Shihan67
        • 1. Re: NavigateToURL
          Selvam_flex


          private function email(mailid:String)
          {
          var u:URLRequest = new URLRequest(mailid);
          navigateToURL(u, "_parent");
          }

          while calling this function
          email("mailto:info@uwth.co.uk");
          email("mailto:healing@uwth.co.uk");
          email("mailto:wt@uwth.co.uk");

          regards
          selvam
          • 2. Re: NavigateToURL
            Gregory Lafrance Level 6
            Or this:

            private function email(mailid:String)
            {
            var mailToStr:String = "mailto:"
            var domainStr:String = "@uwth.co.uk";
            var u:URLRequest = new URLRequest(mailToStr + mailid + domainStr);
            navigateToURL(u, "_parent");
            }

            while calling this function
            email("info");
            email("healing");
            email("wt");
            • 3. Re: NavigateToURL
              Whitetimer Level 1
              Hi ...

              Thats great, thanks for both the suggestions .... Trying to learn AS with not much time on my hands so any suggestions is good news

              Cheers

              Shihan