ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

flash files in entries

July 31, 2007 9:57am

Subscribe [0]
  • #1 / Jul 31, 2007 9:57am

    Nutmeg

    111 posts

    I am sure this must have been discussed at length, but I cannot find a thread which provides a solution. How can we embed a flash file in a normal news/blog entry?

  • #2 / Jul 31, 2007 10:16am

    PXLated

    1800 posts

    Try searching on “.flv” or “.fla” and you’ll find several threads and also a plugin.

  • #3 / Jul 31, 2007 12:59pm

    e-man

    1816 posts

    I always use sfwobject to embed flash and use a custom field {flash} to put my embed code in.

  • #4 / Jul 31, 2007 6:43pm

    Nutmeg

    111 posts

    Hi e-man, I concur with sfwobject which validates nicely. Do you paste your entire code in your custom field or only the flash file? It’s fine for me to do this but this would not work for my client. I guess you would need to hard code the (entry) template and create a custom field which works similar as uploading an image, non?
    I know this sounds pretty simple, but I don’t like excess code in my templates for the occasional use if I can avoid this but simultaneously it needs to be user friendly..

    Does this make sense?

  • #5 / Jul 31, 2007 7:08pm

    e-man

    1816 posts

    I just paste the entire code block into a customfield but I can see how that could be dificult for non-techies 😊
    I guess you could do the following: make a custom field called for example {flash_url} and have your client enter the url to the flash file.
    Then use an embed with an embed variable (I am assuming here all flash files are uniform in size etc…).
    In your template you can have e.g.:

    {exp:weblog:entries weblog="default_site"}
    other content here
    {embed="code/flash" url="{flash_url}"}
    other content here
    {/exp:weblog:entries}

    The embed could look something like this:

    <div id="flashcontent">You need <strong>Adobe Flash 8 or later</strong> to view this content.
    <a href="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash&promoid=BIOW">This is a free download at adobe.com</a></div>
    
       var so = new SWFObject("{embed:url}", "x", "500", "334", "8", "#2F3C4A");
       so.write("flashcontent");

    That keeps your EE template fairly clean.
    If you’re new to embed variables read the excellent aricle on Jambor-ee.
    Just a suggestion though 😊

  • #6 / Oct 31, 2007 8:47pm

    gomika

    3 posts

    Hi,

    I’m struggling a bit. I use swfobject and it works when visiting the site on a mac. On a windows machine I get an error: “swfobject is not defined”. Perhaps I’m not referencing the javascript file correctly in my template. Can somebody perhaps tell me what the best place is to put the js file and what is the best method to reference it inside my templates?

    BTW, perhaps there is another cause for this error, but I don’t know.

    Thanks,
    Gonzo

  • #7 / Nov 01, 2007 5:48am

    gomika

    3 posts

    I got it working!

    Now I reference the flash file this way (changed the location of the file):

    “<*****t src=“h**p://192.168.1.11/~gonzo/devbannerite/swfobject.js” type=“text/javascript” charset=“utf-8”><******t>”

    I also have created a custom field called “flash” and placed this inside that field on an entry:

    <div id="flashcontent">
      This text is replaced by the Flash movie.
    </div>
    
    
       var so = new SWFObject("https://ellislab.com/asset/images/ent-partner-logo/homeflash1.swf", "mymovie", "520", "170", "8", "#336699");
       so.write("flashcontent");

    It didn’t work before on Windows because I was referencing the js file this way:

    “<******t src=”/themes/site_themes/default/swfobject.js” type=“text/javascript”><******t>”

    Where do you advice to have js files for placed on the server. Files like mootools, etc?

    Thanks,
    Gonzo

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases