Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • tlg_sydney 2 posts 21 karma points
    Sep 29, 2009 @ 07:47
    tlg_sydney
    0

    Random XML List for Flash

    Hi,

    I'm hoping someone can answer this for me, or at least point me in the right direction.. i've been scratching my head for days.

    From my currentPage, I need to pull together a random list of childnodes containing image links into an xml ready to pass onto flash. Sounds pretty easy, I can pull together the list no problems, however I'd like to do the following before the XML is generated.

    1. Detect browser height & width - Javascript maybe? 

    2. Calculate maximum number of 120px x 160px thumbnails which will fit within the browser height & width

    3. Generate a looped list of childnodes until the XML contains the maximum number of thumbnails calculated in step 2.

    Any suggestions would be great, all of the above can be done in action script, however I would like to minimise the amount of data I am passing to the flash file. 

    Chris

  • Josh Townson 67 posts 162 karma points
    Sep 29, 2009 @ 11:05
    Josh Townson
    0

    The only way I'm aware you can detect browser (viewport) width and height is with javascript, which means that it'll all have to be done client side, because the other factors will depend on it.

    Point 3 would be really easy to do in xslt (even randomly sorted), but it requires information not available until the page is fully rendered (viewport dimensions). Assuming the reason you only want to output the desired number of childnodes is because you would potentially have a large number of them, then my best suggestion would be to make a second call to an xml page that just gets the childnodes desired (try an alternate template - http://www.nibble.be/?p=42) to generate the xml for the flash file

  • Thomas Kahn 602 posts 506 karma points
    Oct 02, 2009 @ 09:12
    Thomas Kahn
    0

    The calculations you mention looks like a perfect job for jQuery! In jQuery  there are excellent functions to get metrics like browser width and height and do all sorts of calculations.

    /Thomas Kahn

Please Sign in or register to post replies

Write your reply to:

Draft