Join Todd Perkins for an in-depth discussion in this video Working with XML attributes using E4X, part of ActionScript 3.0: Working with XML.
Now let's talk about working with XML attributes using E4X syntax. If you are following along, I am working in 02_creating_attributes.fla in the Chapter 2 folder in the exercise files folder. Let's go to the first key from the Actions Layer and open up the Actions Panel. Now creating attributes in XML is actually just as simple as creating XML elements. All we have to do is put the "@" before the element name. For example, let's say we want the file name element to be an attribute instead of an element.
I am going to click right before file name and right after the dot and after image, I am going to type an "@". Now when I test the movie, we will see that file name is now an attribute instead of an element. I can see that here in the first line of our XML. So that's all you have to do to create XML attribute. You just use the "@" sign. Now let's say we wanted to reference that attribute later. In a trace statement right after image, I am just going to type ".@" for attribute and then file name, test the movie again.
We get pic1.jpeg. So working with attributes in E4X is as simple as typing the "@" symbol.
- Understanding XML data
- Creating XML in ActionScript 3.0
- Working with external XML data
- Building a reusable RSS reader class
- Using PHP with XML
- Working with blogs
- Working with Flickr images using the Flickr API
- Working with podcasts
Skill Level Intermediate
1. Understanding XML Data
2. Creating XML in ActionScript 3.0
3. Working with External XML Data
4. Building a Reusable RSS Reader Class
5. Using PHP with XML Data
6. Working with Blogs
7. Working with the Flickr API
8. Working with Podcasts
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.