Connecting Tech Pros Worldwide Forums | Help | Site Map

problem with flash player

Newbie
 
Join Date: Sep 2007
Location: Bangalore
Posts: 12
#1: Sep 21 '07
hi..
i have a flash player embeded in javascript.

it plays the audio well in Mozilla ..

When i run it in the IE..it blinks "loading.." and nothing happens.But some time it runs correctly.. But any time it runs i need to double(twice) click on the play button.



The object whihc i have is

<object type="application/x-shockwave-flash" data="Mp3Player.swf" id="Mp3Player" width="300" height="30">
<param name="movie" value="Mp3Player.swf" />
<embed src="Mp3Player.swf" width="300" height="30" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" id="Mp3Player">
</embed>
</object>

Any solution to this problem.

thanks
vinni

xNephilimx's Avatar
Expert
 
Join Date: Jun 2007
Location: Buenos Aires, Argentina
Posts: 200
#2: Sep 22 '07

re: problem with flash player


Hi vinniurheart!
Do you have an exaple of the program uploaded somewhere?
Because I don't see a reason for that to be failing.
Also if you can post the actionscript code will be very usefull.

Kind regards,
The_Nephilim

Quote:

Originally Posted by vinniurheart

hi..
i have a flash player embeded in javascript.

it plays the audio well in Mozilla ..

When i run it in the IE..it blinks "loading.." and nothing happens.But some time it runs correctly.. But any time it runs i need to double(twice) click on the play button.



The object whihc i have is

<object type="application/x-shockwave-flash" data="Mp3Player.swf" id="Mp3Player" width="300" height="30">
<param name="movie" value="Mp3Player.swf" />
<embed src="Mp3Player.swf" width="300" height="30" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" id="Mp3Player">
</embed>
</object>

Any solution to this problem.

thanks
vinni

Newbie
 
Join Date: Sep 2007
Location: Bangalore
Posts: 12
#3: Sep 25 '07

re: problem with flash player


thanks so much for the reply buddy..!!!
Here is the code....

<!--html code-->

<object type="application/x-shockwave-flash" data="Mp3Player.swf" id="Mp3Player" width="300" height="30">
<param name="movie" value="Mp3Player.swf" />
<embed src="Mp3Player.swf" width="300" height="30" quality=high pluginspage="http://www.macromedia.com/go/getflashplayer" type='application/x-shockwave-flash' id="Mp3Player">
</embed>
</object>

<!--ends here--------->

<script>


function playsong(song)//called once click on the url
{
detect_browser("Mp3Player").asFunc(song);
}

function detect_browser(song)//for crossbrowser,returns true if it's IE else False
{
alert(navigator.appName);
var isIE = navigator.appName.indexOf("Microsoft") != -1;
return (isIE) ? window[song]:document[song];
}

looking for the help........

cheeeers,
vinni
xNephilimx's Avatar
Expert
 
Join Date: Jun 2007
Location: Buenos Aires, Argentina
Posts: 200
#4: Oct 4 '07

re: problem with flash player


Hi! Sorry for the late reply! I've been very bussy.
I think the error might bee here

Expand|Select|Wrap|Line Numbers
  1. var isIE = navigator.appName.indexOf("Microsoft") != -1;
  2.       return (isIE) ? window[song]:document[song];
  3.  
More exactly in the last line, you put window[song], but when using the array object notation (like an associative array), the index must be passed as a string, otherwise the script will look for a song variable and it won't find it. If for some reason it works in firefox I don't know why.
Is the song a variable? If not correct that, pass it as a string (between quotes) like this window["song"]:document["song"];
Another thing I find strage in your code is that your movie's id is "Mp3Player", that's why I need to know if song is a variable containing this value, "Mp3Player", or what.

Please if you didn't post the full code, post it, because I need to see it completely.

Best regards,
The_Nephilim


Quote:

Originally Posted by vinniurheart

