Help Loading Images To Multiple Places
Hey all. I have a question that I think is trivial, but I can't seem to wrap my head around it. I'm trying to find a way to load an external JPEG file into a movieclip and have it simultaneously load into 2 other movie clips. Currently I'm accomplishing this as follows:
ActionScript Code: clip1.loadMovie("my_image.jpg");clip2.loadMovie("my_image.jpg");clip3.loadMovie("my_image.jpg");
However, what seems to happen is that the more calls there are to the same image, the slower it is (it's a slow server). I'd really like to have 1 call that accesses the server and have the returned image appear in all 3 places. I have a feeling this has something to do with linkage, but I'm really not sure how the whole linkage thing works. If anyone has a tutorial on linkage I would be very grateful. In the mean time, any help you can provide on this issue would be appreciated.
Thanks,
ActionScript.org Forums > ActionScript Forums Group > ActionScript 2.0
Posted on: 09-11-2006, 05:10 PM
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
Loading Same Movie In Multiple Places
Let's say I've loaded an external image like so:
movie.loadMovie("image.JPG");
Is the only way to get this image into another movie clip by loading it again?
Loading Multiple Images Into Multiple MC's
Hiya
Basically I have an image gallery where I want to load jpg's into seperate MovieClips and then have some onRelease, onRollover etc actions attached to them. I've managed to write what I need, but now the problem is that if I have 50 pics in my gallery I will have to repeat this code 50 times!!!
Can someone show me how to put this in a for loop or an array, or whatever I need to do so I can write it once, not 50 x.
Here's what I've got so far...
loadMovie("images/thumbs/thumb1.jpg", this.btnHolder.inside);
btnHolder.onRelease=function (){
_root.select = 1;
if (_root.cur == 0) {
trace("same pic!");
} else {
_root.fadeOut(0);
}
}
btnHolder.onRollOver=function (){
this.gotoAndStop(2);
}
btnHolder.onRollOut=function (){
if(_root.select == 1){
this.gotoAndStop(2);
}else if
(_root.select == 0){
this.gotoAndStop(1);
}
}
PLEASE HELP ME.
thnx
Loading Multiple Images All At Once?
Hi
I want to load six jpegs and six mp3s into my movie when it starts. Despite reading quite a few tutorials I am still unsure of the best way to do this.
At the moment I am using MovieClipLoader for the images. I create a new MovieClipLoader object:
[script]
// set up MovieClipLoader for images
var myMCL = new MovieClipLoader();
myMCL.onLoadInit = function(targetMC) {
// do stuff when image loads
[/script]
Then I call a function that loads the images using a loop:
[script]
loadImages = function():Void {
for (var i:Number=0; i<nTiles; i++) {
var tile_mc:MovieClip = _root.createEmptyMovieClip("tile"+i+"_mc", i);
tile_mc.createEmptyMovieClip("button_mc", 1);
var sImage:String = "_images/" + i + ".jpg";
myMCL.loadClip(sImage, tile_mc.button_mc);
};
};
[/script]
It works OK but Im unsure about how to create a preloader that displays a percentage value for the total amount of all the images Im downloading. IE: 0% would be no images downloaded, 100% would be all 6 images downloaded.
Am I even doing the right way so far? Should I be waiting until each image is fully downloaded before I download the next one?
If downloading them all at once is OK, how do I build one preloader for all the images as described above?
Thanks in advance
thesquirrel
Loading Multiple Images At Once
Hey There,
I am having problems loading 4 images at once into 4 different place holders. I am trying to simply load the jpg image, then when its finished loading, fade on:
_root.loadIMG("large1","loader1");
_root.loadIMG("sm1","loader2");
_root.loadIMG("sm2","loader3");
_root.loadIMG("sm3","loader4");
Then to actually load the image into (filename, movietarget) I use:
function loadIMG(image, movie) {
movName=eval(movie);
movName.loadMovie("flImages/"+image+".jpg");
this.onEnterFrame = function() {
l = movName.getBytesLoaded();
t = movName.getBytesTotal();
if (l == t && movName._width>1) {
_root.flashon(movName);
delete this.onEnterFrame;
}
};
}
However 1 random image loads then the rest fail to load. Is this becuase its deleting the function for the rest of the image loads, or perhaps l & t arent unique variables when its called more than one time?
Any help greatly appreciated!
Thanks!
Loading Multiple Images At Once
Hello,
I'm developping a site that must load about 100 small images at once. I noticed that the player seems to drop some of the requests sometimes. I coded a queue system to avoid this but this means loading them one after the other. I'm just wondering if anybody encountered the same problem, and if anyone has a better solution.
Thanks,
Joseph
Multiple Images Loading
Hello!
I'm doing an images gallery and I want all the images to load just one time, and then display them one after the other without loading.
It should look like the images gallery on this page :
http://www.joshuadavis.com/
hope someone can help me.
Thank you and best regards
Loading Multiple Images In IE...
Hi,
I encountered a very strange problem (probably bug) while loading multiple images from IE. Flash is very simple (code is stripped version of match larger program) it contains simple for loop that loads image 20 times, and COMPLETE handler that position image.
Running application from Flash IDE is ok, but if user run flash embeded into html from IE (IDE auto generated html) and interrupt loading (closes IE tab (not whole IE, just tab)) next load of same html stop working. What is event more strange, is that image url entered in addres field of IE will not work?!?!
To conclude, to reproduce this behavior: run html from IE and close tab in middle of loading process (after few images loaded). Running html again will not work (or typing image url into address). NOTE that tab must be closed (not whole IE). Closing IE and running html again will work normaly.
Is there any idea how to correct this? Note that I used different image links, and any of them have same behavior, so i excluded url as error.
ActionScript Code:
// flash have TextArea named 'trt' on stage (x:319, y:15, w:135, h:366)
var nxy:Number = 0;
for (var i=0; i<20; i++) {
var loader:Loader = new Loader();
loader.load(new URLRequest("http://maptp12.map24.com/map24/webservices1.5?action=renderMapImage&cgi=Map24RenderEngine&mid=xxxxxx&cgi=Map24RenderEngine&iw=256&ih=256&cmd0=MOV&nav0=NORTHWEST&x0|0=100&y0|0=80"));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete2);
}
function onLoadComplete2(e:Event) {
trt.text += "LOADED
";
var l:Loader = e.target.loader;
l.x = l.y = nxy;
nxy += 10;
addChild(l);
}
stop();
I reproduce same behavior on Vista with IE7 and on XP with IE7. On firefox it works ok.
Also, flash program is used for map display (tiled map images), like gmaps.
P.S.
It seems that any flash based map viewer have this error: flash yahoo maps have same issue, www.flashearth.com too, and also google flash based map have sam error.
Loading Multiple Images...
Hi there.. im guess what - a beginner!! ive played around in flash cs3... and know a little.. but here is the probs.. i have 40 images, which form a flash image..
here check it out http://www.anclchess.net/j/anclLogo.html..
now the problem is.. those images are perfectly clear beautiful pics!! but as a swf they are notttttt clear.. well. the file is about 160kb.. so.. im guessing that.. i need to preload the images right? then it will look as it does on my pc? (which is perfectly clear)..
ok, well ive been searching google for hours.... and.. i have found plenty of preloaders and code, but not exactly what i want..
how should i go about this guys? do i need a preloader? should i put the code into an actions frame in the above .swf file? or should i make a seperate preloader file and like it? and.. how would be veryyyyyy useful
ok.. thank you for listening to my probs
hope to hear from you soon..
jeffers
Loading Multiple Images
I am trying to load 3 images inside a movie clip using the following code:
Frame 2:
-----------------
PHP Code:
image1Loaded = false;
currentQuestion = _root.quiz.questions[_root.cq-1];
currentImage = currentQuestion.childNodes[1].attributes.src;
holder_mc = this.createEmptyMovieClip('holder', 1);
holder_mc.loadMovie(currentImage);
monitor1_mc = this.createEmptyMovieClip('monitor1', 2);
holder = holder_mc;
holder._alpha = 0;
monitor1_mc.onEnterFrame = function(){
var loaded1 = holder.getBytesLoaded();
var total1 = holder.getBytesTotal();
if(total1 > 15){
if(loaded1 >= total1){
trace('completely loaded');
delete this.onEnterFrame;
image1Loaded = true;
gotoAndPlay(3);
}
}
}
stop();
-----------------
Frame 3:
-----------------
PHP Code:
if (image1Loaded == true) {
holder._x = 11;
holder._y = 119;
holder._width = 125;
holder._height = 90;
holder._alpha = 100;
play();
} else {
gotoAndPlay(2);
}
-----------------
Frame 10:
-----------------
PHP Code:
image2Loaded = false;
currentQuestion = _root.quiz.questions[_root.cq-1];
currentImage2 = currentQuestion.childNodes[2].attributes.src;
holder2_mc = this.createEmptyMovieClip('holder2', 3);
holder2_mc.loadMovie(currentImage2);
monitor2_mc = this.createEmptyMovieClip('monitor2', 4);
holder2 = holder2_mc;
holder2._alpha = 0;
monitor2_mc.onEnterFrame = function(){
var loaded2 = holder2.getBytesLoaded();
var total2 = holder2.getBytesTotal();
if(total2 > 15){
if(loaded2 >= total2){
trace('completely loaded');
delete this.onEnterFrame;
image2Loaded = true;
gotoAndPlay(11);
}
}
}
stop();
-----------------
etc. until image 3 is loaded
This doesn't work when the movie is first served. You have to refresh to get all the images. Any ideas on problems with this code or can you over any guidance on a better approach to load 3 jpegs.
Many thanks,
Adrian
Loading Multiple Images In IE...
Hi,
I encountered a very strange problem (probably bug) while loading multiple images from IE. Flash is very simple (code is stripped version of match larger program) it contains simple for loop that loads image 20 times, and COMPLETE handler that position image.
Running application from Flash IDE is ok, but if user run flash embeded into html from IE (IDE auto generated html) and interrupt loading (closes IE tab (not whole IE, just tab)) next load of same html stop working. What is event more strange, is that image url entered in addres field of IE will not work?!?!
To conclude, to reproduce this behavior: run html from IE and close tab in middle of loading process (after few images loaded). Running html again will not work (or typing image url into address). NOTE that tab must be closed (not whole IE). Closing IE and running html again will work normaly.
Is there any idea how to correct this? Note that I used different image links, and any of them have same behavior, so i excluded url as error.
P.S. I use IE 7 under the Vista, but IE 7 with XP also have same behavior.
Thanks
Attach Code
// flash have TextArea named 'trt' on stage (x:319, y:15, w:135, h:366)
var nxy:Number = 0;
for (var i=0; i<20; i++) {
var loader:Loader = new Loader();
loader.load(new URLRequest("http://maptp12.map24.com/map24/webservices1.5?action=renderMapImage&cgi=Map24RenderEngine&mid=EVAL_MAPNETWORK_NT_EUROPE&cgi=Map24RenderEngine&iw=256&ih=256&cmd0=MOV&nav0=NORTHWEST&x0|0=100&y0|0=80"));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete2);
}
function onLoadComplete2(e:Event) {
trt.text += "LOADED
";
var l:Loader = e.target.loader;
l.x = l.y = nxy;
nxy += 10;
addChild(l);
}
stop();
Multiple Images, ONE Loading Bar
My deepest apologies if this has already been discussed. I recently checked out the Image Slideshow tutorial here at Kirupa, and loved it. The only problem is that the images load one by one, and therefore a preloader bar comes up for every image. I was wondering if there is a way for Flash to read the XML file, load all the images at once using ONE preloader bar at the start, and THEN go through each image in the slideshow. Anyone have any knowledge about this?
Many thanks,
Agra
Loading Multiple Images From IE ...
Hi,
I encountered a very strange (now it going to be realy frustrating) problem (probably bug) while loading multiple images from IE. Flash is very simple (code is stripped version of match larger program) it contains simple for loop that loads image 20 times, and COMPLETE handler that position image.
Running application from Flash IDE is ok, but if user run flash embeded into html from IE (IDE auto generated html) and interrupt loading (closes IE tab (not whole IE, just tab)) next load of same html stop working. What is event more strange, is that image url entered in addres field of IE will not work?!?!
To conclude, to reproduce this behavior: run html from IE and close tab in middle of loading process (after few images loaded). Running html again will not work (or typing image url into address). NOTE that tab must be closed (not whole IE). Closing IE and running html again will work normaly.
ActionScript Code:
Code:
// flash have TextArea named 'trt' on stage (x:319, y:15, w:135, h:366)
var nxy:Number = 0;
for (var i=0; i<20; i++) {
var loader:Loader = new Loader();
loader.load(new URLRequest("http://maptp12.map24.com/map24/webservices1.5?action=renderMapImage&cgi=Map24RenderEngine&mid=EVAL_MAPNETWORK_NT_EUROPE&cgi=Map24RenderEngine&iw=256&ih=256&cmd0=MOV&nav0=NORTHWEST&x0|0=100&y0|0=80"));
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onLoadComplete2); }
function onLoadComplete2(e:Event) {
trt.text += "LOADED
";
var l:Loader = e.target.loader;
l.x = l.y = nxy;
nxy += 10;
addChild(l);
}
stop();
// end of code
I reproduce same behavior on Vista with IE7 and on XP with IE7. On firefox it works ok.
Note that upper code is part of map viewer that loads tiled map (images 256x256). I googled for other viewers and all of them have same issue, even flash yahoo maps have same issue, www.flashearth.com too, and also google flash based map have sam error.
I did not know is this IE error or Flash player fault, but it works fine under Firefox.
Also, there are no simultanous donwload limits or whatever, it can be reproduced with prerendered images from localhost.
Best.
Loading Multiple Images From Xml
Hi,
I think I've run into a newbie problem. I'm trying to load a number of brand logos and link to the brand's site using information from an xml list. I'm able to get the information from the list fine but when I try to loop through the list and add the images to the stage only the final image remains on the stage. The others get overwritten by the latest one. Obviously I need a new loader to be created each time I loop through but I can't figure out how to do this. I've thought about implementing an array but haven't had any luck. Here's my code so far:
Code:
var xmlLoader:URLLoader = new URLLoader();
var brandsURL:URLRequest = new URLRequest("brands.xml");
xmlLoader.addEventListener(Event.COMPLETE, xmlLoaded);
xmlLoader.load(brandsURL);
var loaderX:Number = 50;
var brandsXML:XML = new XML();
brandsXML.ignoreWhitespace=true;
var loader:Loader = new Loader();
function xmlLoaded(evt:Event):void {
brandsXML =XML(xmlLoader.data);
for (var brandName:String in brandsXML.brand) {
trace(brandsXML.brand[brandName].@name);
var request:URLRequest= new URLRequest(brandsXML.brand[brandName].image);
loader.load(request);
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
var link:URLRequest=new URLRequest(brandsXML.brand[brandName].link);
function onClick(evt:MouseEvent):void {
navigateToURL(link);
}
function imageLoaded(evt:Event):void {
addChild(loader);
loader.x=loaderX;
loader.y=50;
loader.width=209;
loader.height=56;
trace("image loaded");
loaderX+=250;
loader.addEventListener(MouseEvent.CLICK, onClick);
}
}
}
Does anyone know what I need to do to add to stop the loader from replacing itself?
Any help would be greatly appreciated.
Thank you.
Loading Multiple Images
Hi, i was wondering, how would you go about having a loader component or one you made yourself to load multiple images??
e.g.
Have a list of images: banner.jpg, nav.jpg, boxBg.jpg etc
So it loads one in, when thats finished, it loads the next etc until they are all loaded.
Can you get what i mean??
Any links or ideas??
Regards,
Martin
Computing Help And Info:
http://www.webrevolt.biz
Loading Multiple Images (with Xml?)
hi, I am starting all over with this, because my earlier attempts failed... I want to load multiple images externally onto my stage, but I need to be able to position the holder_mc's in authoring time, because the images need to have a fixed position (on a map). What is the best way to do this?
I want to make sure that the images load one after another (with a little preload bar) each into its own holder_mc. But it's very important that once they are loaded, the user can rollover the images and the image that he rollsover goes to the next highest depth (because some of the images overlap on stage). Right now i'm using xml to load them onto the stage, but for some reason I cant access the holder_mc's to do something. I've tried an onRollOver trace, but it doesnt work. I'm thinking I should use the MovieClipLoader class to load them, but can I use that class and still load an array with xml?
Can someone help me out with this?
Loading Multiple Images As Buttons
Does anyone out there have a sample script that loads several images and then enables the use to click on the images for navigation throughout the site? I'm currently trying to use loadimage and everything works fine during testing but when i move it to the live server the images seem to take forever to load or they just do not load.
Thanks for you help
Loading Multiple Images With LoadMovie
I was wondering if it was possible to use loadMovie method with the instance name as a var. For example I have the following function.
Code:
function loadAllImages() {
trace("Loading images...");
for (j=0; j <= totalImages; j++) {
imageInstance[j] = "pictures"+j+"_mc";
alaska_mc.createEmptyMovieClip(imageInstance[j], alaska_mc.getNextHighestDepth());
alaska_mc.imageInstance[j].loadMovie(images[j].path);
trace("alaska_mc." + imageInstance[j] + " loaded.");
moveXY();
}
When I try to load an image this way, it won't work. During debugging I can see that the function is creating the empty clips.... (alaska_mc.pictures0_mc, alaska_mc.pictures1_mc, etc) but the loadClip method won't load the image because I have a variable (imageInstance[j]) instead of an actual name. The function works if I put the actual instance name there (i.e. alaska_mc.pictures0_mc). instead of the var holding the name of the instance(alaska_mc.imageInstance[j]).... Am I missing something? Thanks in advance.
Loading Multiple Images Into Grid From Xml
I am duplicating a container movieclip and I then want to load an image into each of the containers from an xml file.
here is the code:
stop();
Code:
num = 0;
gridx = this.tracktainer._width + 5;
gridy = this.tracktainer._height + 5;
tracks = new XML();
tracks.ignoreWhite = true;
tracks.onLoad = function(success)
{
if(success)
{
trackNum = tracks.firstChild.childNodes.length;
for(k=0; k<2 ; k++){
for(l=0; l<trackNum; l++){
tracktainer.duplicateMovieClip("track" + num, num+1);
setProperty("track" + num, _x, tracktainer._x + (gridx * k));
setProperty("track" + num, _y, tracktainer._y + (gridy * l));
imagePath = tracks.firstChild.childNodes[num].attributes.jpegURL;
["track" + num]loadMovie(imagePath);
num++;
}
}
}
}
tracks.load("tracks.xml");
The containerMC (tracktainer) is being duplicated fine and creating the grid I want. But I can't load an image into each of the containers.
this code doesn't work - ["track" + num]loadMovie(imagePath);
but this does track2.loadMovie("houston.jpg");
I can;t understand why. Can anyone figure this out by just looking at the actionscript?
Loading Multiple Images In An Array
I've created the following code which loads two image and crossfades them. I need to load an unspecified number of images. For the sake of this question I will say that I need to load 5 different images and have the five of them cross fade. I know this would have to be some osrt of array but I have't the foggiest idea as to how to make the array of images crossfade. Here is my code so far:
/ Script to load two pictures and cycle them with a fading effect.
// Note: This looks a lot better with 30 frames/second.
var showTime:Number = 500 // milliseconds the picture shows at 100% alpha.
mc_Mon1.createEmptyMovieClip("img1_mc", mc_Mon1.getNextHighestDepth());
mc_Mon1.img1_mc.loadMovie("images/home/image01.jpg");// load picture from the file directory that your .swf is in.
mc_Mon1.createEmptyMovieClip("img2_mc", mc_Mon1.getNextHighestDepth());
mc_Mon1.img2_mc.loadMovie("images/home/image02.jpg");
mc_Mon1.img2_mc._alpha = 0; // hide 2nd picture*/
var duration:Number = 10; // milliseconds per alpha change (framerate).
var count:Number = 0;
var alphaPhase:Number = 1;
var alphaCount:Number = 0;
function picSwap():Void {
count++;
if(count >= (showTime/duration)) {
alphaCount += alphaPhase;
mc_Mon1.img1_mc._alpha = 100-alphaCount;
mc_Mon1.img2_mc._alpha = alphaCount;
trace("img1 alpha: " + mc_Mon1.img1_mc._alpha);
trace("img2 alpha: " + mc_Mon1.img2_mc._alpha);
if(alphaCount >= 100 || alphaCount <= 0) {
count = 0;
alphaPhase *= -1;
}
}
}
var intervalId:Number = setInterval(picSwap, duration);
// End of script
Does anyone know how to put this into an Array so I can have multiple images (more that 2) crossfade?
Thanks,
Kyle
Loading Multiple Images From Xml In Sets
I have a project to do and I'm not sure how to get it done. I have some experience using xml to load images into flash but that was one at a time. the project that i'm currently working on needs to work like something like this.
I need flash to load in three images at one time(from an xml file) and display them in a horizontal line, and then move across the stage from one side to the other.
i know how to load one image at a time but not multiple. and i don't know how to make the images slide across the stage in a line. anyone have any idea how this can be done or know of any tutorials for it?
thanks a mint
p13
Loading Multiple Images Problem
i want to make a thumbnail scroller therefore i need multiple images loaded.
loading the pictures is not a problem. but the problem is reaching height and width properties of images
here is my code(i need the property in red part):
Code:
function thumbLoad() {
for (i=0; i<len; i++) {
array[i]=new Loader();
array[i].x=index;
array[i].y=2;
index=index+4+array[i].width;
array[i].load(new URLRequest(thumb[i]));
Frame.addChild(array[i]);
//Frame is the movieclip i load the images on
}
}
Loading Multiple Images Dynamically
Ok, i've searched the Forums and tried to figure this out, with other people's examples, but I have no luck so far.
I am making a online catalog and want to dynamically load multiple JPGs at the same time, so that say, 6, jpgs will be shown on the stage at one time. I could go about this by making individual movieclips, but I want to make them dynamically. I'm not sure positive how to do this, and maybe it's staring me in the face, but if somebody could help me i'd appreciate it.
Thanks.
Multiple Images Loading And Print
Hi,
I have created a photo gallery, where in one page one image is displayed per page (img size is less than 5 kb). Images are getting loaded from the server side at run time and through XML files. To naviage between mutliple images I have NEXT and BACK button right their and they are working fine. One can also print the image using print button. But the problem occurs in case where User wants to print all the images at one go.
I am able to print multiple pages but images are not appearing in print outs but content is getting displayed pertaining to each image. I think images are not getting loaded at run time at the time of printing, but it does get displayed when u view it one by one.
For multiple print what i am doing is creating empty movie clips at run time and the same are populating with the different images and content and sending them one by one to the printer. I am using PrintJob Class.
Can any one have any pointers to this !! I would really appreciate any help or suggessions.
Thanks
...loading Multiple External Images While...
I'm at a loss folks! I can't seem find any code or sample .fla's to help me figure out how to load multiple external images in the background while viewing other already loaded images. Any ideas? Here's a brief...
In order to keep my file size to a minimum, I housed all my image sources in an external folder for use when needed. The object is for the user to click on a "Project" button which in turn will load sub project images (any where from 6-50). As you already know loading many images at one time can lead to longer download times. What I would like to do is after they click the "Project" main button and view the first image, the other following images are already downloading. Does this make sense?
Thanks in advance for the help!
Best,
Doug
Problem With Loading Multiple Images
i want to make a thumbnail scroller therefore i need multiple images loaded.
loading the pictures is not a problem.
what i need is, i want to treat these images like any DisplayObject; meaning i need to use width, height properties or i want to add event listeners, which i cannot do at the moment
here is my code(for example, i need the property in red part):
Code:
function thumbLoad() {
for (i=0; i<len; i++) {
array[i]=new Loader();
array[i].x=index;
array[i].y=2;
index=index+4+array[i].width;
array[i].load(new URLRequest(thumb[i]));
Frame.addChild(array[i]);
//Frame is the movieclip i load the images on
}
}
Loading Multiple Images With Loader?
Hi!
I use flash with php & mysql to load images into my movieclip.
So far I've managed to load the images but I want an loaderclip to play each time before the image shows up.
I have a dropdownlist with different options, when I choose one of them the clip loads 3 images directly and loads them. I want to load them one at a time with a pause and loaderclip between...
Here's my ActionSript for the dropdownlist:
Code:
on (change) {
import mx.utils.Delegate;
var theXML2:XML = new XML();
theXML2.ignoreWhite = true;
theXML2.onLoad = function() {
var nodes = theXML2.firstChild.childNodes;
for(i=0;i<nodes.length;i++) {
imageCon = createEmptyMovieClip("holder"+i, i);
imageCon.loadMovie(nodes[i].firstChild.nodeValue, "holder"+i);
var total = getBytesTotal();
var loaded = getBytesLoaded();
setProperty("holder"+i, _y, 50);
setProperty("holder"+i, _x, 100 *i);
// I have no idea what to do here...
setProperty(_root.imgLoader, _y, 138);
setProperty(_root.imgLoader, _x, 128 + (i*100));
_root.imgLoader.gotoAndPlay(2)
_root.Percent = ((loaded/total)*100) + "% loaded";
}
}
theXML2.load("models.php?sid=" + (this.value+1));
}
the XML2 string containes image addresses
Also, the last thing in the actionscript "theXML2.load...." can I (when the dropdown loads it's data) set specific value for each addItem? As it is now it just sends the viewer to models.php?sid=1,2 or 3, but I want it to send it to models.php?sid="database-id"..
This code loads data to the dropdown:
Code:
seasonDrop.addItem(". . . . .");
import mx.utils.Delegate;
var theXML:XML = new XML();
theXML.ignoreWhite = true;
theXML.onLoad = function() {
var nodes = theXML.firstChild.childNodes;
for(i=0;i<nodes.length;i++) {
seasonDrop.addItem(nodes[i].firstChild.nodeValue,i);
}
}
theXML.load("collections.php");
the XML looks like this
<?xml version="1.0"?>
<models>
<item>AUTUMN 2007</item>
<item>SPRING 2008</item>
<item>SUMMER 2008</item>
</models>In the end I also want these loaded images (thumbnails) to be clickable, so maby I just have to erase all and start over?
Thanks!!
Mikeey
Loading Multiple Images Dynamically
Hi Folks
Would appreciate some help on this AS3.0 problem. I'm reading an XML file no problem and getting a list of images.
The problem I'm having is trying to get them to load into dynamic movie clips.
The code is below if anyone can help, I'd be very grateful.
Code:
package {
import flash.display.*;
import flash.events.*;
import flash.ui.Keyboard;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.text.*;
public class MyContent extends MovieClip {
private var externalXML:XML;
private var loader:URLLoader = new URLLoader();
private var request:URLRequest = new URLRequest("five.xml");
private var myLoader:Loader = new Loader();
private var yPos=0;
public function MyContent() {
init();
}
private function init():void {
loader.addEventListener(Event.COMPLETE, onComplete);
loader.load(request);
}
public function onComplete(event:Event):void {
var loader:URLLoader = event.target as URLLoader;
if (loader != null) {
externalXML = new XML(loader.data);
var pictLdr:Loader = new Loader();
var max:Number = externalXML.entry.length();
trace(max);
for (var i:uint=0; i < max; i++) {
var mc:MovieClip= new MovieClip();
mc.name="clip"+i
stage.addChild(mc);
mc.addChild(myLoader);
trace(externalXML.entry[i].img);
var url:URLRequest = new URLRequest(externalXML.entry[i].img);
myLoader.load(url);
mc.x=0;
mc.y=yPos;
yPos+=150;
myLoader.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded);
function imgLoaded(event:Event):void {
trace("image Loaded");
}
}
} else {
trace("loader is not a URLLoader!");
}
}
public function linkHandler(linkEvent:TextEvent):void {
trace(linkEvent.text);
}
}
}
I am managing to trace that they're all loaded, they just don't display! Yet it works with 1 when not using the for loop.
Monkey
Script (Random Pause) In Multiple Places Causing Problems
I'm using the following actionscript in three different SWFs (level0 "home" SWF, level1 SWF, and level2 SWF):
PHP Code:
stop();
random_number = random(8000)+1000;
delay = setInterval(pause, random_number);
function pause() {
play();
clearInterval(delay);
}
This script creates a random pause before a movieclip will repeat. It works great in each MC, but I am using it in multiple MCs (in each SWF) all over the place and it seems to be interfering with the timing for the overall movie.
By using this script in multiple places at the same time, am I going to have problems? What's the best resolution? Making it a function? Can you help me with syntax? If I need to this a function, do I create the function in each SWF (that will be layered)? Or can they all reference the same function, on the root level? I'm dumb...
Actionscript Singular Button Navigation To Multiple Places In Timeline?
I have a navigation menu that is a movieclip (menu_mc). In the movieclip are 5 buttons. i need the buttons, when clicked, to play a different area of the timeline, dependent on where the user is on the timeline.
I've tried writing this actionscript on the main timeline. But can't get anything to work and am a little lost. for example---
Say the viewer is on frame 5, and clicks the "blue" button and jumps to frame 6. on frame 6 if they are to click "blue" button again i want to send them to frame 7, not to frame 6.
if anyone could direct me to a tutorial on how to write up something like this, especially one dealing with a very large timeline and multiple buttons, i'd be grateful!
Loading Multiple Movies That Share Images.
Hi all - probably making things difficult for myself, but I have an html page into which I'm loading three movies within a template...
Two of the movies contain exactly the same JPG images used in completely different ways, but I'm not sure how to go about making the JPG images "shared" across the two flash files (effectively I want to avoid having to load the same image content twice in two separate flash movies)...
Its been a long day - so I'm sure it's just me missing something obvious...
Any help would be vastly appreciated.
Regards.
Cormski
Loading Multiple Dynamic Images Into A Scrollpane Using XML?
Okay I am loading an XML file into a Flash movie. The XML loads images into an attached MovieClip and stack these them vertically. That part works fine.
What I'm having trouble with is getting the MovieClips (containing the images)to load into the scrollpane and space out accordingly.
I have a small area to load these images which is why I'm using the scrollpane. The images are actually loaded into a Movie Clip so I can apply actions for an on click.
Any help would be much appreciated!
Thank you
Display Loading Progress For Multiple Images/swf
hello,
is it possible to display the loading progress of an arbitrary number of images/swfs in only one loader?, i'm attaching some buttons using actionscript and each button have a different background image, the images are loaded dynamically because they may change, the number of buttons may change too, so i want to display a loader for the total download progress but i'm not sure how to do that
thanks for your help
Wait Multiple Loading Images: Loader
I would like to load different images with Loader object and put them in an Array.
1° QUESTION: can I use only one Loader object to load multiple images or I have to use one Loader object for each loaded image?
This array is the base images collection from which I'll generate new Bitmap objects.
My problem is that I have to wait the complete loading process before I can access to BitmapData.
2° QUESTION: How can I do that?
Thanks a lot
Loading Multiple Images Into Flash Via XML W/o Effects
Hey everyone! I'm using Flash CS3 and I'm trying to teach myself how to create flash photo galleries that dynamically load the images from an external xml file. I know there are tons of tutorials out there but none of them are right for me to learn this from scratch and that's what I want to do keeping in mind that...
I don't want them to rotate, scroll, blink, have mouseovers, show from thumbnail clicks, zoom in/out, have drop shadows, or anything else. I just want to see the image as if the flash movie was a blank HTML page and I just added the img tag to it.
I want to learn how to do it with multiple images, so I'm starting with two since it will give me less stuff to look at while I'm playing around with my xml file.
I'm not a script writer, but I understand the syntax and what things do once I've seen them. I just don't know functions, etc, off the top of my head, so I need a walk-through of the steps.
Deciding where the two images will be. What's the best way to create "placeholders" that will represent where the images are going to load?
Loading the xml file into flash. From what I've seen, there's a built-in load xml file function I can use?
Telling flash what stuff from the xml file should be used to display stuff in the placeholders and how to read it. This is where I'm completely lost lmao
Thanks so much ahead of time for any help you can offer. I do welcome links to tutorials as long as they're from ground zero up like what I'm asking for - nothing with extra design elements that are specific to the tutorial and not actually necessary to load images. Also, no information including preloaders. Thanks again!
Loading Multiple External Images Without Preloader....?
Hi people,
im having alittle trouble finding out the code for what im after.
Im wanting to load multiple images from and external folder into my flash movie when clicked on a button. I dont want a preloader and want these images to come in to a specific size and once clicked opens a new window with that image. The site is pritty much built up and just needs my portfolio artwork adding in.
Can anyone help me please, its urgently required for upcoming job interviews.
cheers
Loading Multiple Images From XML And Store In An Array
Good evening to all.
First of all, I'm registered for like, forever on Kirupa, but I can't remember introducing myself.
So, here I go:
I'm Gertjan from The Netherlands. I'm a designer/junior developer (in training) @ Studio Stomp in Amsterdam. And that's about it
So... hi!
Then the 'important' stuff:
I'm in the middle of my vacation and I decided to build my personal portfolio site.
The main experience will be in Papervision3D, I'll asume you all know what is . But that part is going fine.
Of course all the content will be in an external source, in my case: content.xml.
The problem I walked into, and what is totally drives me crazy is the following:
I want to load the images from the 'image' node from the 'project' node.
This is what a 'project' node looks like (this is 1 project, ofcourse content.xml has more projects):
Code:
<project id="001" client="specsavers" type="web" role="design" url="http://www.korting-op-bril-of-lenzen-per-zorgverzekeraar.nl/">
<image>images/work/web/specsavers01_01.jpg</image>
<image>images/work/web/specsavers01_02.jpg</image>
</project>
I want to preload the images from the xml and store them in an Array. All the other properties will also be dropped in that Array. Then I'll push this Array in an projectsArray so I can easily transfer this Array to different classes and extract what i need from them without loading every asset. In this way every entry in projectsArray is a project. (correct me if there's a better way, I'm learning here! ).
But, I can't get it to work! I tried several ways but none of them worked like I wanted to.
Ofcourse I allready googled, but I can't find the right instructions for my problem.
If anyone is willing to help me with this, or just refer to a page where I can find my solution...
I would be so thankfull.
Sincerly yours,
Gertjan
(oh by the way... i did allready sort of introduced myself couple of years ago *click*)
Loading Multiple Images Externally With Preloader
Hi everyone !
I'm trying to set up a portfolio page whereby i can showcase a series of images that load into flash with a preloader function. Have came cross examples similiar to this but only limited to one image per page. Can anyone guide me on this ? thanks...: )
Btw, it has to be easy to update coz i have a long list to put in..
regards,
Jen
Loading Multiple Images Using Moviecliploader Class
Hello,
I'm in need of a tutorial that explains how to load multiple images into seperate movieclips that uses the same listener in the 'moviecliploader' class (if you can do it that way).
The gallery that I'm doing is going to be xml driven, and each image that loads will need its own preloader. I know the fundamentals on creating xml driven galleries but not too sure on how to pre-load multiple images at the same time. Can anybody point me in the right direction or have any source files on how do this. I'd prefer a tutorial so I can get to grips with the whole concept.
Your help would be greatly appreciated,
Cheers
Set
Loading And Unloading Multiple Images In A Movie Clip
I have a project I'm working on now that is suppose to load images from an xml file into a movie clip. I have no problems loading an image but I just can't figure out how to unload that image. Basically when a button is clicked I want to unload the current image and load a new image in the same movie clip holder. Any help would be great!
ActionScript Code:
function ImageLoad(u:String,target,Ypos,Xpos){
var targetClip = target;
var positionY = Ypos;
var positionX = Xpos;
var logoLGHolder:Loader = new Loader();
var request:URLRequest = new URLRequest(u);
logoLGHolder.load(request);
targetClip.addChild(logoLGHolder);
}
player1Holder.addEventListener(MouseEvent.CLICK, slidePlayers1);
function slidePlayers1(mevt:MouseEvent):void {
ImageLoad(myXML.children().logoLG[0],logoLGHolder,0,0);
}
Loading A Single Movie Into Two Places
This is just a simple syntax question, how do I load one movie into two movieclips? If this cant be done, what's the work around?
Thanks for the help guys!
Help With Unique Random Images - Multiple Images At A Time
Ok so what i would like to do is set up a page that has 36 images on it. But every time anyone goes to the site i want them to show up in random order. I have jpgs they are all labeled 1.jpg, 2.jpg 3.jpg and so on. I have used code that pulls the images form a folder that the swf isnt in like /images/1.jpg. So what im saying is i want to pull them externally. Any one have any ideas on how to do this?
Attaching Multiple Images - Load Images One At A Time?
I have a photo gallery that loads many images using a for loop (image data is from XML file). Simplified code looks like this:
Code:
var photos_xml = new XML();
photos_xml.ignoreWhite = true;
photos_xml.onLoad = function(success) {
if (success) {
var photos = photos_xml.firstChild.childNodes;
var itemCount = 0;
for (var i = 0; i < photos.length; i++) {
var path = photos[i].attributes.path;
// attach the photos
var photo_mc = _root.center_mc.photosLevel1_mc.attachMovie("photoFrame_mc", photoName, itemCount);
photo_mc.empty_mc.loadMovie(path);
itemCount ++
...
Then on the photoFrame_mc clip I have a loading like:
Code:
onEnterFrame = function () {
loader_mc._visible = false;
var t = empty_mc.getBytesTotal();
var l = empty_mc.getBytesLoaded();
percent = Math.round((l / t) * 100);
if (l == t && t != undefined && t > 10) {
loader_mc._visible = false;
delete this.onEnterFrame;
} else {
loader_mc._visible = true;
if (isNaN(percent)) {
percent = 0;
}
loader_mc.percent_txt.text = 10 - Math.round(percent / 10);
}
};
So what happens now is that many images get attached at once and they are all loading at the same time.
What I'd like to do instead is to have them load one at a time. The first pass through the for loop attaches an image and then it loads, but it doesn't move on to the next image until the first one is done loading. Is that possible?
Or maybe is it better to let them load all at once? I just think that when the image count is very large it will really bog down loading so many images at once and it might be best to load one at a time. Please advise.
How Can I Load, Multiple Images Into Multiple Key Frames At Once..
Hey guys, I have this..pseudo 3d model viewer for my site that I am working on. The only problem is, I don't want to manually add every image to the flash...especially if I have 45 images or so and I am pretty sure there is no way to automate this in actionscript..
http://www.pcgamemods.com/slideshow/revolve.html
this is a pretty crude example but it shows you what I am aiming for. I just wanted to know if there was an easier way to add images to frames or if there was a program to do it for you.
Loading External Images Randomly, Getting The Amount Of Images Out A *.txt
hello there!
i've made an a script that loads images externaly from a specific map
randomly. there's only one thing:
how can flash learn to know how many images are loaded?
it's for a client so he can only upload the images and that's it.
can he somehow fill in a *.txt-file that flash can use further???
this is my sourcecode for the external-stuff:
code:
_root.importImage = "background_netomzet"+random(*)+".jpg";
(the * has to be a value that needs to be generated by how many pics
there are in the image map")
thanks a million people!
g
Loading Multiple Txt Variables Into Multiple Txt Fields From One Txt Doc - POSSIBLE?
I'm wondering, for efficiency sake, if it's possible to load into my main timeline multiple text variables from ONE external .txt document then have that information populate multiple dynamic text fields located in an MC within an externally loaded .swf. held in a containerMC on _level0?-eg path. _level0.containerMC.MCInstanceWithinLoadedSwf.???
If this is possible, how would it be done?Would I simply just use one loadvariableNum action for all?How would the text within the .txt doc be formatted?
- would I simply just list what each textfield variable is = to?
Loading Images Into A Container-H And V Images Centered
I am trying to load multiple images into a container clip to make an image gallery. Since there are both horizontal and vertical images I want the images to load into the center of the container clip (the center of container clip is aligned with the center of each image) because I cannot align both h and v images in my design by a corner. how do I do this?
Thank you!
|