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.
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.
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
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.
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
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
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
is working on a reply...