More in this section

Forums / Developing with Sitefinity / Getting Flash to run

Getting Flash to run

11 posts, 0 answered
  1. Sharon
    Sharon avatar
    28 posts
    Registered:
    29 Jul 2008
    30 Jan 2009
    Link to this post
    I'm trying to port an existing site to Sitefinity and have some questions about getting the flash to run.

    Here's what I had in the old site:

     

    <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>

    <script type="text/javascript">
    AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','580','height','191','src','images/asa','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','movie','images/asa' ); //end AC code
    </script><noscript><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="580" height="191">
              <param name="movie" value="images/asa.swf" />
              <param name="quality" value="high" />
              <embed src="images/asa.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="580" height="191"></embed>
            </object></noscript>

    So in my master file I put:

     

     

    <script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script>

     

     

     

    inside the <head>

    and in <body><form> I added
     

    <td class="flashcontainer">

     

     

     

    <div>

     

     

     

    <asp:ContentPlaceHolder id="cphFlashPics" runat="server">

     

     

     

    </asp:ContentPlaceHolder>

     

     

     

    </div>

     

     

    </td>

     

    I also modified ~/Sitefinity/Admin/ControlTemplates/GenericContent/EditorTemplate.ascx to set 

     

     

    <

     

    telerik:RadEditor
    runat="server"
    ID="RadEditor1"
    ContentAreaCssFile="~/Sitefinity/Admin/Themes/Default/AjaxControlsSkins/Sitefinity/EditorContentArea.css"
    ToolsFile="~/Sitefinity/Admin/ControlTemplates/EditorToolsFile.xml"
    Skin="WebBlue"
    NewLineBr="False"
    Height="360px"
    Width="98%">
    <ImageManager ViewPaths="~/Images" UploadPaths="~/Images" DeletePaths="~/Images" />
    <MediaManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" />
    <FlashManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" MaxUploadFileSize="307200"/>
    <DocumentManager ViewPaths="~/Files" UploadPaths="~/Files" DeletePaths="~/Files" />
    <CssFiles>
    <telerik:EditorCssFile Value="~/Sitefinity/Admin/Themes/Default/AjaxControlsSkins/Sitefinity/EditorCssFile.css" />
    </CssFiles>
    </
    telerik:RadEditor>
    RadEditor1.DisableFilter(EditorFilters.RemoveScripts);

    At this point the file is loaded and when I display the page I get a frame with a picture icon in it.

    I'm probably being dense but how do I get it to actually play. I saw in another example that someone was using an swfobject.js file and an swfobject do I need to hunt that down or will the AC_RunActiveContent.js that I have work? If so, what do I need to do to my master to get this to actually play?

    Thanks for your help!

     

  2. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    03 Feb 2009
    Link to this post
    Hello Sharon,

    You can try to call your javascript in the master page like this:
    <%@ Register Assembly="Telerik.Cms.Web.UI" Namespace="Telerik.Cms.Web.UI" TagPrefix="sfWeb" %> 
    ..somewhere in the <head> or in the <body> 
    <sfWeb:JsFileLink ID="JsFileLink2" runat="server"
     
    FileName="~/relative_path_to_your_javascript" />  

    Other than that, we do not stop the flash objects to run in any way. If the paths are fine, you should not face any problems.

    Kind regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Sharon
    Sharon avatar
    28 posts
    Registered:
    29 Jul 2008
    06 Feb 2009
    Link to this post

    Georgi, thanks for your suggestion. I didn't end up needing the JSFileLink but your comment about paths was key.

    I finally got it to run by getting a copy of swfobject.js from  http://code.google.com/p/swfobject/

    In my <head> section I put:
    <script type="text/javascript" src="http://localhost/mysite/Files/swfobject.js"></script>

     

     

     

    <script type="text/javascript">

     

     

     

    var flashvars = {};

     

     

    var params = {};

     

     

    var attributes = {};

     

    swfobject.embedSWF(

    "http://localhost/mysite/Files/my.swf", "myAlternativeContent", "580", "191", "9.0.0", false, flashvars, params, attributes);

     

     

    </script>

    Then in my <body> section I put:

     

    <

     

    div id="myAlternativeContent">

     

     

     

     

     

    <table width="100%">

     

     

     

     

     

    <tr>

     

     

     

     

     

    <td>

     

     

     

     

     

    <asp:ContentPlaceHolder id="cphFlashContainer" runat="server">

     

     

    </asp:ContentPlaceHolder>

     

     

     

     

     

    </td>

     

     

     

     

     

    <td align="center">

     

     

     

     

    To see the full set of pictures:

    <br />

     

     

     

     

     

    <a target=_blank href="http://www.adobe.com/go/getflashplayer">

     

     

     

     

     

    <img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" border="0"/>

     

     

     

     

     

    </td>

     

     

     

     

     

    </tr>

     

     

     

     

     

    </table>

     

     

     

     

     

    </div>

    That way I can use the Sitefinity admin interface to place whatever picture I want to show if they don't have the right flash player or javascript.

    My remaining question is why I can't use ~/Files for the pathname and have to use http://localhost/mysite/Files/?

    Thanks again for your help!

    Sharon

     

  4. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    06 Feb 2009
    Link to this post
    Hello Sharon,

    I am glad you have a progress with this issue. As for your second question, the relative paths with tilde (~) are resolved on the server side. This means that the control having such path in one of its properties, should run on the server side as well. Then, you should place runat="server" attribute:

    <script type="text/javascript" runat="server"
     src
    ="~/path/swfobject.js"></script>  

    Let me know if you have any other questions.

    Regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. Frank
    Frank avatar
    25 posts
    Registered:
    14 Jul 2008
    23 Feb 2009
    Link to this post
    Georgi,

    When I try your suggestion I get an error when I load a page using the masterpage. The error is "Collection was modified; enumeration operation may not execute. "

    What should I do?

    Thanks,
    Frank
  6. Sharon
    Sharon avatar
    28 posts
    Registered:
    29 Jul 2008
    24 Feb 2009
    Link to this post
    FWIW, I wasn't able to get that to work for me either. I just haven't had any time to work on it lately. I ended up leaving the path set to http://localhost/mysite that's working for now.
  7. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    25 Feb 2009
    Link to this post
    Hello,

    Can you paste the entire message and stack trace? There is something we are missing in the discussion.

    Greetings,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  8. Sharon
    Sharon avatar
    28 posts
    Registered:
    29 Jul 2008
    25 Feb 2009
    Link to this post
    Georgi,
      If Frank doesn't beat me to it, I'll do this tomorrow. I have a document deadline today and won't get a chance until tomorrow.

    Thanks for your help,
    Sharon
  9. Sharon
    Sharon avatar
    28 posts
    Registered:
    29 Jul 2008
    11 Mar 2009
    Link to this post
    Sorry it took me so long to respond. Here's where I'm at right now.

    If I use the internal IP address of my development server, it runs fine.
    <head runat="server">
        <title>Untitled Page</title>
        <meta http-equiv="content-type" content="text/html; charset=utf-8" />
        <meta http-equiv="content-language" content="en" />
        <meta name="author" content="xxx" />     
     <script type="text/javascript" src="http://1.1.1.1/Mysite/Files/swfobject.js"></script>
     <script type="text/javascript">
      var flashvars = {};
      var params = {};
      var attributes = {};
      swfobject.embedSWF("http://1.1.1.1/Mysite/Files/asa.swf", "myAlternativeContent", "580", "191", "9.0.0", false, flashvars, params, attributes);
     </script>    
        <asp:ContentPlaceHolder id="cphHead" runat="server">
        </asp:ContentPlaceHolder>
    </head>

    If I use ~ instead, nothing works and I get my default picture and the get flash button instead.

    When I copy the mysite folder to my production server, even if I use notepad and edit my master file to put the right IP address in, I get nothing for the flash and I even get a broken picture link for my default picture but the get flash button shows up
  10. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    12 Mar 2009
    Link to this post
    Hello Sharon,

    Could you please send me:
    1. Your flash movie that you want to run
    2. Your javascript files
    3. Information about the exact version number of Sitefinity.

    I will set this locally and test it.

    Best wishes,
    Georgi
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  11. Sharon
    Sharon avatar
    28 posts
    Registered:
    29 Jul 2008
    12 Mar 2009
    Link to this post
    Thanks Georgi,
      I'm sending the files in on a support ticket. FWIW, my version is 3.5.1747 Standard edition.

    Funnily enough, I got it to run last night on the production server by having the master file reference the IP address of the development server.

    It almost seems like the ~ is not resolved into the file name before the Javascript is called and the Javascript can't handle resolving the ~.

    Thanks again for your help,
    Sharon
Register for webinar
11 posts, 0 answered