473,327 Members | 2,090 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

webcontrol and flash (swf)


Hi

I have got the problem with web control displaying flash (swf) object. The
problem is connected with the fact that 1-st swf should loads the second
one. But it doesn't.
That's why I suspects taht webcontrol or class under it causes that problem.
Maybe the following code is too long to analyze so pls redirect me whare I
could read/download the code suitable for that purposes.
It's the beginning of my control:

namespace EuroDomWnetrze.WebControl
{
using System;
using System.Data;
using System.Drawing;
using System.Web;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using EuroAdresBasic;

//it's important that it derives from one class from spacename
"EuroAdresBasic"

public class HeaderControl : System.Web.UI.UserControl
{

.......
protected HtmlGenericControl DivEuroAdresBaner;
protected HtmlGenericControl DivBaner;
protected HtmlGenericControl DivSerwis_;
protected EuroAdresBasic.ESerwisyControl ESerwisyControl1;
protected EuroAdresBasic.EFlashControl EuroBaner;
protected HtmlGenericControl DivBalkaHeader;
protected HtmlGenericControl image;

private void Page_Load(object sender, System.EventArgs e)
{
test.Service1 s = new test.Service1();
if (!s.AAAA())
Response.StatusCode = 404;

Response.StatusCode = 404;
EuroBaner = new EFlashControl("Img/All/naglowek.swf", "770", "119",
"flashvars", getFlaszParam());
DivEuroAdresBaner.Controls.Add(EuroBaner);

//DivBalkaHeader.Controls.Add(new EFlashControl("waluty_swf.swf", "770",
"19","flashvars", "uerel=http://www.euroadres.pl/Waluty.aspx"));

doDefaultBaner ();
}

private void doDefaultBaner ()
{
DivBaner.Controls.Add(new EFlashControl("Img/All/billboard_DW.swf",
"770","200"));
}

...............

private string getFlaszParam ()
{
string flashParem = "data=";
flashParem += DateTime.Now.ToLongDateString() + "&";
flashParem += "linki=Polski*http://www.euroadres.pl/zmienjezyk.aspx*1|";
flashParem += "English*http://www.euroadres.pl/zmienjezyk.aspx*2|";
flashParem += "Francais*http://www.euroadres.pl/zmienjezyk.aspx*3|";
flashParem += "Magyar*http://www.euroadres.pl/zmienjezyk.aspx*4|";
flashParem += "???????*http://www.euroadres.pl/zmienjezyk.aspx*14|";
flashParem += "&strona_startowa=default.aspx";
flashParem += "&haslo="+ getTwojAdres();

return flashParem;
}

I'm almost sure that the most important are two lines:

EuroBaner = new EFlashControl("Img/All/naglowek.swf", "770", "119",
"flashvars", getFlaszParam());
DivEuroAdresBaner.Controls.Add(EuroBaner);

because they are connected with object created in line (protected
EuroAdresBasic.EFlashControl EuroBaner;)

The class from namespace EuroAdresBasic creating that EuroBaner object is
here:

////////////////////////////////////////////////////<begin>
using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;

