Updated Flashpaper Embedder

After Ryan went through a fair amount of effort to help get me on MXNA, I thought it was only fair that I get some ColdFusion posting in. (Especially after last night’s drunken geekery.)

A while back I posted about creating a CFC that would embed dynamically created Flashpaper created by <cfdocument>. However, it didn’t create Webstandards compliant XHTML code. So, I updated it to do so using a variation on the Satay Method.

Now I know I’m outputting from a CFC, but frankly, I really don’t like custom tags, so I do this sort of thing in CFC format.

Check out the updated code: Flashpaper Embedder.

11 thoughts on “Updated Flashpaper Embedder

  1. Thanks, I found this useful, also thanks for flagging up Satay. I don’t mean to nit-pick but the CFC throws an error as it’s missing a double quote here:
    <cfif overwrite or not fileExists(#This.cachedirectory#/#arguments.filename#”)>

    If you set the overwrite arg to false it will also throw an error.

    Using a cache directory for files is okay if your site doesn’t have many Flashpaper files but what if it does? A load of files can quickly build up especially if each file is unique to every user. It would be nice if there was a way to embed Flashpaper but serve it from memory. Not sure how?


  2. Thanks, it’s not nitpicking, they are legitimate issues.

    The error with overwrite=”FALSE” has been fixed. The code I use to display code with coloring caused the missing quote.

    As for the temp display of it, I’m intrigued. That does sound like a better way of doing it. I too am not sure how to, but I’m going to think on it.


  3. I accepted my own challenge(!) and created a new custom tag (I couldn’t think how to do it cleanly with a CFC) that embeds PDF and FlashPaper documents without creating any files. Also lets you embed multiple docs (mix PDF and Flash if you like) on the same page. I needed something like this for my current project. It doesn’t use Satay – no need as I “cheated” and used an iframe and session vars glued together with a spot of JavaScript. I will post a url to the file when I’ve uploaded. Feel free to critique! 🙂


  4. Gary: It’s really cool code. However I can’t seem to make it webstandards compliant and work in IE at the same time. So it’s an alternative solution to the issue, depending on your needs.

    That being said, it’s very cool.


  5. It was a combination of that and the formatting of the Javascript. However when I tried to correct them to make them web compliant, they stopped working in IE. I think cross browser compatibility is more important than Webstandards compliance in this case. So a Cacheless Webstandards Compliant Flashpaper Embedder is a Platonic Ideal for now.


  6. What’s wrong with the formatting of the javascript? Surely it’s the same format for XHTML? Whatever goes inbetween the SCRIPT tags is governed by the ECMA JS standard. If you can give me examples of what it should be then I can try to work on it. Thanks.


  7. Actually it was the script tags themselves. Pretty much all tags have to be lowercase. Additionally, it requires a type for script. I have what I had done at home, I can email it to you later.


  8. Oops, lower case, of course! I’m so used to doing upper case for tags and lower for attributes – it makes it easier to read. Thanks.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s