Sample Flash 2004 App #1: RSS Reader

*** Updated @ 1:59pm EST 9/24/2003 ***

Here is the source code for the sample app I made. It simply uses the Flash Pro Accordion component with RSS XML parsed from various blog sites.

Illustrates:
– how to use the new factory method createObject (used to use attachMovie)
– shows how to use the new callbacks for events (used to be setClick/setChangeHandler (“handlerName”, scopedObject))
– how to get around the security restrictions easily using PHP (10 lines of code)
– how to preload components & classes to allow your preloaders to work in frame 1

Cons:
– I forward reference functions (I got enough shlack from Erik, no more please…)
– I don’t use the XMLConnector component; I couldn’t figure out how to send variables using it to PHP, so just used a LoadVar’s object to get the XML and then pass it to an XML object to parse it
– no loading bar; there are more events than one knows what to do with, so there is little excuse not showing a loading bar while the XML data is retreived form the websites

Hope this helps you learn, as I learned a lot by this small project.

BTW, I straight ganked this idea from Michael at <a href=”http://www.hollowcube.com”>Hollowcube.com</a>. He had one he built in MX very similiar, so that’s why I put his blog first!

Source – ZIP

Update: I have updated the PHP file based on comments from Bertrand Saint-Guillain and Darron Schall to be more secure (I think). Therefore, please know that the php file, both the last one and this one, are a security risk; use at your own discretion, or find a PHP guru who can make it safer.

Comment from Bertrand, “…in fact that (my latest change) should do the trick , but your php script can still be used as an anonymous gateway by anyone (which is not such a big issue, but someone could try to anonymously brute force an htaccess authentification through your script)”

21 Replies to “Sample Flash 2004 App #1: RSS Reader”

  1. Jesse,

    You’re RSS Reader doesn’t work properly in the Safari browser on Mac OS X. I see the accordian pane but it displays a 404 error(?). Works fine in IE 5.2.2 on the same system. Very odd.

  2. Jesse,

    I found a link for you of Eric explaining his version of accordian pane. his example shows up in a safari browser, but most of yours shows up. It’s just the data inside that craps out. I am able to see the title of the blog, and the “Entry|Blog” line but that is all that appears. I am not able to see any of the labels on the accordian panes, or any of the info insode the panes except what I mentioned above. I will try publishing the FLA on my home box later (that is where MX04 demo is right now).

    hope this helps

  3. Jesse,

    I didn’t realize eric had only a view of his example. I thought he explained it a little further than that. Sorry for the lead in the wrong direction.

  4. Yes it will, you just need to include it in a frame BEFORE you attach it. So if you plan to attach it in frame 3, put it on the stage (offscreen) in frame 2.

  5. Thanks Jesse! It’s really great example to get started playing with ‘Flour'(FL04)components! (as well as showing your concept of preloading class)

  6. I see you use a normal textfield. I tried the same thing a couple of days ago with the datagrid in three panes of the accordionpane. For reasons still unknown it would only show me the grid in the first pane. All the other grids were totally gone…weird weird weird…

  7. Actually, I’m using the “TextArea” component, which I’m sure has masking in it which may cause the redraw issues. How to fix? Know idea….

  8. Nice app Jesse!

    It demonstrates a little bug in the components though..

    If you use the mouse scrollwheel, each textArea seems to use the position of the Accordion, rather than its own position when determining if the mouse is over the field.

  9. on second examination, I don’t know why the scrollWheel is playing up. It only goes weird in the version on your main page, but not if you follow the link in this post. I cannot repro it either. What’s the difference between those two versions?

  10. I believe the one on the main page is in some nested, originally Moveable Type derived CSS div tags. I’ve had problems with Flash displaying in divs on my blog before, so I’m not surprised the browser is giving screwy results.

  11. To confirm, I took get the same results when teh text field has focus: middle scroll does not work on main page, middle scroll does work on page alone.

  12. This rules dude

    How can it be modified to say the latest 4 posts of one feed rather than the latest post from several feeds in the accordion’s childs.

    This would need a loop around the tmp_obj.entry = o; section is suppose but i’m stuck.

    Also the bottom of the textArea’s scrollBar is cut off on 8 pro win….. any Ideas?

  13. hi
    the problem i am having with safari is it is turing the xml into html and firefox doesn’t.

Comments are closed.