Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » Flash

XML question

 
Jump to:  
 
timross13
PostPosted: Tue Sep 02, 2008 1:42 pm    Post subject: XML question
       
I keep seeing people talk about XML in Flash and I was curious what they use it for. Is it just for text? Is there any other use for it? Just curious.

Thanks!
 

 
David Stiller
PostPosted: Tue Sep 02, 2008 4:02 pm    Post subject: Re: XML question
       
timross13,

Quote:
So, is there a particular website where I can read up on its
uses?

I can't think of a site that specifically discusses usage scenarios for
XML, but that might just be because XML is so open-ended. In other words,
you can use it for so many things, it may not be worth mentioning them. (I
realize that isn't a particularly helpful answer! It may still be useful,
though, to hear it put in that way, because it underscores how flexible XML
is. The uses are pretty much what you need them to be -- and it all hinges
on how you choose to format your data. XML is effectively just one of many
mechanisms for storing data.)

Quote:
I try to Google this, and get links about xml, but not really
pertaining to Flash. I downloaded an xml editor the other
day and started to play around with it, but I am still not sure
how you would load your xml script into Flash, or is it
loaded into my html editor (Dreamweaver)?

XML is something you load into Flash at runtime (into the SWF, that is;
not into the authoring tool). It means you'll need ActionScript, and the
exact syntax you use depends on what version of ActionScript you're using.
ActionScript 1.0 and 2.0 use one way, and ActionScript 3.0 uses another, but
they're similar in principle. In all cases, you'll use something called the
XML class, which is a class (think of it as a recipe) for creating XML
objects. Classes define objects, so when you look up the XML class in your
Help docs, be on the look-out for the Properties, Methods, and Events
headings in that entry. Properties describe an object's characteristics,
methods describe what an object can do, and events describe what an object
can react to.

You'll edit your XML in something like Notepad, Dreamweaver, or any
other simpletext editor. When you've encoded your information in whatever
format (your custom tags) you think is mose useful, you'll load that data
into Flash and make use of it.

If you look at the Chapter 11 sample files here ...

LINK

.... you'll see an example of a slideshow made in Flash CS3 (ActionScript
3.0) that uses XML to load in photographs.

I totally understand if those files, without the accompanying chapter,
don't make enough sense, but it may at least get you started. You'll also
get some good example code right out of the Help docs for the XML class.


David Stiller
Contributor, How to Cheat in Flash CS3
LINK
"Luck is the residue of good design."
 

 
kolnikoff
PostPosted: Tue Sep 02, 2008 5:30 pm    Post subject: Re: XML question
       
timross13 wrote:
Quote:
I keep seeing people talk about XML in Flash and I was curious what they use it for. Is it just for text? Is there any other use for it? Just curious.

Thanks!

We use it to simulate working aircraft control panels.

An easy example would be that there is a rev counter on a control panel
which fluctuates between 10,000 and 11,000 revs, we are then asked to
show it working between 10,500 and 11,500. We just retype the xml file
to show the two new min and max and run the application again.

Saves having to root through the code to change variables (we'll have
upwards of ten different displays in one prog), a whole lot easier to
read the xml file and make the changes there - especially if you have a
map display co-ords that requires changing to show different parts of
the country.

cheers

kol
 

 
timross13
PostPosted: Tue Sep 02, 2008 5:46 pm    Post subject: Re: XML question
       
Thanks David.

So, is there a particular website where I can read up on its uses? I try to
Google this, and get links about xml, but not really pertaining to Flash. I
downloaded an xml editor the other day and started to play around with it, but
I am still not sure how you would load your xml script into Flash, or is it
loaded into my html editor (Dreamweaver)?

Thanks for the help.
 

 
David Stiller
PostPosted: Tue Sep 02, 2008 5:51 pm    Post subject: Re: XML question
       
timross13,

Quote:
I wish I could tap into your brain!

To a certain extent, that's possible through the Foundation book and my
blog (www.quip.net/blog/). Not everything in the ol' noggin is that
orderly, though. Wink And quite a bit of it is worth a chuckle.

Quote:
I am starting to have an "aha!" moment.

Love to hear that!

Quote:
Thanks for the info. I will see if I can find your book at my local
book shop.

It should be available in all the book shop chains. If you order it
through Amazon, you get free shipping (because the price is a hair over
$25), and if you order it through the URL in my sig, I get a buck and change
out of the sale.

The book goes into considerably more detail on XML -- which you'll see
in the other files included for that chapter's download -- and I'm on these
forums quite a bit, so hesitate to keep asking questions.


David Stiller
Co-author, Foundation Flash CS3 for Designers
LINK
"Luck is the residue of good design."
 

 
timross13
PostPosted: Tue Sep 02, 2008 7:17 pm    Post subject: Re: XML question
       
You are just a wealth of information. I wish I could tap into your brain! I am
starting to have an "aha!" moment. Thanks for the info. I will see if I can
find your book at my local book shop.

Once again, thanks.
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

Srebrne monety strony www Kraków cyfry stelaż opuszczone