Page 1 of 1
Using flash XML as a Global Content Block ??
Posted: Wed Jul 11, 2007 10:16 pm
by pixelvandal
G'Day
I have a swf that's sort of like a photo slideshow. Image paths, transition times etc are getting referenced by a .xml file and i store my images in a uploads/images/banners/ folder.
I call my .xml file from within the flash action script. Does anyone know of anyway of calling a {Global Content Block} within the .fla so then I can just put the xml file in that {GCB} so it can be administrated very easy?
Cheers
Adrian
Re: Using flash XML as a Global Content Block ??
Posted: Thu Jul 12, 2007 9:07 am
by scooper
Hmmm - nice question. Short answer is "Nope, I don't know".
My first approach though would be to try using a template rather than a global content block. That way you're going to minimse confusion about doctypes and the like.
Create a new template with just your XML in - you don't even need to have content tags in or anything if you want to keep it in one place. Then just create a page using that template. You can then reference the xml using that page alias. When you want to update the XML you just edit the template instead of a global content block.
The nice way to do it would probably involve writng a module that outputs a static file of course, but, hey, that sounds like work.
Re: Using flash XML as a Global Content Block ??
Posted: Thu Jul 19, 2007 1:14 am
by pixelvandal
Work,,,,, yeah!
Thanks for your reply,
The reasoning behind the {GCB} was to make it easy for the client to update their own flash banner images via the admin system.
I'll have a play when i get some time and post the results back up here.
Cheerio
Re: Using flash XML as a Global Content Block ??
Posted: Thu Jul 19, 2007 9:12 am
by scooper
well in one of those strange twists - this morning I've just had to implement a video playlist using yep, an XML playlist.
Sooo - the way I've done it is to create a template called 'XML playlist'
Code: Select all
<?xml version="1.0" encoding="utf-8"?>
<playlist version="1" xmlns="http://xspf.org/ns/0/">
<trackList>
{content}
</trackList>
</playlist>
Then I've created a page - called 'goalPlaylist' with the tracklisting in. You could of course stick this in a global content block and have theat in the template instead of {content}, but because I'm going to need a couple of playlists I've gone for separate pages.
So the page looks like:
Code: Select all
<track>
<title>Placeholder</title>
<creator>millipedia</creator>
<location>placeholder.flv</location>
</track>
<track>
<title>Another placeholder</title>
<creator>Still millco</creator>
<location>placeholder2.flv</location>
</track>
<track>
<title>Guess what</title>
<creator>You get the idea</creator>
<location>placeholder3.flv</location>
</track>
and then to wrap it all up, I've got the video player. In this case I'm using flvplayer and passing the playlist page via javascript.
Code: Select all
<__script__ type="text/javascript">
var so = new SWFObject('uploads/video/flvplayer.swf','player','400','355','7');
so.addParam("allowfullscreen","true");
so.addVariable("file","goalPlaylist.html");
so.addVariable("displayheight","220");
so.addVariable("backcolor","0xffffff");
so.addVariable("frontcolor","0x666666");
so.addVariable("lightcolor","0x557722");
so.write('player');
</__script>
And it works a treat. Obviously yours will differ slightly but at the least the principle of using an XML playlist with Flash is working fine.