TerrenceRyan.com

I'm a 35 year old redhead geek from Philly.
I'm currently a Developer Evangelist for Adobe.
Also the author of Driving Technical Change

Updated Flashpaper Embedder

11 Comments

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 responses so far ↓

  • 1 Gary Fenton

    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:<BR>
    <cfif overwrite or not fileExists(#This.cachedirectory#/#arguments.filename#")>
    <BR>
    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 Terrence Ryan

    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 Gary Fenton

    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 Fenton

    Here's a link to my new tag. I've called it CF_EmbedDocument. <a href="http://www.hotfusion.co.uk/embedDocument/index.htm">http://www.hotfusion.co.uk/embedDocument/index.htm</a> (or click on my name).<BR>

    I can't use a CFC because the tag is called once as a regular cfm page (which CFCs can't) and again as a custom tag.

    Unfortunately my website runs PHP, not CF so there's no live demo. You can house it here if you think it's worthy enough. Ideas for improvements welcomed.
  • 5 Terrence Ryan

    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.
  • 6 Gary Fenton

    Thanks for the feedback. What bit isn't "webstandards compliant"? The iframe element?
  • 7 Terrence Ryan

    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.
  • 8 Gary Fenton

    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.
  • 9 Terrence Ryan

    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.
  • 10 Gary Fenton

    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 Comment









Categories

Monthly Archives

Tag Cloud

coldfusion web development flex coldfusion builder appearances squidhead coldfusion builder extensions higher ed html5 flash builder air mobile android driving technical change adobe apptacular running a coldfusion shop adobemax06 movable type flash catalyst flash css blackberry adobemax07 adobemax08 hero finicky adobemax09 holy crap i’m a mobile developer centaur phonegap basecamp cfc whichelement unfuddle motorola metablog irrational characters ios git evangelism edge devices code reviews ant wharton subversion security rhino philly philadelphia multidevice knowledge@wharton jobs javascript java browserlab adobemax10 adobe tv unfuddlecfc svnauth.cfc semantic html semantic html responsive web design qnx nlb linux jquery mobile it github flexorg fireworks eclipse dreamweaver apps apple adobemax11