codetoad.com
  ASP Shopping CartForum & BBS
  - all for $20 from CodeToad Plus!
  
  Home || ASP | ASP.Net | C++/C# | DHTML | HTML | Java | Javascript | Perl | VB | XML || CodeToad Plus! || Forums || RAM 
Search Site:
Search Forums:
  JavaScript PreLoad  Archive Import (Andrew) at 02:34 on Monday, August 25, 2003
 

Hi all,

I am new with Javascript.

Here`s a code that I don`t understand.
It is meant to do an image preload

This is the code :

var arySWFiles = new Array(4)

arySWFiles[0] = "/forum/intro.gif"
arySWFiles = "/forum/introp.gif"

for (i= 0; i<arySWFiles.length; i++) {
preLoad.src = arySWFiles
}

Since the data is preloaded to var preLoad.src.
Does it mean that the files is then preloaded into
the cache of the browser?

Regards,
Andrew

  Re: JavaScript PreLoad  Archive Import (Andrew) at 21:01 on Monday, August 25, 2003
 

Thanks for the reponse Troy...

I am not having a bit of trouble.
I am trying to use the Image swap method,
but with swf flash files. Which is non the less
unsucessful.

eg.

<embed name="swfMain" src="/forum/intro.swf">

then

document["swfMain"].src = "/forum/product.swf"

When I try to do this. nothing happens...
any ideas?

Regards,
Andrew

  Re: JavaScript PreLoad  Troy Wolf at 09:19 on Tuesday, August 26, 2003
 

Unfortunately, I`ve never worked with Flash or Shockwave yet. In fact, I`ve not done much with <embed>. Although it seems logical that you could swap out the src for an embed tag just like any other tag, perhaps this is not possible. Let`s hope some gurus will read this and respond with an accurate, thorough answer!

Try some basic troubleshooting, though. Does your same code work if you change the <embed> tag to an <img> tag and just try to swap a couple of .jpg or .gif files? Try to test so that the only difference between working and non-working is the <embed> tag instead of <img> tag. Good luck.
Troy Wolf: site expert
SnippetEdit Website Editor









CodeToad Experts

Can't find the answer?
Our Site experts are answering questions for free in the CodeToad forums








Recent Forum Threads
•  Re: C++ Beginner question
•  Re: function within loop problem
•  moncler outlet
•  Re: Display swf file in pdf
•  Re: how to create forum using asp.net with c# language?
•  Discount coach store
•  Create Better Maps with Global Mapper
•  Re: How to display a message box when record is temporary stored in session/grid view
•  Sharing object in perl


Recent Articles
ASP GetTempName
Decode and Encode UTF-8
ASP GetFile
ASP FolderExists
ASP FileExists
ASP OpenTextFile
ASP FilesystemObject
ASP CreateFolder
ASP CreateTextFile
Javascript Get Selected Text


© Copyright codetoad.com 2001-2012