-
I am new to xml and I would like to change my current blog reader on my site from loading html to loading xml. How would I go about doing this? I know I need to do this:
//load the xml,
//parse the xml, and
//create a new object
-----------------------------
Here is my xml structure
Code:
<blog>
<entry>
<*date>Date<*/date>
<*time>Time Of Post<*/time>
<*text>News text<*/text>
<*links>Featured Links<*/links>
<*author>Person Posted<*/author>
</entry>
</blog>
---------------------------------------
my xml file:
http://www.stumede.com/flashkit/blog.xml
my not working swf file:
http://www.stumede.com/flashkit/xml.swf
----------------------------------------
I did try downloading some of the xml movies flashkit has, and understood very little on how to do this..
Any help or ideas on how to do this would be great.
Thanks,
sam
[Edited by diavolo on 04-18-2001 at 08:15 AM]
-
It would be better if it loaded html, loading variables is alot faster than parsing xml files.
I started by blog off with parsing xml and decided to change to loading html into a html enabled textfield!
-
good, that's the way mine is right now. I just want to learn more on how to import and xml file in flash. For instance, how would I just add xml text to flash? Thanks for your help Guy!
sam
-
SORRY - LONG REPLY
well, it might be easier for you to read the help section on the XML object, but basically you do this:
- create a new XML object
var myXMLDoc = new XML();
- add an 'onload' event handler to your object
(this is the name of the function to call when the file has loaded)
myXMLDoc.onload = myOnloadFunction;
- load your XML file into the object
myXMLDoc.load("url");
once the file has loaded, the function myOnloadFunction is automatically called. use this function to either parse the XML document or to go to a part in the flash movie that handles this job.
I found that the easiest way is to include all the data as XML tag attributes rather than as text like you did, so you do:
<BLOGItem date="19th April 2001">
<LINK url="http:// 1" descr="this and that"/>
<LINK url="http:// 2" descr="this and that"/>
<LINK url="http:// 3" descr="this and that"/>
</BLOGItem>
( the /> at the end are automatic closing statements, you can also write <LINK ...></LINK> )
****, this is getting long!
anyway, have a look in the help sections under XML.attributes and XML.hasChildNodes and XML.childNodes etc. etc. and just experiment - that's what I did....
[I don't know anything about XML, maybe it's all wrong...]
-
yeah - so, I'm a bit thick and didn't realise I had to format that bit as code....
how's that go?
-
f*ck - and it should have been
onLoad (with capital L) instead of onload...
this is getting worse and worse
-
haha thanks man--this will help a great deal.
sam
-
So will loading and parsing the XML work on the WEB?? I can't figure that out as of yet. I have a perfect XML newsfeed configured, but it will just NOT work on the web, only locally. Let me know if anyone has accomplished, because I've had no luck
[Edited by Mistaderelict on 04-19-2001 at 10:13 PM]
-
Enemem
Enemem,
Great post... xml was the last bit of flash trickery I have been putting off... as (my) luck would have I was asked to create some flash content that involves xml data (sure I can do that, I said "translation: if I say no then he'll think I am a wieny") ...anyways you probably saved me an hour or two of research... so thanks..
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|