1 Reply Latest reply on Jun 12, 2006 5:46 AM by Newsgroup_User

    Problems when switching from version 6 to version 7

    opheim-smedsrud
      i´ve got this xml price list imported into flash, and all script written for version 6. When exporting to version 7, some problems occur:
      the import/parse split-into-arrays part is working fine.
      the duplicateMovieclip dosent work, and the arrays' values comes out NaN.

      Can anyone tell me if the syntax have changed from v. 6 to v. 7 ?

      Some actionscript attached: (scaled down for simplicity)

      var Leiligheter:Array =[];
      for (i=0; i<my_xml.firstChild.childNodes.length; i++) {
      Leiligheter.push( {
      Nr:Number(my_xml.firstChild.childNodes .attributes.Seksjon),
      Pris:Number(my_xml.firstChild.childNodes
      .attributes.pris)
      });
      }

      dupMovie = function() {

      for (i=0; i<AntallLeiligheter; i++) {


      _root.Prisliste.MC_Nr.duplicateMovieClip("MC_Nr"+i , i, { _y:MC_Nr._y+ListItemHeight+(ListItemHeight*i)});

      _root.Prisliste["MC_Nr"+i].Txt.text = LeiligheterSortByNrAsc .Nr;
      _root.Prisliste["MC_Type"+i].Txt.text = LeiligheterSortByNrAsc
      .Type;
      }
      };


      thx, MOS
        • 1. Re: Problems when switching from version 6 to version 7
          Level 7
          Hi there (fellow Norwegian?)

          Yes, there are some important changes from 6 to 7. The main one that might
          be causing problems for you is that v7 is case-sensitive. So the following
          two variables are different in 7, but treated as one and same in 6:
          myVar
          MyVar
          This also affects casing for functions and built in variables in Flash. (I
          seem to remember v6 didn't care how you typed those things, but v7 does).
          I couldn't see anything specifically wrong in the code you included, but I
          didn't go into detail on it, as for all I know you might have done some
          minor modifications to this one to shorten it.... and those modifications
          might have removed the problem.
          Anyway, you basically need to debug the code, track down the problem, use
          the help manual and update your code a bit, then it should work.

          An alternative approach is to change the publish settings to compile using
          actionscript 1.0 instead of 2.0, and then your old code should still work.
          This will limit some of the new things in v7 that you wont be able to use,
          of course. So it might only be good as a temporary solution.

          If it is not too much code, etc ... I might be able to help you out. You can
          contact me on MSN if you like
          sschwss at hotmail dot com. (No spam, please).

          Cheers!

          /Jensen/


          "jallajalla" <webforumsuser@macromedia.com> wrote in message
          news:e6jck8$bl0$1@forums.macromedia.com...
          > i?ve got this xml price list imported into flash, and all script written
          > for
          > version 6. When exporting to version 7, some problems occur:
          > the import/parse split-into-arrays part is working fine.
          > the duplicateMovieclip dosent work, and the arrays' values comes out NaN.
          >
          > Can anyone tell me if the syntax have changed from v. 6 to v. 7 ?
          >
          > Some actionscript attached: (scaled down for simplicity)
          >
          > var Leiligheter:Array =[];
          > for (i=0; i<my_xml.firstChild.childNodes.length; i++) {
          > Leiligheter.push( {
          > Nr:Number(my_xml.firstChild.childNodes .attributes.Seksjon),
          > Pris:Number(my_xml.firstChild.childNodes
          .attributes.pris)
          > });
          > }
          >
          > dupMovie = function() {
          >
          > for (i=0; i<AntallLeiligheter; i++) {
          >
          >
          > _root.Prisliste.MC_Nr.duplicateMovieClip("MC_Nr"+i , i, {
          > _y:MC_Nr._y+ListItemHeight+(ListItemHeight*i)});
          >
          > _root.Prisliste["MC_Nr"+i].Txt.text = LeiligheterSortByNrAsc .Nr;
          > _root.Prisliste["MC_Type"+i].Txt.text = LeiligheterSortByNrAsc
          .Type;
          > }
          > };
          >
          >
          > thx, MOS
          >