Reading and displaying RSS feeds in Flash MX 2004-03-12 - By BRYAN MASON
Back Jason,
Actually, I am proud to say that I did figure that out for myself finally yesterday! What I did was to put a function call at the end of the XML.onLoad function that takes care of displaying the desired item attribute in the text field. Now, all I have to do is to polish it up a bit and upload it to my web server!
I love lists like this. You guys have been extremely helpful and patient and I really appreciate it!
One last question. Can I determine the number of <item>'s in the object by doing something like this:
var i; i = o.length
??
Thanks again!
Bryan
-- --Original Message-- -- From: Merrill, Jason [mailto:JMerrill@(protected)] Sent: Thursday, March 11, 2004 4:37 PM To: flashnewbie@(protected) Subject: RE: [Flashnewbie] Reading and displaying RSS feeds in Flash MX
Yes.
- keeping it onlist:
:::>Nothing shows up. Is "o" not available outside the function :::>block? Is there :::>a way that I can make it available?
Yes, you are trying to access the o object before the XML is done loading. Darron mentioned this earlier actually (no problem, its a lot to keep track of!) That's why the traces in the code I posted are inside the funciton block. You can tell flash to do whatever you want to let you know its done, like say move the playhead to the next frame where you do your text displays. Just put the desired command in the function block where I put the traces (after the XMLtoObject call). Then do whatever you need to do to display the text - like have it in frame 2 or something.
In other words, don't try and display the XML before its ready.
:::>Also, is there a way of determining how many "item"'s there :::>are dynamically? :::>Since I am going to be grabbing this from the net, the :::>number of items may :::>change periodically. If I could determine this, I could :::>loop through all of :::>them with a "for".
Yes, any node that has more than one of the same kind is made into an array, so just check the length of the Array, like this:
howManyItems = o.rss.channel.item.length;
Since there are several "item"nodes, item is an array object. Pretty cool huh.
Jason Merrill ICF Consulting Government e-Learning Solutions icfconsulting.com
:::>-- --Original Message-- -- :::>From: BRYAN MASON [mailto:BMASON@(protected)] :::>Sent: Thursday, March 11, 2004 3:29 PM :::>To: 'flashnewbie@(protected)' :::>Subject: RE: [Flashnewbie] Reading and displaying RSS feeds :::>in Flash MX :::> :::> :::>Jason, :::> :::>Did you get my e-mail reply? If not, I will re-post here. I :::>got your code to :::>work, but I have some follow-up questions about how to use :::>the XML Object. :::> :::>Bryan :::> :::>-- --Original Message-- -- :::>From: Merrill, Jason [mailto:JMerrill@(protected)] :::>Sent: Thursday, March 11, 2004 2:08 PM :::>To: flashnewbie@(protected) :::>Subject: RE: [Flashnewbie] Reading and displaying RSS feeds :::>in Flash MX :::> :::> :::>This list is so *&%$#@! slow today! Hopefully, you've seen :::>my reply to this :::>by now. I also replied to you offlist just in case. :::> :::> Jason Merrill :::> ICF Consulting Government e-Learning Solutions :::> icfconsulting.com :::> :::> :::> :::> :::> :::> :::> :::>:::>-- --Original Message-- -- :::>:::>From: BRYAN MASON [mailto:BMASON@(protected)] :::>:::>Sent: Thursday, March 11, 2004 1:31 PM :::>:::>To: 'flashnewbie@(protected)' :::>:::>Subject: RE: [Flashnewbie] Reading and displaying RSS feeds :::>:::>in Flash MX :::>:::> :::>:::> :::>:::>Darron, :::>:::> :::>:::>Thanks for the correction on the var keyword. However, I :::>:::>tried your code and :::>:::>it still comes back as undefined. I'll keep playing with it. :::>:::> :::>:::>Bryan :::>:::> :::>:::>-- --Original Message-- -- :::>:::>From: Darron J. Schall [mailto:darron@(protected)] :::>:::>Sent: Thursday, March 11, 2004 12:40 PM :::>:::>To: flashnewbie@(protected) :::>:::>Subject: Re: [Flashnewbie] Reading and displaying RSS feeds :::>:::>in Flash MX :::>:::> :::>:::> :::>:::>> The .as file is in the same dir as the FLA. I saved the :::>:::>XML that I got :::>NOTICE: :::>This message is for the designated recipient only and may :::>contain privileged :::>or confidential information. If you have received it in :::>error, please notify :::>the sender immediately and delete the original. Any other :::>use of this e-mail :::>by you is prohibited. :::> :::>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- :::>-- ------ :::>Supported by Fig Leaf Software :::>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- :::>-- ------ :::>Lower Prices for Certified Training! Check out new lower prices for :::>Certified Macromedia Training from Fig Leaf Software. Expand your :::>skill set with courses in ColdFusion, Flash, Rich Internet :::>Applications and .NET in the new year. Fig Leaf Software provides :::>the highest caliber instruction at our training centers in :::>Washington :::>D.C., Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at :::>your location. :::> :::>Get the details at http://training.figleaf.com/ :::>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- :::>-- ---- -- :::>To unsubscribe, e-mail: :::>flashnewbie-unsubscribe@(protected) :::>For additional commands, e-mail: :::>flashnewbie-help@(protected) :::> :::> :::>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- :::>-- ------ :::>Supported by Fig Leaf Software :::>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- :::>-- ------ :::>Lower Prices for Certified Training! Check out new lower prices for :::>Certified Macromedia Training from Fig Leaf Software. Expand your :::>skill set with courses in ColdFusion, Flash, Rich Internet :::>Applications and .NET in the new year. Fig Leaf Software provides :::>the highest caliber instruction at our training centers in :::>Washington :::>D.C., Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at :::>your location. :::> :::>Get the details at http://training.figleaf.com/ :::>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- :::>-- ---- -- :::>To unsubscribe, e-mail: :::>flashnewbie-unsubscribe@(protected) :::>For additional commands, e-mail: :::>flashnewbie-help@(protected) :::> :::> :::>
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ Supported by Fig Leaf Software -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ Lower Prices for Certified Training! Check out new lower prices for Certified Macromedia Training from Fig Leaf Software. Expand your skill set with courses in ColdFusion, Flash, Rich Internet Applications and .NET in the new year. Fig Leaf Software provides the highest caliber instruction at our training centers in Washington D.C., Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location.
Get the details at http://training.figleaf.com/ -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- To unsubscribe, e-mail: flashnewbie-unsubscribe@(protected) For additional commands, e-mail: flashnewbie-help@(protected)
-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ Supported by Fig Leaf Software -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ------ Lower Prices for Certified Training! Check out new lower prices for Certified Macromedia Training from Fig Leaf Software. Expand your skill set with courses in ColdFusion, Flash, Rich Internet Applications and .NET in the new year. Fig Leaf Software provides the highest caliber instruction at our training centers in Washington D.C., Atlanta, Chicago, Baltimore, Northern Virginia, or on-site at your location.
Get the details at http://training.figleaf.com/ -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -- To unsubscribe, e-mail: flashnewbie-unsubscribe@(protected) For additional commands, e-mail: flashnewbie-help@(protected)
|
|