2 Replies Latest reply on Jan 28, 2007 7:54 AM by Newsgroup_User

    If variable = "none"

    Level 7
      The following is part of the function firstImage().
      I want Not to show the text between the <b> </b> if the variables = "none".
      example: if use[p]="none" the text "use:" will not display, if
      locale[p]="none" the text "location:" will not display, and if
      completion[p]="none" the text "completion:" will not display.

      function firstImage() {
      if (loaded == filesize) {
      use_txt.htmlText =
      "<b>use:</b>"+use[p]+newline+"<b>location:</b>"+locale[p]+newline+"<b>completion:</b>"+co mpletion[p];
      }

      I'm learning actionscript and stuck on this. Help is appreciated.
      Thanks

        • 1. Re: If variable = &quot;none&quot;
          SymTsb Level 2
          Try this instead...

          • 2. Re: If variable = &quot;none&quot;
            Level 7
            SymTsb, Thank you so much.
            I have used with the line breaks. Works just the way I wanted.

            if(use[p] != "none") {
            myText = myText + "<b>Use:</b>" + use[p]+newline;
            }
            if(locale[p] != "none") {
            myText = myText + "<b>location:</b>" + locale[p]+newline;
            }
            if(completion[p] != "none") {
            myText = myText + "<b>completion:</b>" + completion[p]+newline;

            "SymTsb" <webforumsuser@macromedia.com> wrote in message
            news:ephj01$mii$1@forums.macromedia.com...
            > Try this instead...
            >
            >
            >
            > var myText = "";
            >
            > function firstImage() {
            > if (loaded == filesize) {
            > if(use[p] != "none") {
            > myText = myText + "<b>Use:</b>" + use[p];
            > }
            > ............ Repeat above if for each variable and then
            >
            > use_txt.htmlText = myText;
            > }
            >