Flash and document.write()

C

Charles

It's strange... The following works:

document.write('<object classid="clsid:D27CDB6E-
AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/
pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="1"
height="1"><param name="movie" value="vinheta1.swf"><embed
src="vinheta1.swf" quality="high" pluginspage="http://
www.macromedia.com/go/getflashplayer" type="application/x-shockwave-
flash" width="1" height="1"></embed></object>');

But the following doesn't:

document.write('<object classid="clsid:D27CDB6E-
AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/
pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="1"
height="1"><param name="movie" value="vinheta' . '1' . '.swf"><embed
src="vinheta' . '1' . '.swf" quality="high" pluginspage="http://
www.macromedia.com/go/getflashplayer" type="application/x-shockwave-
flash" width="1" height="1"></embed></object>');

Have you had this sort of problem? Do you know why this doesn't work
in the 2nd case?
Thanks,
 
P

Peter Michaux

It's strange... The following works:

document.write('<object classid="clsid:D27CDB6E-
AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/
pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="1"
height="1"><param name="movie" value="vinheta1.swf"><embed
src="vinheta1.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-
flash" width="1" height="1"></embed></object>');

But the following doesn't:

document.write('<object classid="clsid:D27CDB6E-
AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/
pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="1"
height="1"><param name="movie" value="vinheta' . '1' . '.swf"><embed
src="vinheta' . '1' . '.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-
flash" width="1" height="1"></embed></object>');

Have you had this sort of problem? Do you know why this doesn't work
in the 2nd case?

I doubt anyone is going to bust out a diff program to figure out what
is different in these two blobs. Perhaps you'd like to indicate what
is different?

Peter
 
C

Charles

Because one way is a syntax error and the other way isn't. When the
syntax error is encountered script execution stops. When it stops you
won't see an animation because it hasn't been completely created yet.

Thanks. From the 2nd snippet, I'm just concatenating strings. This is
why I don't understand it fails to render the Flash animation.
 
L

-Lost

Charles said:
Thanks. From the 2nd snippet, I'm just concatenating strings. This is
why I don't understand it fails to render the Flash animation.

Oh my God. NO YOU ARE NOT. The concatenation operator in JavaScript is
a plus (+) not a dot (.). This is NOT PHP.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top