Reading and displaying RSS feeds in Flash MX - Finished! 2004-03-12 - By Merrill, Jason
Back Congrats Bryan! Job well done.
I noticed one thing in your .fla though:
myXML.onLoad = function (success){ if (success) { //create Flash object from the XML //the function "toObject()" is located in the .as file o = this.toObject (); } Display(); }
You have Display() outside the if(success){} logic. It works because the XML loads successfully every time, but I would put it inside - otherwise if the XML fails to load, you also aren't trying to display the data. I would change it like this:
myXML.onLoad = function (success){ if (success) { //create Flash object from the XML //the function "toObject()" is located in the .as file o = this.toObject (); Display(); } }
You could also throw up an error if the XML fails, like this:
myXML.onLoad = function (success){ if (success) { //create Flash object from the XML //the function "toObject()" is located in the .as file o = this.toObject (); Display(); } else{ trace('error: XML failed to load'); } }
Jason Merrill ICF Consulting Government e-Learning Solutions icfconsulting.com
:::>-- --Original Message-- -- :::>From: BRYAN MASON [mailto:BMASON@(protected)] :::>Sent: Friday, March 12, 2004 1:34 PM :::>To: 'flashnewbie@(protected)' :::>Subject: RE: [Flashnewbie] Reading and displaying RSS feeds :::>in Flash MX :::>- Finished! :::> :::> :::>A few people expressed interest in seeing the finished :::>project that I have :::>been working on. I have uploaded it to my website along :::>with a link to the :::>original XML file and a zip file with all the original source files, :::>including the FLA. I'd appreciate any comments you may have. :::> :::>A couple of things first, this isn't quite how it will be :::>presented on my :::>site. I just uploaded it quickly so everyone could see it. :::>Second, I still :::>have to find a way of keeping the XML file up to date. I :::>don't want to link :::>right to the XML in Flash because of the security alert :::>that would appear :::>(thanks, Jessie). Right now, I am thinking of using XMLHTTP :::>and FSO on my :::>default.asp page to grab the file and save it to the :::>server. However, I :::>would appreciate any suggestions you may have on how best :::>to do this. :::> :::>Thanks again to Jason, Jessie, Andreas and everyone else :::>who helped. This :::>has been a great actionscript learning experience for me! :::> :::>Here's the link: :::> :::>http://www.glpr.org/testing/xml/paranormal_news.htm :::> :::>Bryan :::> :::>-- --Original Message-- -- :::>From: Merrill, Jason [mailto:JMerrill@(protected)] :::>Sent: Friday, March 12, 2004 10:43 AM :::>To: flashnewbie@(protected) :::>Subject: RE: [Flashnewbie] Reading and displaying RSS feeds :::>in Flash MX :::> :::> :::>Cool! Will look forward to seeing your finished product. :::> :::> Jason Merrill :::> ICF Consulting Government e-Learning Solutions :::> icfconsulting.com :::> :::> :::> :::> :::>:::>-- --Original Message-- -- :::>:::>From: BRYAN MASON [mailto:BMASON@(protected)] :::>:::>Sent: Friday, March 12, 2004 10:31 AM :::>:::>To: 'flashnewbie@(protected)' :::>:::>Subject: RE: [Flashnewbie] Reading and displaying RSS feeds :::>:::>in Flash MX :::>:::> :::>:::> :::>:::>Jason, :::>:::> :::>:::>Yes, I see. Thanks again. :::>:::> :::>:::>A couple of people have asked to see the finished product. :::>:::>I'll upload it to :::>:::>my web site along with the FLA, XML and AS files for :::>:::>download when I'm :::>:::>finished. :::>:::> :::>:::>Bryan :::>:::> :::>:::>-- --Original Message-- -- :::>:::>From: Merrill, Jason [mailto:JMerrill@(protected)] :::>:::>Sent: Friday, March 12, 2004 10:13 AM :::>:::>To: flashnewbie@(protected) :::>:::>Subject: RE: [Flashnewbie] Reading and displaying RSS feeds :::>:::>in Flash MX :::>:::> :::>:::> :::>:::>:::>One last question. Can I determine the number of <item>'s :::>:::>:::>in the object by :::>:::>:::>doing something like this: :::>:::>:::> :::>:::>:::>var i; :::>:::>:::>i = o.length :::>:::> :::>:::>Bryan, :::>:::> :::>:::>If you look at the last e-mail I posted before this one :::>:::>(also included :::>:::>un-trimmed in this e-mail), you'll see I answered that :::>:::>already (and your :::>:::>question about not getting it to display). In short, yes. :::>:::>Check below or :::>:::>in my prior e-mail for the example. :::>:::> :::>:::>Glad you got it working. I don't know why Macromedia :::>didn't/doesn't :::>:::>implement an object model like this for XML already - the :::>:::>XML objects :::>:::>provided are so difficult to navigate through for some :::>:::>people - like me. I :::>:::>mean, its workable, but start doing any thing complicated :::>:::>and it gets messy. :::>:::>Anyhoo - happy you were able to make use of that prototype :::>:::>- wish I had :::>:::>written it myself, but I can't take credit for it. :::>:::> :::>:::> Jason Merrill :::>:::> ICF Consulting Government e-Learning Solutions :::>:::> icfconsulting.com :::>:::> :::>:::> :::>::: :::>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)
|
|