0

How can i call a specific image tag based on the size parameter of my XML in AS3? I know that track.image will return all the image tags but i am unsure of how to target a specific image tag based on the size tag. My XML is as follows. Cheers in advance for any help.

<track>
  <name>Hello</name>
  <image size="small"></image>
  <image size="medium"></image>
  <image size="large"></image>
</track>

1 Answer 1

1

This will test for a specific attribute:

var myImagePath:String = yourXML.image.(@size == "small");

Where yourXML is the xml object...

If your xml tree is more complicated, just dot your way down from the root. Also - the root node is implied by flash, so you can leave it out.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.