I just started learning Silverlight and I failed to use a transparent background for my Silverlight app in my asp.net page. I have searched on the internet and found that these two lines should fix it:
<param name="background" value="Transparent" />
<param name="pluginbackground" value="Transparent" />
but unfortunately it didn't. Here is the way i embed the Silverlight app:
<form id="form1" runat="server" style="height:100%">
<div id="silverlightControlHost">
<object data="data:SilverlightApplication4," type="application/x-silverlight-2" width="100%" height="100%">
<param name="source" value="ClientBin/SilverlightApplication4.xap"/>
<param name="onError" value="onSilverlightError" />
<param name="background" value="Transparent" />
<param name="pluginbackground" value="Transparent" />
<a href="http://go.microsoft.com/fwlink/?LinkID=149156&v=4.0.50826.0" style="text-decoration:none">
<img src="http://go.microsoft.com/fwlink/?LinkId=161376" alt="Get Microsoft Silverlight" style="border-style:none"/>
</a>
</object><iframe id="_sl_historyFrame" style="visibility:hidden;height:0px;width:0px;border:0px"></iframe></div>
</form>
and this is my Silverlight code:
<UserControl x:Class="SilverlightApplication4.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="400" Loaded="UserControl_Loaded" BorderBrush="Transparent">
<StackPanel x:Name="LayoutRoot" Height="147" Width="226" Background="Transparent">
<StackPanel.Resources>
<Storyboard x:Name="FirstStoryBoard">
<DoubleAnimation Storyboard.TargetName="FirstEllipse"
Storyboard.TargetProperty="Width"
To="1" AutoReverse="True"
Duration="00:00:01" />
</Storyboard>
</StackPanel.Resources>
<TextBlock Text="Hello, World!" HorizontalAlignment="Center" Name="txtMessege" />
<Ellipse Name="FirstEllipse" Height="100" Width="200" Fill="SlateBlue" />
<Button Name="FirstButton" Width="100" Content="Click" Click="FirstButton_Click" />
</StackPanel>
</UserControl>
Try with these parameters:
<param name="background" value="Transparent" />
<param name="windowless" value="True" />
You might need to restart the browser too.
Related
I have a HTML div on the top of flash object(flex-3). Its coming in IE-8. But its not coming on Chrome/Firefox. Problem is that when I open developer tool of those two browser its coming.
So the problem is that without developer tool its not appearing on the screen.
I used Z-index, display:block, param name="wmode" value="opaque" as well.
<script>
function setupDivDimensions(){
var bodyElement = document.getElementsByTagName('body')[0];
var bodyW = bodyElement.clientWidth;
var bodyH = bodyElement.clientHeight;
document.getElementById('flexContainerMain').setAttribute("style","position:relative;width:"+bodyW+";height:"+bodyH);
document.getElementById('flexContainerMain').style.width=bodyW;
document.getElementById('flexContainerMain').style.height=bodyH;
document.getElementById('uam_boxes').setAttribute("style","z-index:3;display:block;");
document.getElementById('flexContainer').setAttribute("style","z-index:1;position:absolute;top:0;left:0;display:block;width:"+bodyW+";height:"+bodyH);
document.getElementById('flexContainer').style.width=bodyW;
document.getElementById('flexContainer').style.height=bodyH;
}
</script>
<body onload="setupDivDimensions();">
<input type="hidden" id="globalLogoutUrl" name="globalLogoutUrl"
value="/logout/page/link/goes/here" />
<input type="hidden" id="appLogoutUrl" name="appLogoutUrl" value="<%=request.getContextPath()%>/Logout" />
<f:verbatim>
<div id="flexContainerMain">
<div id="uam_boxes"></div>
<div id="flexContainer"><Object id="flex" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%"
height="100%" codebase="https://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="<%=request.getContextPath()%>/flex/MyFlashPage.swf" />
<embed src="<%=request.getContextPath()%>/flex/MyFlashPage.swf" width="100%" height="100%" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="wmode" value="opaque" />
<param name='flashVars'
value='userName=<h:outputText value="#{USER_OBJECT_KEY.userName}"/>&selMenuId=<h:outputText value="#{menuController.selectedMenuItem.menuId}"/>&selMenuTitle=<h:outputText value="#{menuController.selectedMenuItem.title}"/>' />
</object></div>
</div>
<div style="display:none">
<form name="redirection" action="" method="post" width="0" height="0"><f:verbatim>
<a style="margin-right:20px;" class="globalLinkBranding"
onmouseover="isStatusAvail = false;window.status='Logout';return true" onmouseout="isStatusAvail = true;"
id="uam_modal"> Logout </a>
</form>
</div>
</f:verbatim>
</body>
So I have this html wrapper from Flash CS5.5, but the swf file isn't showing the video skin in PHP unless I use iframe. The problem I am having is I would like to use a similar outcome to this
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="980" height="380" id="g-max_banner" align="middle">
<param name="movie" value="im/stuff/vid.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" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="im/stuff/vid.swf" width="980" height="380">
<param name="movie" value="im/stuff/vid.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" />
<!--<![endif]-->
<iframe width="980" height="380" src="http://www.youtube.com/embed/videoseries?list=PLlLcNiMNCMn_4dR6TZQCTVfY7qo51VJ8A"></iframe>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
So that when someone doesn't have flash it pulls the youtube playlist instead. Is there a way I can do this using iframe since the video skin embedded in the swf doesn't show up on the webpage using the above code? I have tested it with a basic iframe call and the skin shows up, so I know it works fine. Thanks for any help!
nevermind, I fixed it. You can use the html wrapper in php that Flash creates. You just need to put the skin file in the root folder on your website host where the configuration file is.
Am trying to get a full screen flash movie playing behind my HTML content.
I have succeeded with it doing that, but the problem is it does not stretch full screen.
My DIV:
<div id="flashmovie" style="width:100%;height:100%;position:absolute; z-index:-999;left:0;top:0">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="100%" height="100%">
<param name="movie" value="resources/video/bg_grass.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent">
<param name="scale" value="exactfit">
<param name="salign" value="t">
<embed src="resources/video/bg_grass.swf" quality="high" type="application/x-shockwave-flash" width="100%" height="100%" wmode="transparent" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
</div>
Any ideas?
make its position fixed, with a 100% height and width.
Should probably do the trick.
Greeting,
have a swf file which content a FlvPlayback play to play targeted video.
It is working OK when I run published HTML file from flash professional CS5.
but when I embedded this flash to asp.net content page using object tag the move will pay but the video controls play and stop with disappear.
I listed down the code I sued.
Please advice.
<%# Page Title="" Language="C#" MasterPageFile="~/Master.Master" AutoEventWireup="true" CodeBehind="Home.aspx.cs" Inherits="HabibWebSite.Home" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
<object width="700" height="700">
<embed src="Flash/FlashPlayer.swf" type="application/x-shockwave-flash" width="700" height="700"></embed>
</object>
</asp:Content>
Update
The swf file is depend on other files such as skin file, image, video each...
these file are on same folder where is my swf file located and they are all under one folder my my VS2010 project. When I run the swf file from the folder in the VS2010 project is working OK but when I embed it to aspx page I will miss some controls in the flash.
I tried another swf file that depend on external resource to run such as xml file, and images, jscript fie and the swf file will lunch but will not work and there is no images would appear but still when I run the swf file from the VS2010 project will run OK.
I'm listing down the following :
1-html code for the htlm file generated by flash professional CS5 to lunch the flash in browser.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>FlashPlayer</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
html, body { height:100%; background-color: #ffffff;}
body { margin:0; padding:0; overflow:hidden; }
#flashContent { width:100%; height:100%; }
</style>
</head>
<body>
<div id="flashContent">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="473" height="269" id="FlashPlayer" align="middle">
<param name="movie" value="FlashPlayer.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" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="FlashPlayer.swf" width="473" height="269">
<param name="movie" value="FlashPlayer.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" />
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</body>
</html>
2-the code I used to lunch the swf file with aspx.
<%# Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="HabibWebSite.WebForm1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
html, body { height:100%; background-color: #ffffff;}
body { margin:0; padding:0; overflow:hidden; }
#flashContent { width:100%; height:100%; }
</style>
</head>
<body>
<form id="form1" runat="server">
<div id="flashContent">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="473" height="269" id="FlashPlayer" align="middle">
<param name="movie" value="Flash/FlashPlayer/FlashPlayer.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" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="Flash/FlashPlayer/FlashPlayer.swf" width="473" height="269">
<param name="movie" value="Flash/FlashPlayer/FlashPlayer.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" />
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</form>
</body>
</html>
3-html code generated when lunch the aspx page.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><title>
</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
html, body { height:100%; background-color: #ffffff;}
body { margin:0; padding:0; overflow:hidden; }
#flashContent { width:100%; height:100%; }
</style>
</head>
<body>
<form method="post" action="WebForm1.aspx" id="form1">
<div class="aspNetHidden">
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNjI2MjY0OTg0ZGS7bT2BP5w5OjKaeICJTgBmmuzIKMGdB9pFIMPQCLbAiw==" />
</div>
<div id="flashContent">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="473" height="269" id="FlashPlayer" align="middle">
<param name="movie" value="Flash/FlashPlayer/FlashPlayer.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" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="Flash/FlashPlayer/FlashPlayer.swf" width="473" height="269">
<param name="movie" value="Flash/FlashPlayer/FlashPlayer.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" />
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
</form>
</body>
</html>
Are you showing the complete and tags you're using? This will not work in all browsers.
ASP.NET pre se is not doing anything be producing an html page that contains the html markup you specify. So I suggest creating a static html page and embedding your player in there and make sure things work as you expect. Once you have your html page (and the markup) working the way you expect, you can copy the tag and paste it into your aspx page.
Here is my code in Site.master
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
width="980" height="337" id="flashheader" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="header.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="../../Content/flash/header.swf" quality="high" bgcolor="#ffffff" width="980"
height="337" name="header" align="middle" allowscriptaccess="sameDomain" allowfullscreen="false"
type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer" />
</object>
it is inside div (i've read somewhere that width should be defined for IE)
#header
{
width: 980px;
margin: 0 auto;
text-align: center;
background-image: url('designimages/header.png');
background-repeat: no-repeat;
}
also i tryed:
It is simple animation, and it works ok in Firefox and Chrome. What could be wrong?
TIA
Wrong path to your movie in the param?
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0"
width="980" height="337" id="flashheader" align="middle">
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="false" />
<param name="movie" value="../../Content/flash/header.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<embed src="../../Content/flash/header.swf" quality="high" bgcolor="#ffffff" width="980"
height="337" name="header" align="middle" allowscriptaccess="sameDomain" allowfullscreen="false"
type="application/x-shockwave-flash" pluginspage="http://www.adobe.com/go/getflashplayer"></embed>
</object>