muiltiple loads
- Started
- Last post
- 41 Responses
- JamesEngage
Probably asked this before... but...
I want to load ONE image into five movieclips... what is the most efficient way of doing this?
Can I load it once and duplicate it? what is the deal with it? Is there a way of loading the image into a symbol in the library rather than one on the stage?
Mind has gone __________.
Help, Ta, James.
- MX_OnD0
James,
once it has been loaded once it is cached so as long as you wait until it has loaded before trying to get it into the other 4 clips it shouldn't really matter ;)
- rasko40
fnaar fnaar
- JamesEngage0
isn't that still going to still cause latency in querying thr server to find the image, and seeing that it is the exact same one...
Sorry to be picky... its just one of those things that keeps me awake at night (particularly at the mo!)
- gruntt0
this was not what i expected this thread to be about.
- MX_OnD0
hehe rasko and gruntt ya pair o' durty hoors!
James - I don't think so:
The SWF gets loaded and cached 1st so it is playing locally - then it makes the call to loadMovie and the JPG gets cached, then subsequent calls to the same path should come from the cache...
but like I say that's what I think - I'll check for sure at work tomorrow if you like
- JazX0
unfit would know
- tomkat0
bukake.jpg
- JamesEngage0
hilarious Zz.
- MX_OnD0
found out for you James,
right this is the deal:
If you use loadMovie for each one it will depend on Browser settings - whether or not the browser uses the cache to display content. Mostly it will take the cached image.
If you use duplicateMovie then it will use the MovieClip within the FlashPlayer and duplicate that, therefore not requesting the image again - as long as you wait until the image is loaded before duplicating.
Also there are a number of reasons against using duplicateMovie - parent and children clip issues.... for full functionality use loadMovie and use the getBytesLoaded and getBytesTotal for testing if they're loaded or not - onLoad doesn't work for images.
- JamesEngage0
You're a star... thought I'd just check back and you had replied... thank you...
Was infact just about to start coding... and now I know the pitfalls before I fall in them... great! thank you!!!!!
- JamesEngage0
Doesn't mean I can get the bugger to work though does it :(
- System-Idle0
Using the 'linkage properties' might also be an option
- MX_OnD0
if(this==patronising) {
trace("sorry");
}someClip.loadMovie("imageURL");
then make a setInterval for this bit:
if(bytesLoaded == bytesTotal) {
someOtherClip.loadMovie("imageUR...
}or similar... sorry a bit rusehd or I'd do a wee mock up..
- JamesEngage0
cheers MX... hopefully want to avoid the multiple calls...
I'm find that when i load a jpg into the movie clip which contains another clip to put it into... it appears fine...
but when I duplicate it, it reverts to what the initial movieclip looks like before I loaded anything into it
- MX_OnD0
timing issue by the sound of things, sounds like you are duplicating before the image is loaded.... one of the shit bits about duplicating is about having code in the movie you duplicate....
the cleaner option would be to use the repeat calls for sure.
- JamesEngage0
hmm! annoying!
the thing is I can see the jpeg appear so I know it has loaded.
think i'm in the wrong business! anyone want to open a bar!
- System-Idle0
How about putting loadMovie ()inside each duplicated mc, but only duplicate them once the original jpg has loaded into the first.
- MX_OnD0
try making a wee test file for yourself,
make a dynamic text box to display % loaded for the JPG
have a button on the stage with an onRelease to duplicate the clip you want....
it could be that the duplicate is firing before you see the JPG... you simply have to manually check to see if it has loaded before calling the duplicate method...
- JamesEngage0
I like your thinking will try that!
- MX_OnD0
won't work System-Idle, we do not reccomend this at all.
The linkage properties would only have effect if using "attachMovie" which in turn would mean having all the JPGS in the library which in turn would result in a larger SWF.... not reccomended either.
Also putting code into movieClips has generally not been a good idea since FlashMX and the conept of code centralisation.
working yet James?