PDA

View Full Version : dynmaic gallery / resizing



mucho
March 16th, 2004, 02:56 PM
Hi All,

I'm almost certain this was down with dynmaiclally with AS http://www.softbimage.com/sbpics . I've searching the forum and several other sites to figure out ho that was done, without success.

Do you guys have ideas?

thanks for considering,

m.

Seticus
March 16th, 2004, 03:30 PM
http://www.kirupaforum.com/forums/showthread.php?s=&threadid=49016

mucho
March 16th, 2004, 04:40 PM
SWEET! muchas gracias amigo...

m.

Seticus
March 16th, 2004, 05:17 PM
no problem

mucho
March 16th, 2004, 05:33 PM
seticus,

I just PM'd you (sorry for that) couldn't really get a hold of how the dynmaic cont. would work...
m.

Seticus
March 16th, 2004, 05:38 PM
you could place all the url's in an array and then load the images into a mc (using loadmovie)

mucho
March 16th, 2004, 05:41 PM
you lost me ... well I get it kind of, but not really.
m.

ps. would I have to insert the dimension of each ind./ picture as well (into the .xml file)?

Seticus
March 16th, 2004, 05:46 PM
place all the url's in your xml-file and then load them in flash and the use loadmovie to load the picture in a mc

you can write a script to get the dimensions of the picture, but in the example of yours (softbimage) they have inserted all the dimensions in the xml-file

mucho
March 16th, 2004, 06:07 PM
this is how i adjusted the script..but something tells me it something is royaly wrong. plus i think it would be better to insert a script that determines the dimensions, no ?!

m.

// -------------------------
// shell movie dimensions
// -------------------------
movieW = 650;
movieH = 600;

// ------------------------------------------------------------
// create array housing external movies and their dimensions
// ------------------------------------------------------------
//loadURL = new array();
//loadURL[0] = "mousetrails_triangles";
//loadURL[1] = "mousetrails_xyscale";
//loadURL[2] = "mousetrails";

images_xml = new array();
images_xml.onLoad = startImageViewer;
images_xml.load("xml/images.xml");
images_xml.ignoreWhite = true;

function startImageViewer(success) {
if (success == true) {
rootNode = images_xml.firstChild;
totalImages = rootNode.childNodes.length;
firstImageNode = rootNode.firstChild;
currentImageNode = firstImageNode;
currentIndex = 1;
updateImage(firstImageNode);
}
}

function updateImage(newImageNode) {
imagePath = newImageNode.attributes.imgURL;
targetClip.loadMovie(imagePath);
//imageCount = "Viewing image " + currentIndex + " of " + totalImages;
}


next_btn.onRelease = function() {
nextImageNode = currentImageNode.nextSibling;
if (nextImageNode == null) {
break;
} else {
currentIndex++;
updateImage(nextImageNode);
currentImageNode = nextImageNode;
}
};



loadW = new array();
loadW[0] = 600;
loadW[1] = 600;
loadW[2] = 400;

loadH = new array();
loadH[0] = 500;
loadH[1] = 400;
loadH[2] = 500;

// ----------------------------------
// load the selected movies
// ----------------------------------
count = 0;
mov0._visible = false;

function uploadMovie(sel) {
this.i = 0;
this.doneLoading = false;

currentMovie = sel;

count++;
blank.duplicateMovieClip("mov" + count, count);

loadhere = this["mov" + count];
prevload = this["mov" + (count - 1)];

loadhere.loadMovie(loadURL[currentMovie] + ".swf");

this.onEnterFrame = function() {
this.i ++;
if (loadhere.getBytesLoaded() == loadhere.getBytesTotal() && this.i >= 2) {
if (!this.doneLoading) {
this.doneLoading = true;
finalW = loadW[currentMovie];
finalH = loadH[currentMovie];

// position new movie centered
loadhere._x = (movieW - finalW) / 2;
loadhere._y = (movieH - finalH) / 2;

loadhere.setMask(mask);

if (count != 1) {
prevload.removeMovieClip();
}
}
mask._width += (finalW - mask._width)/3;
mask._height += (finalH - mask._height)/3;

if (Math.abs(mask._width - finalW) < 1 && Math.abs(mask._height - finalH) < 1) {
mask._width = finalW;
mask._height = finalH;
delete this.onEnterFrame;
}
}
};
}