0 Replies Latest reply on May 19, 2010 8:56 PM by memph.

    Loading text file with flash lite 3.0 problem

    memph.

      Hello,

       

      I recently ran into a problem with loading a plain text file with Flash Lite 3.0.

       

      I know there is a way to load name/value pairs using LoadVars class or XML file using XML class. Both methods work great, but these classes parse the data loaded and I need to load just a plain text - no pairs or xml structure. (its because Im loading specific file format, so I can't make any changes to it)

       

      There is a simple way how to achieve this in Flash using Actionscript 2 by extending the LoadVars class and overriding the onData() method. I used it plenty of times and it works fine.

       

      There is an example of implementation:

       

      // the PlainData.as file

       

      class PlainData extends LoadVars {
          function onData(str) {
              trace(str)
              this.onLoad(true);
          }
      }

       

      // now in the main file

       

      var my_data:PlainData = new PlainData();
      my_data.load("my3dmodel.obj");

       

      This code traces unchanged content of my3dmodel.obj file.

       

       

      The problem comes when I try to run this code using Flash Lite 3.0. The code stops working just by changing player version in publish settings to Flash Lite 3.0. It doesnt display any error, but also doesnt trace any content.

       

      Is there a reason why you cant override onData method in LoadVars class in lite version of flash or am I doing something wrong?

      (also overriding onLoad() method works fine in Flash Lite)

       

      Ondrej