Connecting Tech Pros Worldwide Forums | Help | Site Map

Add Rotator SWF Problem

Muhammad Ahsin Saleem
Guest
 
Posts: n/a
#1: Dec 23 '06
Hi EveryBody,

Well I need your help about the Add Rotator.
I want to set the Advertisement File property of the Add Rotator set to
an XML File which contains info about the Adds.

Now Problem is that it does not play the .swf files, but only .gif
files. Code I got from Internet is as follows:
<?xml version="1.0" encoding="utf-8" ?>
<Advertisements>

<Ad>
<ImageUrl>1.swf</ImageUrl>
<NavigateUrl www.google.com.pk </NavigateUrl>
<AlternateText>www.google.com.pk</AlternateText>
<Keyword>S</Keyword>
<Impressions>Flash Site</Impressions>
<Caption>The Elite News</Caption>
</Ad>

</Advertisements>

Kindly Help me to Solve this Problem.

Thanks in Advance.


Mark Fitzpatrick
Guest
 
Posts: n/a
#2: Dec 23 '06

re: Add Rotator SWF Problem


Unforunately, the adrotator only serves up images that use the image tag.
You can't put a flash animation in there as it requires a completely
different set of HTML to be generated. You can't use this control to render
anything but a standard bitmap image.


--

Hope this helps,
Mark Fitzpatrick
Former Microsoft FrontPage MVP 199?-2006


"Muhammad Ahsin Saleem" <ahsin.saleem@gmail.comwrote in message
news:1166859908.148970.61720@a3g2000cwd.googlegrou ps.com...
Quote:
Hi EveryBody,
>
Well I need your help about the Add Rotator.
I want to set the Advertisement File property of the Add Rotator set to
an XML File which contains info about the Adds.
>
Now Problem is that it does not play the .swf files, but only .gif
files. Code I got from Internet is as follows:
<?xml version="1.0" encoding="utf-8" ?>
<Advertisements>
>
<Ad>
<ImageUrl>1.swf</ImageUrl>
<NavigateUrl www.google.com.pk </NavigateUrl>
<AlternateText>www.google.com.pk</AlternateText>
<Keyword>S</Keyword>
<Impressions>Flash Site</Impressions>
<Caption>The Elite News</Caption>
</Ad>
>
</Advertisements>
>
Kindly Help me to Solve this Problem.
>
Thanks in Advance.
>

Muhammad Ahsin Saleem
Guest
 
Posts: n/a
#3: Dec 23 '06

re: Add Rotator SWF Problem


Thanx Mark

Can u tell me about any other control build using the inheritance from
the orignal addrotator class?

I have one but that does not work well code for that Control is as
follows:


Imports System.ComponentModel
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Text
Imports System.Web


<DefaultProperty("Text"), ToolboxData("<{0}:CAdRotator runat=" &
"""server""" & "></{0}:CAdRotator>")Public Class CAdRotator
Inherits System.Web.UI.WebControls.AdRotator
Private blnSWF As Boolean
Private strImgUrl As String
Private strNavUrl As String
Protected Overrides Sub Render(ByVal writer As
System.Web.UI.HtmlTextWriter)
If Me.blnSWF Then
Dim StringFormat As StringBuilder = New
StringBuilder("<object
classid=""clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"" ")

StringFormat.Append("codebase=""http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0""
width={0} height={1}>")

StringFormat.Append("classid=""clsid:D27CDB6E-AE6D-11CF-96B8-444553540000""")
StringFormat.Append("<param name=""_cx"" value=""2646""
/>")
StringFormat.Append("<param name=""_cy"" value=""2646""
/>")
StringFormat.Append("<param name=""FlashVars"" value=""""
/>")
StringFormat.Append(" <param name=""movie"" value={2}>")
StringFormat.Append(" <param name=""Src"" value={2}>")
StringFormat.Append(" <param name=""WMode""
value=""Window"">")
StringFormat.Append(" <param name=""Play"" value=""-1"">")
StringFormat.Append(" <param name=""Loop"" value=""-1"">")
StringFormat.Append(" <param name=""Quality""
value=""High"">")
StringFormat.Append(" <param name=""SAlign""
value=""LT"">")
StringFormat.Append(" <param name=""Menu"" value=""-1"">")
StringFormat.Append(" <param name=""Base"" value="""">")
StringFormat.Append(" <param name=""AllowScriptAccess""
value=""always"">")
StringFormat.Append(" <param name=""Scale""
value=""ExactFit"">")
StringFormat.Append(" <param name=""DeviceFont""
value=""0"">")
StringFormat.Append(" <param name=""EmbedMovie""
value=""0"">")
StringFormat.Append(" <param name=""BGColor""
value="""">")
StringFormat.Append(" <param name=""SWRemote""
value="""">")
StringFormat.Append(" <param name=""MovieData""
value="""">")
StringFormat.Append(" <param name=""SeamlessTabbing""
value=""1"">")
StringFormat.Append(" <param name=""Profile""
value=""0"">")
StringFormat.Append(" <param name=""ProfileAddress""
value="""">")
StringFormat.Append(" <param name=""ProfilePort""
value=""0"">")
StringFormat.Append(" <param name=""AllowNetworking""
value=""all"">")
StringFormat.Append(" </object>")
Dim OutPutString As StringBuilder = New StringBuilder()
OutPutString.AppendFormat(StringFormat.ToString, 468, 60,
Me.ImageUrlField, Me.ImageUrlField)
writer.Write(OutPutString.ToString)
Else
MyBase.Render(writer)
End If
End Sub
Protected Overrides Sub OnAdCreated(ByVal e As AdCreatedEventArgs)
MyBase.OnAdCreated(e)
If e.ImageUrl.ToLower().IndexOf(".swf") <-1 Then
Me.blnSWF = True
Me.strImgUrl = e.ImageUrl
Me.strNavUrl = e.NavigateUrl
Else
Me.blnSWF = False
End If
End Sub
End Class


Kindly adjust it or just tell me about any orher link.

Closed Thread


Similar ASP.NET bytes