Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

slow image swaping - doesn't image preload work??

Status
Not open for further replies.

jasminka

Vendor
Feb 20, 2001
6
GB
Hi!
I've done a fireworks rollover-graphic with swapping images. I checked the preload option and it generated a Javascript preload function in the code. But somehow the preload doesn't seem to work properly as the swapping is very slow and it starts loading again and again, whenever I hover over a slice. Please have a look it is on the homepage of corplearn.co.uk.
Can anyone give me advise about this problem??
Jasminka
 
I thought I had the same problem. Apparently, it's not that they don't preload, but that fireworks and dreamweaver both make very slow rollovers. Something to do with the way they generate the code. The advice that I got was to write them yourself. There are several tutorials all over the place for this, I looked *everywhere*. The coolest thing that I found was this.


it will generate the code for you. Pretty sweet. Here's another one.


Good Luck!!!! ;-) Holy tek-tips batman!:-0
 
couldn't get into the url? page not found error!

But it is a good idea to learn the rollover code yourself - much more flexibility. The problem may be that the functions Fireworks inserts are general, so that they will work in a wide range of situations - useful for banging up a quick prototype but a little crude for your final site. They may be slow but they should work...

but if the preloader is working it definitely should not be accessing the site once your page is loaded - that is the function of the preloader!
 
I'm new at this thing too, but I think I have an idea.

The problem may be that the "frame delay" may be set to something greater than zero. Check the frame properties of each frame, and change frame delay (hundredths of seconds) to zero instead of the default, which I think is 7.

Hope this helps!
 
Thanks for the tip!
I'm not very fit with JavaScript, I looked at the code generated by Fireworks and found a bit about frames, but nothing stating a delay of seven, as well not in the preload-function. Here's the code, maybe you've got an idea?

<script language=&quot;JavaScript&quot;>
<!--hide this script from non-javascript-enabled browsers

function MM_findObj(n, d) { //v3.0
var p,i,x; if(!d) d=document; if((p=n.indexOf(&quot;?&quot;))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers.document); return x;
}
/* Functions that swaps images. */
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a)&&x.oSrc;i++) x.src=x.oSrc;
}

/* Functions that handle preload. */
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a.indexOf(&quot;#&quot;)!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a;}}
}

// stop hiding -->
</script>


...or did you mean I need to change this delay not in the code itself, but somewhere in Fireworks, before exporting the file?
Thank you!
mink
 
you have to change it in the frames inspector in fireworks.
double click on the actual frame delay setting and a little box will open allowing you to specify a new setting. Ya' Gotta Love It!:)X-)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top