Displaying flash inside SmartEdit
When it comes to successfully implimenting complex Flash (1) inside a Reddot project you’ve two approaches. Either you carefully explain to the client that you may not get to see it working inside smartEdit, or you get the Flash developer to make sure that they develop it in a manner that’s going to work for you.
The first thing you want to make sure of is that all references to these additional files are “relative” (/file.swf) rather than “absolute” (http://www.you.com/file.swf). This way you’re going to be able to make Reddot understand the next step.
You also want to try and have these references in the javascript that displays the Flash, rather than inside the flash file itself, otherwise there’s no way we can get Reddot to show the full animation. So you want to end up with something like this
var so = new SWFObject("/swf/flash_header.swf?xmlFile=flash_header.xml&activeTab=1","flash_header", "100%", "100%", "8", "#FFFFFF");
When this comes into Reddot you can store all of your flash related files in your media library and use them like any other media item.
var so = new SWFObject("< % med_flashVideo %>?xmlFile=< % med_xmlFile %>&activeTab=1", "flash_header", "100%", "100%", "8","#FFFFFF");
Looking good, but we’re not entirely there yet. There is one issue that we’ve found with this piece of code and that’s browser and network cache’s not refreshing your files when they get updated. Our resolution to this was to introduce a random number after med_flashXml so the browser goes and checks for all the files each time.
var so = new SWFObject("< % med_flashVideo %>?xmlFile=< % med_xmlFile %>%3Fr=" + Math.random() + "&activeTab=1","flash_header", "100%", "100%", "8", "#FFFFFF");
%3Fr is the escaped version of a question mark, so by the time it reaches your browser it comes up as xmlFile=flash_header.xml?r=0.407955533772088
This should now enable you to show your happy client a site that is all singing, all dancing inside Reddot. It also allows you to take it one step further and convert the xml files to content classes and allow them to be editable, which should make everyone much happier.
(1) When I talk about complex flash I mean that it refers to additional files for it’s functionality.
|
|
|
|
|
![]() |
