Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • hickoryFornander 32 posts 52 karma points
    Dec 11, 2009 @ 05:37
    hickoryFornander
    0

    How to embed .swf in Umbraco?

    I am trying to add a .swf to my first index page. When finishing playing the flash movie will redirect the user to the web site. But I can not get the .swf to work inside Umbraco. Can someone please tell me what I am doing wrong.

    Step by step what I have done so far:

    1. Created a doc type for my index page. (No media picker)

    2. Created a xslt file and a matching macro. In the xslt file I put the code

     

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp " "> ]>
    <xsl:stylesheet
        version="1.0"
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
        xmlns:msxml="urn:schemas-microsoft-com:xslt"
        xmlns:umbraco.library="urn:umbraco.library"
        exclude-result-prefixes="msxml umbraco.library">


    <xsl:output method="xml" omit-xml-declaration="yes"/>

    <xsl:param name="currentPage"/>

    <xsl:variable name="flashFile" select="/macro/flashFile" />

    <xsl:template match="/">

    <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" id="flashControl" align="middle">
    <xsl:attribute name="width">
      <xsl:value-of select="/macro/width" />
    </xsl:attribute>
    <xsl:attribute name="height">
      <xsl:value-of select="/macro/height" />
    </xsl:attribute>
    <param name="movie">
    <xsl:attribute name="value">
      <xsl:value-of select="$flashFile/node/data [@alias='umbracoFile']" />
    </xsl:attribute>
    </param>
    <param name="quality" value="high" />
    <param name="bgcolor" value="#000000" />
    <embed quality="high" bgcolor="#000000" name="flashControl" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer">
      <xsl:attribute name="width">
        <xsl:value-of select="/macro/width" />
      </xsl:attribute>
      <xsl:attribute name="height">
        <xsl:value-of select="/macro/height" />
      </xsl:attribute>
      <xsl:attribute name="src">
        <xsl:value-of select="$flashFile/node/data [@alias='umbracoFile']" />
      </xsl:attribute>
    </embed>
    </object>


    </xsl:template>

    </xsl:stylesheet>

     

    4. Added three parametrars in the macro, flashFile(mediacurrent), height(number) and width(number).

    5. In my index template I put

    <%@ Master Language="C#" MasterPageFile="/umbraco/masterpages/default.master" AutoEventWireup="true" %>

    <asp:Content ContentPlaceHolderID="ContentPlaceHolderDefault" runat="server">
    <umbraco:Macro flashFile="1066" width="800" height="400" Alias="Intro" runat="server"></umbraco:Macro>
     
    </asp:Content>

    When adding the macro I browsed for the .swf, named flashFile, located in the media file.

    6. Created a new content page and publishing it. Nothing is shown in the browser and I do not get any errors.

     

    What am I missing, have I forgot something? This is my first time using Umbraco...

    Thankful for all the help I can get!

  • Rik Helsen 670 posts 873 karma points
    Dec 14, 2009 @ 15:51
    Rik Helsen
    0

    Why don't you make a seperate page template for the welcomepage including the flash code ?

  • dandrayne 1138 posts 2262 karma points
    Dec 14, 2009 @ 16:08
  • hickoryFornander 32 posts 52 karma points
    Dec 16, 2009 @ 01:54
    hickoryFornander
    0

    Rik, I have already one seperate template for the welcomepage which I named the index page, because this is the first page the user will see. I made it work in Coda with only the autogenerated html code from flash, but now I need to make it work in Umbraco and also to make it possible for the end user to easily change the flash movie. I have been looking at many different examples but none of them works.

    Thank you Dandrayne, I will have a look at the tutorial and I get back to you if I still cant get it to work!

  • hickoryFornander 32 posts 52 karma points
    Dec 16, 2009 @ 08:56
    hickoryFornander
    0

    It works like a charm=)  Thanks a lot Dandrayne!

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies