5 Replies Latest reply on Mar 20, 2011 3:42 PM by kglad-zqbLf4

    Problem w/ Try/Catch

    beno12345 Level 1

      Hi;

      I have this code:

       

              private var cookieValue:* = ExternalInterface.call("function(){return document.cookie;}");
      ...

                  try
                  {
                      on0 = CookieValue.split("=")[0];
                      os0 = CookieValue.split("=")[1];
                      ppURL = "https://www.paypal.com/cgi-bin/websc?cmd=_s-xclick&hosted_button_id=YE8VNUFFGLR5C&on0=" + on0 + "&os0=" + os0;
                  } catch(error:Error) {
                      ppURL = "https://www.paypal.com/cgi-bin/websc?cmd=_s-xclick&hosted_button_id=YE8VNUFFGLR5C";
                  }

       

       

      and I get these errors:

       

      /Users/benocandelon/Sites/2012/Maya2012Main.as, Line 188    1120: Access of undefined property CookieValue.

      /Users/benocandelon/Sites/2012/Maya2012Main.as, Line 188    1120: Access of undefined property CookieValue.

       

      Now, I thought the whole idea of try/catch was to deal with errors. Um...what am I missing here??

      TIA,

      Beno