Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 135
  • Last Modified:

What's the BEST way to preload this stuff?

Hi All,

I have a strong background in Director, and have only recently moved to Flash. I'm building a site, and have to resolve some resource managment issues. I have 3 questions which i would areally appreciate some help on. Thanks in advance for your time.

1) When using MovieClip.loadMovie() on a jpg or swf file, does the Flash player use the browsers cache to store the downloaded files?. I'm hoping that if you use loadMovie() on a jpg or swf once, the second time you try to do it from another movie, the Flash player is smart enough to use the cached copy. Director's Shockwave player does this, and it comes in handy. Does anyone know if the Flash player does the same thing with loadMovie() items?

2) When you use loadMovie() to load a jpg into your movie, how can you make that object a library symbol? Specifying a target to load isn't enough. I'm hoping to load some jpg's in first, then load the swf sections in and out of the main movie, but have them able to reference the initially imported jpgs from the library. This is so i could use attachMovie() later.

3) Any good references for using the bandwidth profiler to test your movies on a "faked" slower connection? I can't seem to work it out from using the manuals that come with Flash. I have a fast connection, and i need to see how the movies perform under a 56k speed. I know it has something to do with the test movie and bandwidth profiler, but i can't find any good tutorials or references on it.

Thanks for your time, I appreciate your help.

dragonworx.
0
dragonworx
Asked:
dragonworx
  • 3
  • 2
1 Solution
 
henrywwCommented:
hi dragonworx,

1) when the movie is loaded the 1st time, then it is already in the movie, why load it the 2nd time? can with duplicate movieclips (even for jpg). but i am sure the movie is being loaded from cache instead, otherwise check you browser settings


2) similar as in 1 ... load a jpg into a target movieclip and use duplicateMovieClip to make more


3) well, ctrl-B to show the profiler & from the menu click debug to change the connection speed - that press ctrl-enter again to see it streaming & speed ... etc ...
that's how i do it anyway ...

cheers
0
 
elhyCommented:
hi,

1. If your url for the swf and jpg doesn't change, it will load the one in the browser cache. a slight change in the file size and url will make the browser reload the files again.

2. I dun quite understand the point for this question. coz if you are going to import the jpg into the library, why bother to use loadMovie to load them dynamically again? Wouldn't it be faster if u were to retrieve these images from the library since u already have it?

3. To change the setting for "fake" connection speed:

i)  Press Ctrl+Enter to go into the 'Test Movie' stage.
ii) Select "Debug" from the program.
iii)Select 56K.
iv) You can set a customize speed by selecting customize.
v)  After selection of speed, press ctrl+enter again to show streaming and test your movie loading in that selected speed.

0
 
elhyCommented:
hi henryww,

I've just did a testing, u can duplicate a movieclip but if the movieclip contains dynamically loaded jpg, the jpg won't show up.
0
 
henrywwCommented:
that's true and same for the other question that we were looking at ...

u are right :)

i am sorry ... now i understand why dragonworx want to add it to the library ... he he he

well, can't use standard flash function to do that, but write a simple function can do similar action.

like

// pass an mc to the function
function loadJPG(target,jpgURL,lvl) {
   target.loadMovie(jpgURL,lvl);

}
0
 
henrywwCommented:
that's true and same for the other question that we were looking at ...

u are right :)

i am sorry ... now i understand why dragonworx want to add it to the library ... he he he

well, can't use standard flash function to do that, but write a simple function can do similar action.

like

// pass an mc to the function
function loadJPG(target,jpgURL,lvl) {
   target.loadMovie(jpgURL,lvl);
   target.jpgURL = jpgURL;
   target.jpgLvl = jpgLvl;
}

function dupJPG (target, iName, lvl){
   var theParent = target._parent;
   var jpgURL = target.jpgURL;
   var jpgLvl = target.jpgLvl
   theParent.duplicateMovieClip(target, iName,lvl);
   theParent.iName.loadMovie(jpgURL,jpgLvl);
}

something like that, haven't tested in flash, but the logic should be right, otherwise we can create an object to due with it...


0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now