473,372 Members | 782 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,372 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 2002

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!
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.