Flash Problem
- Started
- Last post
- 18 Responses
- CyBrainX
I've been trying to build a gallery that loads jpegs dynamically with the movieClipLoader class and functions. The jpegs are in the same directory and are named 1.jpg, 2.jpg, ...197.jpg
How would you go about doing this?
One of my problems is that I don't know how or if I should dynamically name a new movieClipLoader object for each new image. No matter what I do, I can't get more than one image to work.
I've been on this for a month and a half. (Yes, I'm that lame.)
- unfittoprint0
are you doing it progresivelly?
#1 have a list of those jpegs paths on an XML/array.
#2 create a var count:Number = 0 to target the images in your array/xml.
#3 a for loop to create all the jpeg containers, using as a reference your xmlimages path array.
#4 add an onLoadComplete event to an moviecliploader listener. increment the count var after completion. proceed to the next loadclip();
#5 myloader.loadClip(images[count...
note: even tough I use a personal Loader version, I'm pretty sure that the same MovieCLipLoader Class object can load multiple images.
- CyBrainX0
I'm not sure what you mean by progressively. I was loading each image every time the next/prev button in my movie was released.
Another question I should have asked before: Can I use the same listener for each new image or do I have to create a new one each time?
- unfittoprint0
I tought you were trying to load a sequence of images at once [ie. thumbnails]. my bad.
regarding your question: your listener targets your moviecliploader, not the image loaded. so the answer is yes.
each time you change your loadclip parameters [target/path] the class will target a new image and, indirectly, so will the event listener.
it will be triggered every time loading starts/progresses/finishes [as long you add all these events]
- CyBrainX0
Thanks very much. I'll give it a shot.
- CyBrainX0
Well, I tried your advice, but it's not working. This movie has a "next" button that increments the img variable.
This is my script on frame 1:
img = 0;
imgTotal = 194;
fadeTime = 2;
var imgArray:Array = new Array(193);
/**/
for (img = 0; i < imgTotal - 1; img++) {
// THIS LINE CAUSED FLASH TO FREAK OUT
var container:MovieClip = createEmptyMovieClip("container" + img + "_mc", getNextHighestDepth());
}
function onLoadComplete(mc:MovieClip) {
trace("img: " + img + 1 + " onloadComplete");
container._x = 0;
container._alpha = 0;
container.swapDepths(interface_m...
}
advance = function () {
var mcLoader:MovieClipLoader = new MovieClipLoader();
mcLoader.addListener(this);
mcLoader.loadClip(imgArray[img], container);
container.alphaTo(100, fadeTime/2, "easeOutQuad");
trace("x= " + container._x + " alpha= " + container._alpha + " day: " + day + " img: " + img + " array " + imgArray[img]);
};
advance();Why can't I create an array of 194 empty movie clips?
- version30
like this?
http://pixeltwins.com/content/ve…i just use a php load var function that looks for as many imgs are in the specified directory
click the right side of the image for next, left side for previous
same thing here
http://pixeltwins.com/online/nt/…
- unfittoprint0
you were using wrong parameters on the for loop [ie. using img]
add your event listenrr before everything.
intiaite the objects outside functions scope
something like this:
http://pastebin.coconut.se/?id=4…
- CyBrainX0
Thanks for the pastebin. I'm not very experienced with the array class. Every reference to imgArray results in undefined.
- joyride0
Thanks for the pastebin. I'm not very experienced with the array class. Every reference to imgArray results in undefined.
CyBrainX
(Jun 4 06, 11:26)You didn't put anything in it, so yeah its going to be undefined.
- Point50
I don't know much about flash or array stuff, but what I do know is that there were some chicks getting there tongue on in v4's image gallery...
- unfittoprint0
re > fresh
http://pastebin.coconut.se/?id=4…
- version30
I don't know much about flash or array stuff, but what I do know is that there were some chicks getting there tongue on in v4's image gallery...
Point5
(Jun 4 06, 11:45);)
click the black splotch on the upper left, there are 2 more galleries in there too
- CyBrainX0
Now, the active traces out undefined with any of those references. I'm totally confused. I'll be reading up on this for sure.
I did enjoy the lesbionics though.
- unfittoprint0
http://pastebin.coconut.se/?id=4…
it traces "_level0.container0_mc" for the first "advance()".
- joyride0
I don't know much about flash or array stuff, but what I do know is that there were some chicks getting there tongue on in v4's image gallery...
Point5
(Jun 4 06, 11:45)I said it before and i'll say it again... God bless the lesbians!
Anyways, does the new code do it for you cy?
- CyBrainX0
I'm sorry, I know I'm not grasping all of the name passing and array manipulation, but the onLoadComplete function never gets called. I've been staring at this for a while now, but I have no idea why.
- unfittoprint0
merda.
forgot to add "new MovieClipLoader()".
onLoadCmplete never got called because the object wasn't even initiated...
how about now?
- CyBrainX0
That was it. I posted my final adjustments before moving the whole deal back into my real movie.
Thanks for all the advice. I'll be finished this year afterall.