开发者

Embeded swf file with its external resources to Content asp.net page

Under Visual Studio 2010, I’m developing an asp.net application. I added a folder to my project called Flash. Under Flash folder I added a swf file with its external resources to run. The folder content: 1- ScrollingImages.sw开发者_StackOverflow中文版f file to lunch the flash 2- ScrollingImages.xml file that the swf file uses to read images from thumbnails folder 3-thumbnails folder which content images used by swf file.

I can embed the swf file to html easily using this code:

<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" name="ScrollingImages" width="800" height="400" align="middle" id=" ScrollingImages">
    <param name="allowScriptAccess" value="sameDomain" />
    <param name="movie" value=" ScrollingImages.swf" />
    <param name="quality" value="high" />
    <param name="bgcolor" value="#000000" />
    <embed src="ScrollingImages.swf" quality="high" bgcolor="#000000" width="800" height="400" name="ScrollingImages" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
  </object>

But when I use the same code to embed it to asp.net page I will have a problem that the flash will run but I cannot see the images so the swf file unable to locate the xml file and the folder of the images location and they all in the same folder. Here is the code I used in the aspx.net content page.

<%@ Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="Gallary.aspx.cs" Inherits="HabibWebSite.Gallary" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

   <object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" name="ScrollingImages" width="800" height="400" align="middle" id=" ScrollingImages">
        <param name="allowScriptAccess" value="sameDomain" />
        <param name="movie" value=" ScrollingImages.swf" />
        <param name="quality" value="high" />
        <param name="bgcolor" value="#000000" />
        <embed src="ScrollingImages.swf" quality="high" bgcolor="#000000" width="800" height="400" name="ScrollingImages" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
      </object>


</asp:Content>

I also tested it in aspx.net page and I’m getting same result no images appear.

I know that the problem is related to who to embed the swf external resources (the xml file and the images folder) to the aspx.net page but I searched a lot and I could solve it.

Please advise me how solve this problem to make the swf file work OK.

Regards,


To resolve this problem all what I need to add is base attribute to the object tag to direct to the external resources folder. and the code should be some thing like this:

<object type="application/x-shockwave-flash" data=" Flash/ShefBio/chefs_bio.swf" width="970" height="396">
                    <param name="movie" value=" Flash/ShefBio/chefs_bio.swf" />
                    <param name="quality" value="high" />
                    <param name="bgcolor" value="#ffffff" />
                    <param name="play" value="true" />
                    <param name="loop" value="true" />
                    <param name="wmode" value="window" />
                    <param name="scale" value="showall" />
                    <param name="menu" value="true" />
                    <param name="devicefont" value="false" />
                    <param name="salign" value="" />
                    <param name="allowScriptAccess" value="sameDomain" />
                     <param name="base" value=" Flash/ShefBio/" />

    <embed src=" Flash/ShefBio/chefs_bio.swf" quality="high" bgcolor="#000000" width="970" height="396" name="ScrollingImages" 
    align="middle" allowScriptAccess="sameDomain" base=" Flash/ShefBio/"
    type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

  </object>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