PDA

View Full Version : Pre-loading Hell!


David Gaulin
12-20-2001, 02:51 PM
Hi Gang,
I just got out of a web design course and must have been sleeping when they were going over JavaScript. I keep on getting an error pop up identifying where the problem is (line and character numbers)but can't seem to debug it. My site is viewable at http://www.cecpeople.bu.edu/dgaulin and it occurs with the "portfolio" link. Any suggestions as to what the problem might be? Thanks for you help!

petervazed
12-20-2001, 03:07 PM
There is no close ; after newimage4
=======
</embed>
</object>
newimage5 = new Image();
======

Jon Hanlon
12-20-2001, 05:07 PM
newimage3 = new Image();
newimage3.src = "barred2.gif";
// Fine so far, we've defined an Image object called newimage3 and set its .src property to be "barred2.gif"

newimage4 = new Image();
// OK, another Image object called newimage4

newimage4.src = <object classid="clsid:166B1BCA-3F9C-11CF-8075-444553540000"

codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
width="215" height="236">;
<param name=movie value="pinkrose2.swf">
<param name=quality value=high>
<embed src="pinkrose2.swf" quality=high

pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"
type="application/x-shockwave-flash" width="215" height="236">;
</embed>
// What the? ?!?
newimage4 is an Image. But Images have .src properties which must be strings, so for this to work,
you'd need to enclose it in quotes. '<object... </embed>'.
But it won't work anyway, as it's got to be a primitive string, not an embedded Flash file.


Solution? Just delete the offending lines.
There's a few tutorials on Flash and Javascript hrer:
http://www.webreference.com/js/index.html?start=11&page=10