1 Reply Latest reply on Jul 28, 2006 7:52 PM by Newsgroup_User

    aval help needed!

    Spot3313
      Hey,

      Im trying to create a login system using XML - i found a flash movie that explains it, however it was created in Flash 5. Could anyone help me out and possibly provide a soultion!

      If needed I can send the file! Thank you to everyon that may be able to help!

      Here is part of the code
      function load_usrXML(success) {
      if (success) {
      var staff = usrXML.firstChild.firstChild;
      i=1;
      while (staff != null) {
      eval (staff.attributes.TITLE) = staff.attributes.NAME;
      eval (staff.attributes.PASSTITLE) = staff.attributes.CODE;
      if (staff.attributes.NUM eq "accountnum") {
      eval(staff.attributes.NUM) = staff.attributes.VALUE;
      }
      staff = staff.nextSibling;
      }
      } else {
      trace("error Loading XML File");
      }
      setObj();
      }
        • 1. Re: aval help needed!
          Level 7
          In Flash 5 or later, you cannot use eval() to dynamically set and retrieve
          the value of a variable or instance name, because you cannot useeval() on
          the left side of an equation. For example, replace the code

          eval ("var" + i) = "first";

          with this:

          this["var"+i] = "first"

          or this:

          set ("var" + i, "first");

          http://livedocs.macromedia.com/flash/8/main/00001726.html

          --
          Lon Hosford
          www.lonhosford.com
          Flash, Actionscript and Flash Media Server examples:
          http://flashexamples.hosfordusa.com
          May many happy bits flow your way!
          "Spot3313" <webforumsuser@macromedia.com> wrote in message
          news:eadlc6$mpl$1@forums.macromedia.com...
          > Hey,
          >
          > Im trying to create a login system using XML - i found a flash movie that
          > explains it, however it was created in Flash 5. Could anyone help me out
          > and
          > possibly provide a soultion!
          >
          > If needed I can send the file! Thank you to everyon that may be able to
          > help!
          >
          > Here is part of the code
          > function load_usrXML(success) {
          > if (success) {
          > var staff = usrXML.firstChild.firstChild;
          > i=1;
          > while (staff != null) {
          > eval (staff.attributes.TITLE) = staff.attributes.NAME;
          > eval (staff.attributes.PASSTITLE) = staff.attributes.CODE;
          > if (staff.attributes.NUM eq "accountnum") {
          > eval(staff.attributes.NUM) = staff.attributes.VALUE;
          > }
          > staff = staff.nextSibling;
          > }
          > } else {
          > trace("error Loading XML File");
          > }
          > setObj();
          > }
          >
          >