3 Replies Latest reply on Nov 3, 2010 12:17 PM by Flex harUI

    Check broken links

    chacal.net@gmail.com

      I have an application that shows through a DataGrid component, table fields, for this is using a HTTPService, which has a field that is a link to a document. Pdf.
      The count is over 2000 of whichsome are available and others not. To get access to files that are not shown in the link generated an error like this "Not Found The requested URL / file/Res018_99.pdf was not found on this server."
      I wish I could control the message and therefore to generate your own.
      Thanks!!!!

       

      Sin título-1.jpg

        • 1. Re: Check broken links
          Flex harUI Adobe Employee

          You should be able to capture the error.  There may be an ioError or failure

          event

          • 2. Re: Check broken links
            chacal.net@gmail.com Level 1

            I can not catch the error, which may be the problem.
            This is my source code:

            <?xml version="1.0" encoding="utf-8"?>
            <mx:Label xmlns:mx="http://www.adobe.com/2006/mxml" text="{data.NUMERO}"
                 click="linkListener(event)" mouseOver="mouseOver(event)" 
                 mouseOut="mouseOut(event)">
                 <mx:Script>
                      <![CDATA[
                      import flash.errors.IOError;
                         import mx.controls.Alert;
            
                      private function mouseOver(event:MouseEvent):void {
                         event.currentTarget.setStyle("color","0x0000FF");
                         event.currentTarget.setStyle("textDecoration","underline");
                      }
                       private function mouseOut(event:MouseEvent):void {
                         event.currentTarget.setStyle("color","0x000000");
                         event.currentTarget.setStyle("textDecoration","none");
                      }
                           
                      private function linkListener(event:MouseEvent):void {
                      try
                            {
                         var request:URLRequest = new URLRequest(event.currentTarget.data.UBICACION_ARCHIVO); 
                         navigateToURL(request, "_blank");
                      }
                            catch (error:IOError)
                           {
                              trace("message!!!!!!!!!");
                             
                        }
            
            
            
                           }
                      ]]>
                 </mx:Script>
            </mx:Label>
            
            

             

            Thankssss!!!!!!!!

            • 3. Re: Check broken links
              Flex harUI Adobe Employee

              You could try loading the url yourself