0 Replies Latest reply on May 22, 2007 3:08 PM by BradenBowers

    Applying Images from XML file to button states.

    BradenBowers
      I'm using Flash MX Professional 2004. I have a xml file in the same directory with my flash file where I'm reading in the file names / paths for images which I'm setting in my flash file. I have buttons already created and set on my stage at design time. I need to know the code to set the different state properties of the buttons from images in my xml file.

      Example:
      offImage = nodes .attributes.offImage;
      onImage = nodes
      .attributes.onImage;
      trace("Off Image is: " + offImage); // At this point I am getting the text for the offImage from the xml file in my output box. So I know the xml is being read and I'm recieving the correct information from it.
      trace("On Image is: " + onImage); // Example of the text would be: testIMG.jpg or testIMG.gif
      btnMyButton.loadMovie(onImage); // Tried this, doesn't work. Syntax Checker doesn't error on this.
      btnMyButton.onMouseOver(onImage); // Tried this, doesn't work. Syntax Checker doesn't error on this.
      btnMyButton.onMouseOver.loadMovie(onImage); // Also doesn't work. Syntax Checker doesn't error on this.

      Notes: I would like to be able to apply .gif images but some of the reading I've done it says in 2004 you can only use jpg. Is that true?

      If any additional information is needed I'll be more then happy to provide it.

      Thanks in Advance
      Braden