thanks so much for the reply buddy..!!!
Here is the code....

<!--html code-->

<object type="application/x-shockwave-flash" data="Mp3Player.swf" id="Mp3Player" width="300" height="30">
<param name="movie" value="Mp3Player.swf" />
<embed src="Mp3Player.swf" width="300" height="30" quality=high pluginspage="http://www.macromedia.com/go/getflashplayer" type='application/x-shockwave-flash' id="Mp3Player">
</embed>
</object>

<!--ends here--------->

<script>


function playsong(song)//called once click on the url
{
detect_browser("Mp3Player").asFunc(song);
}

function detect_browser(song)//for crossbrowser,returns true if it's IE else False
{
alert(navigator.appName);
var isIE = navigator.appName.indexOf("Microsoft") != -1;
return (isIE) ? window[song]:document[song];
}

looking for the help........

cheeeers,
vinni

Newbie
 
Join Date: Sep 2007
Location: Bangalore
Posts: 12
#5: Oct 10 '07

re: problem with flash player


hi..
thanks so much for the reply..

song is the path of the file which i want to play.
and i think i messed it up in the last post..sorry..

its like this.


<!--indus.html-->

<script>
function functin name
{
playsong( 'path of the song')
</script>

<!--ind.html ends here-->


<!-- this is js file-->
<script>
function playsong(song)
{
detect_browser("Mp3Player").asFunc(song);
}
</script>


<script>
function detect_browser(player_id)
{
var isIE = navigator.appName.indexOf("Microsoft") != -1;
return (isIE) ? window[player_id]:document[player_id];
}
</script>
<!-- js file ends here-->



Looking for the solution .........

Thanks again for the reply ...

regads,
vinni
xNephilimx's Avatar
Expert
 
Join Date: Jun 2007
Location: Buenos Aires, Argentina
Posts: 200
#6: Oct 11 '07

re: problem with flash player


What version of Flash are you using?
I totally recomend you to use the ExternalInterface class over the asFunc thingy. ExternalInterface lets u communicate ActionScript with Javascript back and forth. asFunc is totally deprecated since ages.
You can find reference of ExternaiInterface here http://www.thescripts.com/forum/thread694359.html

Under the title "Calling ActionScript from JavaScript and vice cersa"

I'm anyway testing your code, to see wher it might be failing.

Best regards
The_Nephilim

Quote:

Originally Posted by vinniurheart

hi..
thanks so much for the reply..

song is the path of the file which i want to play.
and i think i messed it up in the last post..sorry..

its like this.


<!--indus.html-->

<script>
function functin name
{
playsong( 'path of the song')
</script>

<!--ind.html ends here-->


<!-- this is js file-->
<script>
function playsong(song)
{
detect_browser("Mp3Player").asFunc(song);
}
</script>


<script>
function detect_browser(player_id)
{
var isIE = navigator.appName.indexOf("Microsoft") != -1;
return (isIE) ? window[player_id]:document[player_id];
}
</script>
<!-- js file ends here-->



Looking for the solution .........

Thanks again for the reply ...

regads,
vinni

Newbie
 
Join Date: Sep 2007
Location: Bangalore
Posts: 12
#7: Oct 11 '07

re: problem with flash player


hi xNephilimx,

Thanks again.When i set allowScriptAccess="always" ,i found it strange.
i.e., it never plays the file inFireFox and in IE throws an error like "Object does not support this property or method"..

More interestingly in IE, it throws an error and does not play the file and again if i click on the link it starts playing a song..
i am totally confused with this beavior. i am finding it difficult really...

Please guide me on this...

thanks again..

best regards,
vinni
Newbie
 
Join Date: Sep 2007
Location: Bangalore
Posts: 12
#8: Oct 11 '07

re: problem with flash player


well the error it throws is in the js file.

i.e., exactly in

detect_browser("Player id").asFunc(song to be played)..

gives the error like..Object does not support this property or method

Thanks
vinni
Reply