I have this page that works great in every browser I've tried except IE. It uses javascript to pass variables to a .swf and whenever I look at it in IE it give me this error:
'flashvideoplayer' is null or not an object.
This is the page that I'm working on: http://www.hightechhigh.org/video/index2.php
The function that is giving me problems is this: - function initialize() {
-
flashvideoplayer = window.videoplayer;
-
}
-
[HTML]<body onLoad="initialize();" >[/HTML]
.... which refers to my .swf file here:
[HTML]<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="450" height="338" name="videoplayer" />
<param name="allowScriptAccess" value="always" >
<param name="movie" value="video.swf" />
<embed src="video.swf" quality="high" bgcolor="#ffffff" width="450" height="338" name="videoplayer" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" id="videoplayer" >
</object>
[/HTML]
Unfortunately I only know enough javascript to be dangerous so
any help or suggestions would be greatly appreciated.
15 3337
You have an error in Firefox too:
flashvideoplayer.playVideo is not a function.
You have an error in Firefox too:
flashvideoplayer.playVideo is not a function.
Thanks.
I fixed the cause of the error but found that it did not effect the problem that I'm having with IE.
Since you've given the OBJECT tag an id of "videoplayer", use document.getElementById("videoplayer") to refer to it.
Since you've given the OBJECT tag an id of "videoplayer", use document.getElementById("videoplayer") to refer to it.
Thank you very much for taking time to reply to my post.
I changed how the variable "flashvideoplayer" was defined from: - flashvideoplayer = window.videoplayer;
to: - flashvideoplayer = document.getElementById('videoplayer');
My original error went away but was replaced with this new one: 'videoplayer' is undefined
Any ideas??
Which line does this occur on?
It should be a line using "videoplayer" - perhaps that should be changed to flashvideoplayer?
Which line does this occur on?
It should be a line using "videoplayer" - perhaps that should be changed to flashvideoplayer?
http://www.hightechhigh.org/video/index2.php
IE is telling me that the error is on Line: 1 Char:1
I changed all instances of "videoplayer" to "flashvideoplayer" and saved it to: http://www.hightechhigh.org/video/index3.php
This variation also works fine on other browsers but gives me the following error in IE: Line: 48
Char: 3
Error: Object expected This variation does not seem like a step in the right direction. Line 48 is within the following function that is only called from a link to "start video": 42. function initFlashPlayVideo() {
43.
44. var video = "";
45. updateStatus("____" + video + "____");
46. flashvideoplayer.playVideo(video);
47. document.pauseButton.src = pauseButton.src ;
48. var play_V = document.getElementById('PLAY');
48.
50. //update page elements
51. play_V.innerHTML = "";
52. }
You have two elements with the same "flashvideoplayer" ID: the object and embed tag. IDs must be unique. On top of that, the name of the embed tag is also flashvideoplayer and IE is easily confused between name and ID.
I'm not sure if this will solve it, but it may help.
You have two elements with the same "flashvideoplayer" ID: the object and embed tag. IDs must be unique. On top of that, the name of the embed tag is also flashvideoplayer and IE is easily confused between name and ID.
I'm not sure if this will solve it, but it may help.
I think it helped, I no longer have an error when the page loads in IE.
Now when I make a selection from the pull down list I am getting the following error from IE: Line: 33
Char: 1
Error: 'flashvideoplayer' is null or not an object Line 33 is this line within in the following function: flashvideoplayer.playVideo("" + video); - /* When the user selects a movie from the pull down list on the the form, update the videoStatus text area, and call the playVideo() function within the SWF file, passing it the URL of the FLV file. */
-
function callFlashPlayVideo() {
-
var comboBox = document.forms['videoForm'].videos;
-
var video = comboBox.options[comboBox.selectedIndex].value;
-
updateStatus("____" + video + "____");
-
flashvideoplayer.playVideo("" + video);
-
var play_V = document.getElementById('PLAY');
-
-
//update page elements
-
get_movie_info('getInfo.php?flv='+ video +'&return=all','film_title','video_info-title','video_info-desc','<img src="gifs/loading_animation.gif" width="30" alt="loading.."border="0">');
-
play_V.innerHTML = "";
-
-
}
I'm not sure, but this link might help in your struggles with the embed tag, i.e. try using object only.
I'm not sure, but this link might help in your struggles with the embed tag, i.e. try using object only.
Yes it was helpful. I simplified some of the Object tags and it changed my IE error message once again.
Now when I make a selection from the pull down list I am getting the following error from IE:
Line: 33
Char: 1
Error: Object doesn't support this property or method.
Line 33 is this line within in the following function: flashvideoplayer.playVideo("" + video); - /* When the user selects a movie from the pull down list on the the form, update the videoStatus text area, and call the playVideo() function within the SWF file, passing it the URL of the FLV file. */
-
function callFlashPlayVideo() {
-
var comboBox = document.forms['videoForm'].videos;
-
var video = comboBox.options[comboBox.selectedIndex].value;
-
updateStatus("____" + video + "____");
-
flashvideoplayer.playVideo("" + video);
-
var play_V = document.getElementById('PLAY');
-
-
//update page elements
-
get_movie_info('getInfo.php?flv='+ video +'&return=all','film_title','video_info-title','video_info-desc','<img src="gifs/loading_animation.gif" width="30" alt="loading.."border="0">');
-
play_V.innerHTML = "";
-
-
}
So at least it's now recognising "flashvideoplayer" as an object.
What does your object tag look like now? There's no other elements with a name or id of "flashvideoplayer" now, is there?
Hi,
i have also same problem like you.... can you give me what was your solution to avoid this problem.....
i have used same like you:
var isIE = navigator.appName.indexOf("Microsoft") != -1;
flashvideoplayer = (isIE) ? window['videoPlayer'] : document['videoPlayer'];
but still it is giving error in IE....
videoPlayer is undefined....
and let me know is there any possibility of js error in .swf file..... for creating object
plase give me replay as soon as possible.....
Thanks,
Nilesh
Hi
Maybe this might help you.
Hi,
my flash embeded is like following:
[HTML]<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="740" height="420" id="FileUpload" align="middle">
<param name="allowScriptAccess" value="always" />
<param name="movie" value="FileUpload.swf?cookies=<?= $cookieString ?>&contentId=<?= $contentId ?>" />
<param name="quality" value="high" />
<param name="bgcolor" value="#e1e2ff" />
<embed src="FileUpload.swf?cookies=<?= $cookieString ?>&contentId=<?= $contentId ?>" quality="high" bgcolor="#e1e2ff" width="740" height="420" name="FileUpload" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
[/HTML]
in that object tag have id="FileUpload" while embed tag have name="FileUpload" ...
is it causing any problem in IE?
when my page is loading at that time only it is giving me error in IE
"FileUpload" is undefined
i donot have much idea on flash.. so, can you tell me is it possible any javascript programming in .swf file? and may be it is casing the problem to creating object of "FileUpload"
is any wrong parameter is passed or we need more parameters in object or embe tag in IE?
Thanks,
in that object tag have id="FileUpload" while embed tag have name="FileUpload" ...
is it causing any problem in IE?
Yes, that is a problem in IE. IE is confused between id and name. Keep names and ids unique (to avoid IE's bug).
Sign in to post your reply or Sign up for a free account.
Similar topics
by: RMD |
last post by:
I need to be able to keep a list of object references, and null them out one
by one at a later point in time. I realize this can be dangerous, but I have
my reasons.
I can't figure out, however,...
|
by: Mikhail Teterin |
last post by:
Hello!
Consider the following simple accessor function:
typedef struct {
int i;
char name;
} MY_TYPE;
const char *
|
by: David Sworder |
last post by:
Hi,
I've created a UserControl-derived class called MyUserControl that is
able to persist and subsequently reload its state. It exposes two methods as
follows:
public void Serialize(Stream...
|
by: yossi.kreinin |
last post by:
Hi!
There is a system where 0x0 is a valid address, but 0xffffffff isn't.
How can null pointers be treated by a compiler (besides the typical
"solution" of still using 0x0 for "null")?
-...
|
by: toton |
last post by:
Hi,
In some cases when my function returns, I need to return a object of
null state. This is when I return object by value.
(Just like for by pointer, I can return a null pointer ).
It has to be...
|
by: lovecreatesbea... |
last post by:
Do you prefer malloc or calloc?
p = malloc(size);
Which of the following two is right to get same storage same as the
above call?
p = calloc(1, size);
p = calloc(size, 1);
|
by: MikeT |
last post by:
This may sound very elementary, but can you trap when your object is
set to null within the object?
I have created a class that registers an event from an object passed
in the constructor. When...
|
by: grbgooglefan |
last post by:
I am in a perculiar situation. I want to use PyRun_SimpleString for
creating Python functions in embedded Python in C++.
But there could be cases when Python function code compilation could
fail &...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
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...
|
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
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |