3 Replies Latest reply on Jun 8, 2009 8:01 PM by Michael Borbor

    Flex FileReader, file open component??

    valy_cervantes

      Hello

       

      Problem 1:

       

      I'm new to flex, and I need help to create a function that can open and read an html source. I know html file cannot be renderd, but I only want to read it's source code and display it into a textArea.

       

      Problem 2:

       

      How can I open a html file in a new browser window from a flex application.To be specific, when I press a button in my application I want the html to be displayd in a new browser tab.

       

      Isn't there a filesystem,filestream .... component in flex?I've searched Felx doc's an google with no luck!Sorry if this kind of question has been asked already. I'm  on a deadline and I would appreciate a quick replay!

       

      Thanks in advance!

        • 1. Re: Flex FileReader, file open component??
          *Prashant Shelke* Level 4

          To open file in new browser.

           

          var connection_request:URLRequest;

          connection_request = new URLRequest("http://www.google.com"); // URL, or you can give your application path here.

          connection_request.data = new URLVariables("param1=" + "Prashant"); // to pass any parameter to URL

          connection_request.method = URLRequestMethod.POST; // setting method type
          navigateToURL(connection_request);  // this is standard function.

           

          Thanks.

          1 person found this helpful
          • 2. Re: Flex FileReader, file open component??
            valy_cervantes Level 1

            Thanks for your quick reply

             

            I tryed your example but still nothing happens when I trigger the button. Bear with me for minute, i'm just starting with flex.

            So my html file that I want to open is located in project/date/euroCV/EuroPass_CV.html

             

            The function I wrote looks like this:

             

            private function openFile():void
                           {
                               var connection_request:URLRequest;
                               connection_request=new URLRequest(".date/euroCV/EuroPass_CV.html");
                               connection_request.data=new URLVariables("");
                               connection_request.method=URLRequestMethod.POST;
                               navigateToURL(connection_request);
                           }  

             

            then there's the damn button:

             

            <mx:Button x="175" y="73" label="EuroCV"  click="openFile()"/>

             

             

            What's wrong????

             

            Thanks!

            • 3. Re: Flex FileReader, file open component??
              Michael Borbor Level 4

              There's a dot at the beginning of the address, probably there lies your problem.

               

              connection_request=new URLRequest(".date/euroCV/EuroPass_CV.html");

               

               

               

              2009/6/8, valy_cervantes <forums@adobe.com>:

              >

              Thanks for your quick reply

              >

              I tryed your example but still nothing happens when I trigger the button.

              Bear with me for minute, i'm just starting with flex.

              So my html file that I want to open is located in

              project/date/euroCV/EuroPass_CV.html

              >

              The function I wrote looks like this:

              >

              private function openFile():void

                             {

                                 var connection_request:URLRequest;

                                 connection_request=new

              URLRequest(".date/euroCV/EuroPass_CV.html");

                                 connection_request.data=new URLVariables("");

                                 connection_request.method=URLRequestMethod.POST;

                                 navigateToURL(connection_request);

                             }

              >

              then there's the damn button:

              >

              <mx:Button x="175" y="73" label="EuroCV"  click="openFile()"/>

              >

              >

              What's wrong????

              >

              Thanks!

              >