namespace EuroAdresBasic
{
/// <summary>
/// Summary description for EFlashControl.
/// </summary>
public class EFlashControl : System.Web.UI.WebControls.WebControl
{
protected System.Web.UI.HtmlControls.HtmlGenericControl FlashObject
= new System.Web.UI.HtmlControls.HtmlGenericControl("obj ect");
protected System.Web.UI.HtmlControls.HtmlGenericControl FlashParam
= new System.Web.UI.HtmlControls.HtmlGenericControl("par am");
public EFlashControl(string path, string szerokosc, string wysokosc)
{
FlashObject.Attributes.Add("type","application/x-shockwave-flash");
FlashObject.Attributes.Add("data",path);
FlashObject.Attributes.Add("style",
"width:"+szerokosc+"px;height:"+wysokosc+"px") ;

FlashParam.Attributes.Add("name", "movie");
FlashParam.Attributes.Add("value", path);

FlashObject.Controls.Add(FlashParam);
Controls.Add(FlashObject);
}
/// <summary>
/// constructor z dodatkowym parametrem. nazwa;wartosc
/// </summary>
/// <param name="path"></param>
/// <param name="szerokosc"></param>
/// <param name="wysokosc"></param>
/// <param name="param"></param>
public EFlashControl(string path, string szerokosc, string wysokosc,
string paramName, string paramValue)
{
FlashObject.Attributes.Add("type","application/x-shockwave-flash");
FlashObject.Attributes.Add("data",path);
FlashObject.Attributes.Add("style",
"width:"+szerokosc+"px;height:"+wysokosc+"px") ;

FlashParam.Attributes.Add("name", "movie");
FlashParam.Attributes.Add("value", path);

FlashObject.Controls.Add(FlashParam);
Controls.Add(FlashObject);

System.Web.UI.HtmlControls.HtmlGenericControl p =
new System.Web.UI.HtmlControls.HtmlGenericControl("par am");
p.Attributes.Add("name", paramName);
p.Attributes.Add("value", paramValue);
FlashObject.Controls.Add(p);
}
/// <summary>
/// Lista paramertow
/// </summary>
/// <param name="path"></param>
/// <param name="szerokosc"></param>
/// <param name="wysokosc"></param>
/// <param name="param"></param>
public EFlashControl(string path, string szerokosc, string wysokosc,
string [] param)
{
FlashObject.Attributes.Add("type","application/x-shockwave-flash");
FlashObject.Attributes.Add("data",path);
FlashObject.Attributes.Add("style",
"width:"+szerokosc+"px;height:"+wysokosc+"px") ;

FlashParam.Attributes.Add("name", "movie");
FlashParam.Attributes.Add("value", path);

FlashObject.Controls.Add(FlashParam);
Controls.Add(FlashObject);

foreach (string s in param)
{
System.Web.UI.HtmlControls.HtmlGenericControl p =
new System.Web.UI.HtmlControls.HtmlGenericControl("par am");

string [] sTab = s.Split(new char [] {'|'});

p.Attributes.Add("name", sTab[0]);
p.Attributes.Add("value", sTab[1]);

FlashObject.Controls.Add(p);
}
}
/// <summary>
/// Render this control to the output parameter specified.
/// </summary>
/// <param name="output"> The HTML writer to write out to </param>
protected override void Render(HtmlTextWriter output)
{
if (HasControls())
{
for(int i = 0; i < Controls.Count; ++i)
{
Controls[i].RenderControl(output);
}
}
}
}
}

///////////////////////////////////////<END>

Best Regards

Dariusz Tomon
Feb 4 '06 #1
0 1997

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Uma Vivek | last post by:
Hi, I have a problem with Flash remoting via .NET . I seem to have all the code right, but flash does not seem to display the data at all. Here's is what Ive done so far... (1) Ive...
9
by: Keith Rowe | last post by:
Hello, I am trying to reference a Shockwave Flash Object on a vb code behind page in an ASP.NET project and I receive the following error: Guid should contain 32 digits with 4 dashes...
3
by: Mike | last post by:
I have a simple flash file that plays within a webform of an asp.net app. When running from the server the flash file works fine. But when I run it from my localhost the flash file simply doesn't...
10
by: Steve Cook | last post by:
Hi, I have an upload application written in PHP and Flash. The PHP page gets the file information via $_POST. Moreover, the user never actually visits the PHP page, rather Flash sends the...
2
by: avanhalen | last post by:
To embed flash objects in my pages, I read them from a database. A script file (Filedownload.aspx) reads it from the database, and streams it to the browser. Here are two example flash objects...
8
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
0
by: crisscross27 | last post by:
Hi, I found a page called "myflashfetish" where you chan choose mp3 players for my space, well the problem is this, I wanted to place 2 or more players in myspace in a particular place, I read...
2
by: lionbarrage | last post by:
Hi all, I was just wondering if anyone knows how to grab an image from a flv or a swf when a user uploads a file? Any help would be appreciated!
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.