1 Reply Latest reply on Jul 23, 2008 12:35 PM by nrutter

    Function if statement question

    nrutter Level 1
      I am having some troubles trying to get this code to work correctly. If the data from sql comes back empty I would like to default this image to a defult image if it is not empty then load the image. I am loading this through the model. So I hve a function here if model.currentCustomer.signupCode is empty then load the defualt image. What am I doing wrong?

      private function loadImages(){

      if (model.currentCustomer.signupCode = ' ')
      {
      model.currentCustomer.signupCode = 'RightTopBannerAd'
      }
      }

      <mx:Image source="https://{model.serverName}/images/{model.currentCustomer.signupCode}.jpg"/>
        • 1. Re: Function if statement question
          nrutter Level 1
          well I guess I should probably call the function....Its been a long day

          private function loadImages(){

          if (model.currentCustomer.signupCode = "")
          {
          model.currentCustomer.signupCode = "RightTopBannerAd"
          }
          }

          <mx:Image source="https://{model.serverName}/images/{model.currentCustomer.signupCode}.jpg" creationComplete="loadImages()/>