Quick Tip: Test to see if an XML attribute is present

Today I received a question about how to check and see if an attribute is present into a XML node.

I thought it wold be a good idea if I post the answer here in case someone else needs to do the same.

This is the ActionScript code:

if(node.@attributeName in node)
    //the attribute is here

As you can see, the code is very simple, “node” is your actual XML node and “attributeName” is exactly what it says, the name of your attribute inside the XML node (the one that you are checking to see if it is there).

Image and Video Slideshow

Just uploaded a new project to ActiveDen. This is a slideshow that will let you display images and play videos.

You can play video from YouTube, Vimeo or your FLV, F4V, MP4 files.
It can load JPG, SWF and PNG files.

If you want to buy it, please check the image below 😉

About CDATA, XML and Flash

How to embed CDATA content in Flash
From here you can download the source files

Supported HTML tags:

Anchor tag (<a>)
Bold tag (<b>)
Break tag (<br>)
Font tag (<font>)
Image tag (<img>)
Italic tag (<i>)
List item tag (< li>)
Paragraph tag (< p>)
Text format tag (<textformat>)
Underline tag (<u>)