I can’t believe I forgot how to do this.
I have 24 small buttons on the bottom of my flash. They are actually movie clips with invisible buttons on top of them When I click on them I want a larger external jpg to load into the large imagePlace on top of the thumbnails.
Can anyone refresh my memory on how to do this?
Thanks
It’s just like loading an external SWF in, except you give a path to a JPG rather than a SWF.
I can’t remember the exact syntax off the top of my head, but look up MovieClipLoader class.
var mcHolder:MovieClip = createEmptyMovieClip("mcHolder", getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);
mcLoader.loadClip("image.jpg", mcHolder);
From this thread: http://www.sitepoint.com/forums/showthread.php?t=662406
Thank you Bpatch. Your code works but there are problems.
The external jpegs do not load into the flash movie clip with Google Chrome. And it loads way to slowly with IE. It runs half way okay in Firefox.
Should I have some sort of Loader with these external jpegs that are loading into the shell for the movie clip? I have the jpegs in a folder called “bootcampslideshow.”
Thanks
I have the jpegs in a folder called
on (rollOver) {
this.sm6.gotoAndPlay("overbutton");
}
on (rollOut){
this.sm6.gotoAndPlay("rolloutbutton");
}
on (press){
this.sm6.gotoAndPlay("clickit");
this.fadein.gotoAndPlay("startfade");
var mcHolder:MovieClip = createEmptyMovieClip("mcHolder",getNextHighestDepth());
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);
mcLoader.loadClip("bootcampslideshow/boot6.jpg", mcHolder);
}
I put a loader on everything over about 50KB, or that might be over 50KB (dynamic content in other words).
Is your Flash Player in IE and Firefox the same version?
It works the same for me in all browsers. Chrome, FF, IE8, Opera
That’s a very good question.
It must be the flash plug in. Cause it works in IE and Google Chrome on my Window’s 7 computer.
This brings up more questions.
1. How do I put a loader in for each external JPG?
2. Can I get it to load any faster?
3. Can I publish it to a older flash plug in so most will be able to view it?
4. Is there a script I can put there in case the veiwer does not have a flash plug in?
Thanks again for your help.
1. How do I put a loader in for each external JPG?
Give me a bit. I just woke up and am not thinking clearly yet. Though, in the meantime: http://www.google.com/search?q=preload+external+jpgs
2. Can I get it to load any faster?
You can further optimize the images and try to bring the file size down as much as possible. http://www.google.com/search?hl=en&q=optimize+images+for+the+web
3. Can I publish it to a older flash plug in so most will be able to view it?
Yes it is possible to choose which version of the flash player, but if the actionscript in it is newer than that version than it will not let you do it. Most probably have a fairly new version of flash installed.
4. Is there a script I can put there in case the veiwer does not have a flash plug in?
Yes I like to embed flash using the swfObject. This will allow for alternate content to be added.
Thanks BPartch. I’ll study your response.
Here is another question. Does the size of the external jpeg matter on how long the external jpeg will load into flash?
Thanks
Yes, if you mean how long it will take it to load.
If by size you mean file size and not dimensions, yes. The length of loading time is determined by the file size, not the dimensions of the image.
Yes I should have mentioned that I was referring to file size and not dimensions. Though the bigger the dimensions usually means larger file size.
Yes I meant the file size and not dimensions. It is loading faster after I decreased the file size. However, it still is not loading fast enough. I do have a white fade in, but that only looks right after the cache is filled. I guess some sort of loader must be in order.
By the way, is there a way I can have the first JPG automatically be loaded into the flash page so that it’s not an empty shell? In other words, the first image from the first button is already loaded… and it will load again if the first button is clicked?
Please see the flash slide show on the bottom right of page.
Thank you.