Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
how to embed .swf file in my asp.net page.[^]


i was followed the above link
i got the Error while i open the file in asp.net

"microsoft jscript runtime error 'null' is null or not an object javascript"
can anyone help me..??

thank you,
Posted
Comments
Zafar Sultan 19-Jun-13 8:52am    
Which file? The link above is working fine.
Sergey Alexandrovich Kryukov 19-Jun-13 9:06am    
What help do you expect. Any code sample?
—SA

1 solution

Use Chrome to try to work out what line is generating the error. Post code if you want us to fix it for you.

The most likely issue is that you're using document.getElementById and getting null back and not checking. You should use jquery instead of just javascript.

Another guess would be that you copied the code in the link blindly and didn't add the properties it needs to work.
 
Share this answer
 
v2
Comments
King Fisher 20-Jun-13 0:17am    
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0"
width="734" class="style3">
<param name="movie" value="<%=swfFilename %>">
<param name="quality" value="high">
<embed src="<%=swfFilename %>" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="1003" height="850"></embed>
</object>


this is my design code for flash player


public string swfFilename;

i had declare this variable


try
{
if (con1.State == ConnectionState.Closed)
{
con1.Open();
}

SqlCommand cmd = new SqlCommand("select registrationkey from tbl_registration where userId='"+lblusername.Text+"' ", con1);
dr = cmd.ExecuteReader();
dr.Read();
if (dr.HasRows)
{
Random_keys = dr[0].ToString();
dr.Close();

//SqlCommand cmd3 = new SqlCommand("select count(id) from tbl_questionSelection where Random_keys='"+Random_keys+"' ", con1);
//dr = cmd3.ExecuteReader();
//dr.Read();
//if (dr.HasRows)
//{
// a =int.Parse( dr[0].ToString());
// dr.Close();
//}
//else
//{
// dr.Close();
//}

//for (int j = 0; j < a; j++)
//{
// SqlCommand cmd4 = new SqlCommand("select id from tbl_questionSelection where Random_keys='"+Random_keys+"'", con1);
// dr = cmd4.ExecuteReader();
// dr.Read();
// if (dr.HasRows)
// {
// id_no = Convert.ToInt32(dr[0].ToString());
// dr.Close();
// }
// else
// {
// dr.Close();
// }

SqlCommand cmd1 = new SqlCommand("select q_id from tbl_questionSelection where Random_keys='" + Random_keys + "'", con1);
SqlDataAdapter da=new SqlDataAdapter(cmd1);
DataSet ds=new DataSet();
da.Fill(ds);


//dr = cmd1.ExecuteReader();
// dr.Read();
// if (dr.HasRows)
// {
// q_id = int.Parse(dr[0].ToString());
// dr.Close();
// }
// else {
// dr.Close();
// }

// if(ds.Tables[0].Rows.Count!=0)

//for( int j = 0;j
Christian Graus 20-Jun-13 0:20am    
I don't see why this should work. Where is your dataset used for anything ? Where is swfFilename set ? I'd use a property for that value, to make sure that when your aspx tries to read it, the code is run to return the value. Ultimately, if you have HTML in the browser, read the source to see what is wrong or missing, and debug from there.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900