Tracking Forums, Newsgroups, Maling Lists
Home Scripts Tutorials Tracker Forums
  Advanced Search
  HOME    TRACKER    Flash




Trouble With Positioning Of Images In Gallery



I decided I should probably post this in the Newbie forum rather than the ActionScript forum, since I am a noob to Flash and this is more of a general Flash question than an ActionScript one.

I'm trying to create a Flash gallery of image files I will later embed within another Flash file to create a portfolio of some of my art and design work. The gallery I'm working with is a modified version of the one found at kirupa.com at http://www.kirupa.com/developer/mx2004/thumbnails2.htm .

For reference, here is the .fla file I'm working with right now (I'm using Flash 8, btw):
http://www.johnmilesart.com/Sketches/Sketches.fla
Here's a version saved for MX 2004:
http://www.johnmilesart.com/Sketches/SketchesMX2004.fla

Here is the associated .xml file:
http://www.johnmilesart.com/Sketches/images.xml

And here is the compiled .swf file:
http://www.johnmilesart.com/Sketches/Sketches.swf

The images themselves are located under the directory http://www.johnmilesart.com/Sketches/SketchesImages/ . They are gloveandhat.jpg , ladyinhatandglasses.jpg , and newbalance.jpg .

As you will see once you take a look at the .swf, I'm having some trouble getting the images to display zoomed and positioned how I want them. I have a box 500 px in width and 400 px in height set up to display them, and each image has been created at exactly these dimensions to fit perfectly. However, for some reason the images are displaying zoomed in and positioned off-center. I'm sure there's a relatively easy solution to this problem, but being new to Flash, it's evading me right now. I'd appreciate it greatly if someone could help me out a bit with this. Also, as you'll probably notice, I decided to remove the thumbnail navigation aspect, leaving just the next and previous buttons to navigate. If someone could help me remove the leftover thumbnail code to save space, that would be great.

Thanks again!



FlashKit > Flash Help > Flash Newbies
Posted on: 02-25-2006, 08:26 PM


View Complete Forum Thread with Replies

See Related Forum Messages: Follow the Links Below to View Complete Thread

Trouble With Dynamic Positioning _y
I’m stumped with this maybe someone here can help.

I have a list of collapsible move clips.
When anyone of the clips is closed or opened the rest or the clips in the list react by changing position.
I had this running with and on enter frame event. But that was a memory hog when too many items were in the list.
So what I want to do is this
When any clip is closed or opened it triggers this function



Code:
function resetY() {

for (var i = order; i>=many; i++) {
this.onEnterFrame = function() {
_y = previousitem._y+previousitem.box._height;
roundB4me = Math.ceil(previousitem._y+previousitem.box._height);
roundme = Math.ceil(_y);
if (roundB4me == roundme) {
delete this.onEnterFrame;
}


}
}
My problem is with placing this clip on clips in the _parent.
So what I want is more like this:



Code:
function resetY() {

for (var i = order; i>=many; i++) {
_parent[nextClip+i]onEnterFrame = function() {
_y = previousitem._y+previousitem.box._height;
roundB4me = Math.ceil(previousitem._y+previousitem.box._height);
roundme = Math.ceil(_y);
if (roundB4me == roundme) {
delete this.onEnterFrame;
}


}
}
But I cant use: _parent[nextClip+i]onEnterFrame = function() {
Can any one help me out with this?
Thanks for any help!

Trouble Positioning MCs And Textfields
The picture shows what I'm trying to do.

Here's my code:

Code:
for (var i = 0; i<nTotalPics; i++) {

main.createEmptyMovieClip( "container"+i, i );
var container:MovieClip = main["container"+i];
container.createEmptyMovieClip( "pic"+i, i );
var pic:MovieClip = container["pic"+i];

// load images
mcl.loadClip( astrImages[i], pic );
}

// when the image finishes loading
mclListener.onLoadInit = function(pic:MovieClip){
_level0.main.container2.createTextField("txtQuan", i+1, 0, 100, 80, 20);
var txtQuan:TextField = _level0.main.container2.txtQuan;
txtQuan.text = "How many : ";
}

// add the listener to the MovieClipLoader Object
mcl.addListener(mclListener);
I've got two questions:

First, if I add "trace (pic._name);" inside the onLoadInit function it outputs "pic3,pic2,pic1,pic0". Why does it show up in reverse order of the for-loop?

Second, is the "pic:MovieClip" in "mclListener.onLoadInit = function(pic:MovieClip)" pointing to the "pic" in "mcl.loadClip( astrImages[i], pic );"? If not, what is it pointing to? If it is, can I add another variable after "pic" so that I can pass it inside the onLoadInit function?

Ultimately what I would like to do is create a textfield under each pic.

I know this is a lot. It's just too much for me to troubleshoot because I'm overwhelmed with all of these at once. If you can answer just one question I would greatly appreciate it. Thanks all.

Positioning Content Trouble
Hi and thanks for a great forum!

Im using this code to position my logo on the first frame and it works:

Stage.scaleMode = "noScale";
Stage.align = "TL";
var stageListener:Object = new Object ();
stageListener.onResize = positionContent;
Stage.addListener(stageListener);
function positionContent():Void {
mcLogo._x = Stage.width / 2 - mcLogo._width / 2;
mcLogo._y = Stage.height / 2 - mcLogo._height / 2;
}
positionContent();

But if i want to position more movieclips on lets say frame 3, i thought i could just ad them to the function i have on the first frame like:

Stage.scaleMode = "noScale";
Stage.align = "TL";
var stageListener:Object = new Object ();
stageListener.onResize = positionContent;
Stage.addListener(stageListener);
function positionContent():Void {
mcLogo._x = Stage.width / 2 - mcLogo._width / 2;
mcLogo._y = Stage.height / 2 - mcLogo._height / 2;
mcNew._x = Stage.width / 2 - mcNew._width / 2;
mcNew._y = Stage.height / 2 - mcNew._height / 2;

}
positionContent();

But when i put the new mc on frame 3, it doesnt position like i wrote in the function on frame 1. It just stays where i put it on the stage.

Any idea what im doing wrong?

Cheers!

Andreas

Trouble Positioning Loaded Movie
Now that I got my swfs for my menu to show up (which link to different scenes in my root movie), I need to put a pointer showing which link it is currently on. What I want to do is load the pointer (a right-facing triangle) as a movie over the menu which is on level2. So I load the pointer movie onto level 4 and I want it to appear in different locations for each link (will be called from a each scene in the root movie). So I have this:

loadMovieNum("pointer.swf", 4);
setProperty(_level4, _x, 50);
setProperty(_level4, _y, 100);

I can't seem to manipulate where the pointer appears on my root movie. If I make a button and put the above setProperty as the action, it works fine, but I want it to appear in the proper place automatically. The pointer movie is 25x25 pixels. I don't want a separate pointer movie for all 15 links, so I'd like to be able to position this one. Thanks.

AS 2 Trouble With Positioning Dynamic Text For A Menu
I've got some simple code that I'm struggling with. Can someone point out what I've done incorrectly? I can't position the text in the center of gradient_mc, and the trace reports that the gradient_mc is NOT 200 wide, like it should be.

What am I missing?

All that's required is a linked font symbol in the library.

Thanks everyone

QUICK EDIT:
if I change the numbers in the creation of the textField and comment out the line for autosize, the height and width seem to be correct.
What if I can't know the width of the text? Shouldn't autosize do the trick?


Code:
gradient_mc.createTextField("myText", gradient_mc.getNextHighestDepth(), 0, 0, 200, 32);

Code:
var SW:Number = Stage.width;
var SH:Number = Stage.height;
var _gradientWidth:Number = 200;
var _gradientHeight:Number = 32;
//_textsize set to the approximate width of a letter
var _textsize:Number = 18;
this.createEmptyMovieClip("gradient_mc", this.getNextHighestDepth());

gradient_mc.createTextField("myText", gradient_mc.getNextHighestDepth(), 0, 0, 0, 0);
var myTextFormat:TextFormat = new TextFormat();
//TextField myText;
//TextFormat myTextFormat;
myTextFormat.font = "Artist_Choice";
myTextFormat.size = _textsize;
myTextFormat.color = 0xFFFFFF;
myTextFormat.align = "left";
gradient_mc.myText.autoSize = "left";
gradient_mc.myText.multiline = true;
gradient_mc.myText.border = "true";
gradient_mc.myText.embedFonts = true;
gradient_mc.myText.antiAliasType = "advanced";
gradient_mc.myText.gridFitType = "subpixel";
gradient_mc.myText.sharpness = 75;
gradient_mc.myText.thickness = -15;
gradient_mc.myText.text = "hey there";
gradient_mc.myText.setTextFormat(myTextFormat);
//
gradient_mc.myText._x = gradient_mc._width / 2;
gradient_mc.myText._y = gradient_mc._height / 2;
trace("gradient_mc.myText._x " + gradient_mc.myText._x);
trace("gradient_mc.myText._y " + gradient_mc.myText._y);
trace("gradient_mc._width " + gradient_mc._width);
trace("gradient_mc._height " + gradient_mc._height);
trace("gradient_mc.myText._width " + gradient_mc.myText._width);
trace("gradient_mc.myText._height " + gradient_mc.myText._height);
/*
gradient_mc.myText._x = (gradient_mc._width/2) - (gradient_mc.myText._width/2);
gradient_mc.myText._y = (gradient_mc._height/2) - (gradient_mc.myText._height/2);
*/
var fillType:String = "radial";
var colors:Array = [0x651178, 0x8888FF];
var alphas:Array = [100, 100];
var ratios:Array = [0, 0xFF];
var matrix:Object = {a:_gradientWidth, b:0, c:0, d:0, e:_gradientHeight, f:0, g:_gradientHeight, h:_gradientHeight, i:1};
var spreadMethod:String = "reflect";
var interpolationMethod:String = "linearRGB";
var focalPointRatio:Number = .95;
with (gradient_mc) {
beginGradientFill(fillType, colors, alphas, ratios, matrix, spreadMethod, interpolationMethod, focalPointRatio);
moveTo(0, 0);
lineTo(_gradientWidth, 0);
lineTo(_gradientWidth, _gradientHeight);
lineTo(0, _gradientHeight);
lineTo(0, 0);
endFill();
}

2.0 Xml Gallery Caption Positioning
Hi--

I am running a 2.0 xml gallery and am trying to figure out how to add captions. There are a few things I'd like to know. First, how to add a caption to a loaded xml image (this is a a pic of...) and second, how to position each caption in relation to the image (ie, not a static position -- if the image is tall, then on the side, wide, on the top, etc). Would this be a separate class(s)?

Any help would be appreciated.

Thanks

Positioning MC's (picture Gallery)
Hi I'm new here and but have known about kirupa.com for several years now. I appreciate that the tutorials are always well written and easy to follow.

I've been following the tutorial to make my own flash gallery + scroll for my website, the tutorial can be found here (http://www.kirupa.com/developer/mx2004/xml_flash_photogallery.htm).

After completing the tutorial I noticed that the picture generated in the image wouldn't always be centered, because I have vertical and horizontal images in my gallery. I understand that the picture is drawn in the image instance under instance name picture starting from the top left corner. I took a look at the code and it seems to be doing most of the picture generation in the two functions prevImage and nextImage. I tried to write my own function to call within these codes to center the image and here it is.

function reposition(){
//check if the image width is less than 700
if (image[p].width < 700){
//set the coordinate further right since it will be a vertical picture
image[p].x = 298;
}else{
//set coordinate further left since it will be a horizontal picture.
image[p].x = 100;
}
}

I then proceeded to call this reposition in both prevImage and nextImage however the images have not moved. I have been trying to get this to work for sometime now and would appreciate it if someone could lend a hand Here is a link to my gallery i'm making, as u can see it the vertical images are not centered. (http://skulehouse.cybersmart.ca/gall...ncgallery.html)

Trouble With Y-axis Positioning / Formatting Dynamic Text Field
Hi,

Ok, here's what I've got. I have an input text field and then a submit button. The submit button places whatever text that the user enters into the input field into a dynamic text field. I then have three buttons that change the font in the dynamic field, and three more buttons that change the fontsize (using if statements).

My problem is that one of the fonts does not line up exactly as the others do on the y axis. It appears to jump down a few units when I change the font. Also, when I change the font size, using the buttons, they align to the top of the text box, appearing jump up. I've been trying all kinds of scripts, but theres always something that causes trouble.

I'm wanting the positions along the y axis for each font to appear to be even, which I have accomplished simply by defining the y-axis position for each font, on each button that changes the font. That works great. But when I change the font size to a smaller font, I want each size to still line up on the y-axis. And after I achieve this, the movie needs to be able to remember the positioning for when I go back to change the font, it will not jump back to where it was before.

Here's my script on one of the buttons that change the font:

on (release) {
myTxtFmt = new TextFormat();
myTxtFmt.font = "Franklin Gothic Medium";//Linkage name of the font in the library
_root.SignTextColor.setTextFormat(myTxtFmt);
_root.SignTextColor.setNewTextFormat(myTxtFmt);
_root.SignTextColor._y = 7.2;
gotoAndStop(1);
}



Here's my script on one of the buttons that change the font size:

on (release) {
myTxtFmt = new TextFormat();

if (myTxtFmt.font != "Franklin Gothic Medium") {
myTxtFmt.size = "57";
_root.SignTextColor.setTextFormat(myTxtFmt);
_root.SignTextColor.setNewTextFormat(myTxtFmt);
}
if (MyTxtFmt.font != "ATFAntique") {
myTxtFmt.size = "55";
_root.SignTextColor.setTextFormat(myTxtFmt);
_root.SignTextColor.setNewTextFormat(myTxtFmt);
}
if (myTxtFmt.font != "Hudson") {
myTxtFmt.size = "58";
_root.SignTextColor.setTextFormat(myTxtFmt);
_root.SignTextColor.setNewTextFormat(myTxtFmt);
}

gotoAndStop(1);
}



Can you help?
Thank you very much!

Positioning In Dynamic Image Gallery
Hi

I have built a dynamic image gallery that works brilliantly except that the loaded image falls in the top left corner of the container.......which i have a feeling there is not much i can do about.
So is there a way of determining the image size and work off that so that I can adjust the area for the image so that it can be centralized irrespetive of image shape.

i hope you know what i mean. ( i also hope i know what I mean?)

Photo Gallery - Thumbnail Positioning
This post is in regards to the thumbnails of the great XML and Flash Photo Gallery Tutorial by Kirupa.... I've searched through the other posts and haven't found anything that matches my problem. I'm very new at Flash and this is my first post so I would appreciate any help you might be able to offer.

Essentially, I've got the gallery and thumbnails up and running, but I have a small problems with how the thumbnails appear when the gallery is first opened. When I open the gallery the first thumbnail appears near the center of the thumbnail scrolling area (subsequent thumbnails to its right), instead of at the left edge as it should, and the left side of the scrolling area is blank. When I move the mouse over the scrolling area the thumbnails scroll without any problems and that first thumbnail (the one that was initially out of place in the center) will move to the left of the scrolling area, and then beyond, as it should. When scrolling back to the right, the first thumbnails returns only to the left edge of the scrolling area (as it should) and not the the center of the field (where it initially appeared out of place).

Some of the relevant code is below. Any help would be much appreciated. Thanks!

Mike


function loadXML(loaded) {

if (loaded) {

xmlNode = this.firstChild;
image = [];
description = [];
thumbnails = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {

image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
thumbnails[i] = xmlNode.childNodes[i].childNodes[2].firstChild.nodeValue;
thumbnails_fn(i);

}
firstImage();

} else {

content = "file not loaded!";

}

}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {

if (Key.getCode() == Key.LEFT) {

prevImage();

} else if (Key.getCode() == Key.RIGHT) {

nextImage();

}

};
Key.addListener(listen);
previous_btn.onRelease = function() {

prevImage();

};
next_btn.onRelease = function() {

nextImage();

};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
//you can retrieve the right width and height here
//replace yourcenterx (and -y) with the values you need
picture._x = 300-picture._width/2;
picture._y= 250-picture._height/2;
if (picture._alpha<100) {
picture._alpha += 4;

}
}
};
function nextImage() {

if (p<(total-1)) {

p++;
if (loaded == filesize) {

picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();

}

}

}
function prevImage() {

if (p>0) {

p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();

}

}
function firstImage() {

if (loaded == filesize) {

picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();

}

}
function picture_num() {

current_pos = p+1;
pos_txt.text = current_pos+" / "+total;

}
function thumbNailScroller() {

// thumbnail code!
this.createEmptyMovieClip("tscroller", 1000);
scroll_speed = 9;
tscroller.onEnterFrame = function() {

if ((_root._ymouse>=thumbnail_mc._y) && (_root._ymouse<=thumbnail_mc._y+thumbnail_mc._heig ht)) {

if ((_root._xmouse>=(hit_right._x-40)) && (thumbnail_mc.hitTest(hit_right))) {

thumbnail_mc._x -= scroll_speed;

} else if ((_root._xmouse<=140) && (thumbnail_mc.hitTest(hit_left))) {

thumbnail_mc._x += scroll_speed;

}

} else {

delete tscroller.onEnterFrame;

}

};

}

function thumbnails_fn(k) {

thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
tlistener = new Object();
tlistener.onLoadInit = function(target_mc) {

target_mc._x = hit_left._x+(eval("thumbnail_mc.t"+k)._width+5)*k;
target_mc.pictureValue = k;
target_mc.onRelease = function() {

p = this.pictureValue-1;
nextImage();

};
target_mc.onRollOver = function() {

this._alpha = 50;
thumbNailScroller();

};
target_mc.onRollOut = function() {

this._alpha = 100;

};

};
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip(thumbnails[k], "thumbnail_mc.t"+k);

}

Flash And XML Image Gallery Positioning.
Hi

I am using Flash 8 for this and XML to create an external/dynamic image gallery. The problem i have is that when you drag to make the screen bigger or smaller the image moves position and does not stay central. Attached is the fla for you to look at as it doesnt make much sense when describing it!

Also is there anyway to add a movable/ change size with the picture black box around the images?


thanks for any help.

Flash Gallery - Image Positioning & Overlapping?
Hey All,
Well i have a friend that has been following a tutorial on how to make a flash gallery, hes completed it and it all works although he does ahve a problem with some of the images overlapping and the positioning of the main frame where the images are displayed. i'm not sure what to do with this as i'm pretty new to flash. could someone have a look and correct this for him or even give us an idea of where hes went wrong.

Many Thanx :)

Link:
http://www.mediafire.com/file/jwihjazditg/gallery.fla

XML Photo Gallery Image Positioning Problem
I modified the AS in Lee's Introduction to XML where there was a photo gallery.

I needed to have my images centered in the event that they were different sizes.

My problem is this. Ever so often, when going through the images in the gallery a image will randomly load to the lower right hand corner.

Can somebody look at the AS and see what might be causing this rare event?

Thanks, in advance!

I have published the SWF as Flash 7/AS2 and Flash 8/AS2 using it on different websites and have the same rare issue with both.

Here's the portion where image positioning is addressed, which might be the culprit:

Code:

if (picture._alpha<100) {
picture._alpha += 10;
showWidth = picture._width;
showHeight = picture._height;
picture._x = (Stage.width/2) - (picture._width/2) +10; //based on width of left border
picture._y = (Stage.height/2) - (picture._height/2) +15;
}

Here's the complete AS
Code:

stop();

function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {
image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;
}
firstImage();
} else {
content = "file not loaded!";
}
}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
//xmlData.load("photos/gallery.xml");
xmlData.load("photos/gallery.xml?cachebuster=" + new Date().getTime());
/////////////////////////////////////
listen = new Object();
listen.onKeyDown = function() {
if (Key.getCode() == Key.LEFT) {
prevImage();
} else if (Key.getCode() == Key.RIGHT) {
nextImage();
}
};
Key.addListener(listen);
previous_btn.onRelease = function() {
prevImage();
};
next_btn.onRelease = function() {
nextImage();
};
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
showWidth = picture._width;
showHeight = picture._height;
picture._x = (Stage.width/2) - (picture._width/2) +10; //based on width of left border
picture._y = (Stage.height/2) - (picture._height/2) +15;
}
}
};
function nextImage() {
if (p<(total-1)) {
p++;
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
desc_txt.text = description[p];
picture_num();
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
}
}
function picture_num() {
current_pos = p+1;
pos_txt.text = current_pos+" / "+total;
}

Positioning Images In A Textfield
When you place an <img> tag in a textfield in mx2004, how do you make a <br>. Cause it doesn't place my text underneath the image... Also when you want place two images, 1 underneath the other, it places the second image on top of the other instead of under it.

Positioning When Importing Images
Hello!

I have a very strange problem and I'm not sure if this is something resolvable or simply a bug in Flash MX under Vista.

I have a previously saved file, and whenever I wish to import an image into it, the image gets imported at a totally idiotic location, eg. x=0, y=0.5, or x=-319.5, y=60, etc. However, when I do the same with a new movie, they import perfectly to x=0 y=0. (in both cases, I imported 640x480 jpgs into a 640x480 swf. I also tried importing into a movie clip, but even then some constant seems to influence the positioning and images get placed to such insensible places.

Theoretically, if I import an image on the 1st frame of a totally empty layer of the root movie, its positioning should not be affected by any registration point issue. Is this right?

Can you give me a hint on this?

Thanks a lot,
Peter

Positioning Images In A Textfield
When you place an <img> tag in a textfield in mx2004, how do you make a <br>. Cause it doesn't place my text underneath the image... Also when you want place two images, 1 underneath the other, it places the second image on top of the other instead of under it.

Positioning 2 Loaded Images Together In MX
I'm having trouble trying to work out how to centre 2 loaded images via XML. I found some code by scotty that will centre one image but of course when I'm loading 2 images, they are both stacked ont top of each other.

I think I know what I need to do but not sure how to transfer that into ActionScript. ie - I want to get the width of picture1 and picture2, put a bit of space in between and then centre them both on the stage.

Here is the code I have for that part (let me know if I need to post any other part of it). Can anyone help me amend what I've got to achieve what I need or do I need to do it a different way?


Code:
p = 0;
var cx = picture._x;
var cy = picture._y;
var dx = picture2._x;
var dy = picture2._y;
this.onEnterFrame = function() {
filesize = picture.getBytesTotal() && picture2.getBytesTotal();
loaded = picture.getBytesLoaded() && picture2.getBytesLoaded();
preloader._visible = true;
if (loaded != filesize) {
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
if (picture._alpha<100) {
picture._alpha += 10;
}
if (picture2._alpha<100) {
picture2._alpha += 10;
}
if (ClientMC.client_txt._alpha<100) {
ClientMC.client_txt._alpha += 10;
}
if (DescMC.desc_txt._alpha<100) {
DescMC.desc_txt._alpha += 10;
}
}
picture._x = cx-picture._width/2;
picture._y = cy-picture._height/2;

picture2._x = dx-picture2._width/2;
picture2._y = dy-picture2._height/2;

};
Thanks

Positioning Dynamic Images
Hello,

This is my first but probably not last time that I will be asking a question.

I am creating a fully dynamic XML based flash site.

here is a sample of some of my code:

myXML = new XML();
myXML.ignoreWhite = true;
myXML.load("gallery.xml");
myXML.onLoad = function() {
numimages = this.firstChild.childNodes.length
logospacing = 70
spacing =90;
for (i=0; i<numimages; i++) {
loader._x = 250;
loader._y = 220;
title_txt._x = 250;
title_txt._y = 420;
logos._x = 25;
trace (logos._x)
logos._y = 25;
picHolder = this.firstChild.childNodes[i];
this.logoHolder = _root.logos.createEmptyMovieClip("logo"+i, i);
this.logoHolder._x = i*logospacing;
this.logoHolder.logo = picHolder.attributes.logo;
this.logoHolder.campain = picHolder.attributes.campain;
this.logoLoader = this.logoHolder.createEmptyMovieClip("logo_image"+ i, i);
var twlm:Tween = new Tween(sep1, "_y", Regular.easeOut, 0, 92, 1, true);
var twlm:Tween = new Tween(logomask, "_alpha", Regular.easeInOut, 100, 0, 1, true);
var twlh:Tween = new Tween(logos, "_y", Regular.easeOut, -75,25, 1, true);
this.logoLoader.loadMovie(picHolder.attributes.log o);

My question is how do I position the created logoHolder with all the logos that are going to be dynamically loaded by the XML to be centered on the stage via _x.

I know that the positioning of the logoHolder can be positioned by setting the logos._x to a value and it will put it on the stage along the x axis.

What I would really like is for the logos to either be centered on the stage or have them spread out accross the stage evenly but staying within the boundaries of the stage.

If this is confusing I am sorry. But you can check out what I have done so far by going to HERE and what i mean by the logos being spaced. The logos I want spaced properly are the Puma logos.

Thnks in advance for your help.

Positioning Images In A Textfield
When you place an <img> tag in a textfield in mx2004, how do you make a <br>. Cause it doesn't place my text underneath the image... Also when you want place two images, 1 underneath the other, it places the second image on top of the other instead of under it.

Please Help Positioning Images Automatically - CS3
I'm having a problem with the following code. It places clips from the library into a movie clip (called container) and names them thumb1_mc, thumb2_mc etc. They are placed in a row and work fine when they are all the same width. But I have images of different widths and I have no idea how to alter the width line of code to get it working fine:


//places images on stage and positions them in a row in the centre

var imagesNumber:Number = 10;
for (i=1; i<=imagesNumber; i++) {
container.attachMovie("thumb"+i,"thumb"+i+"_mc",i) ;
myThumb_mc = container["thumb"+i+"_mc"];
myThumb_mc._x = (i)*myThumb_mc._width;
myThumb_mc._y = (Stage.height-myThumb_mc._height)/2
}

Please help, I'm getting desperate!!
Thanks in advance!

Positioning Images On Stage
Can any one help me! i thought this would be straight forward but it seems to of lost me now. Basically i am loading some data dynamically and want to position it like so (x = data)

x x x
x x x
x x x

etc...

but when i run the following code it does the following (again x = data)

x x xx x x
etc...

if (this.ref["bclip_"+i]._x<200) {
this.ref["bclip_"+i]._x = this.ref["bclip_"+(i-1)]._x+this.ref["bclip_"+(i-1)]._width+offset+13;
if (this.ref["bclip_"+i]._x>200) {
this.ref["bclip_"+i]._y = this.ref["bclip_"+(i-3)]._y+this.ref["bclip_"+(i-3)]._height+offset;
this.ref["bclip_"+i]._x = this.ref["bclip_"+(i-1)]._x+this.ref["bclip_"+(i-1)]._width+offset+13;
}

i thought i would just need to reset the x value so it goes back the original x position but if i do that it goes crazy.

Hopefully this makes sense if anyone could help... I would really like to learn why this is doing this and how i can fix it (or what i am doing wrong).

Thank you

Photo Gallery Tutorial Problem - Image Positioning
First off, excellent tutorial, the only one of its type that actually worked for me.

I have a main movie, whose image gallery is an external SWF file, the mainframe of which is Kirupa's tute.

I've called in the external SWF using:

this.createEmptyMovieClip("workSWF", 14);
workSWF.loadMovie("work/catagories/Catagories_Advertising.swf", 14);
workSWF._x = 15
workSWF._y = 15

Unfortunately, the linked images are off center from what I position them. Even the _x, _y trick isn't working. Registration point has been moved as well, still nothing.

Also, the buttons to flip through the images don't work. But all this works well if I use loadMovieNum () function.

I would post the website up, but its pretty large considering this company I'm interning at has a huge portfolio. The total file is about 30 megs (including movie clips, images, and false starts.)

Thanks in advance!

Positioning Externally Linked Images
Hello,
I got some code eariler for importing jps, but my roblem is now positioning them where I want the to be, I tried a bit of code that I thought of but it didn't work (below)

One more thing, whe I link these external images, how can I test them without having to export ? For example, this positioning, if i do i figure it out, there will e alot of back and forth to make sure it is in the right spot.



Code:
_root.createEmptyMovieClip("logo", 5);
_root.logo.loadMovie("daddy.jpg");
_root.logo._xscale = 50;
_root.logo._yscale = 50;
_root.logo._xposition = 300;
_root.logo._yposition = 100;

Positioning Images At Random Locations
hi all,

i've been working for the past two days on this project and i'm completely confused what is wrong. what i want to do is to have a set of pictures (drwan from an xml file) to be posted at random loactions around the content area. i'm using attachMovie() method to attach a template form and then assign picture that is to be displayed and the text.

first problem, going through the for loop to post each picture, it waits until everything is done, then puts everything at once. I would want it to post pictures as it goes along. and if i increase the number of pictures to 30 (the maximum) it complains that the loop is somehow infinite and goes nuts flashing all the clips.

second problem, i want to have a mouse over effect that enlarges the picture by a small amount and shows text. i tried masking the text and unmasking it, but when i mask, when I assign a .text value, it wouldn't show it.

third problem, i can't for the life of me get the pictures to show up. I tried a loader component, no luck. i tried loadMovie(), no luck. i'm stuck!

i've attached a zip with all the files.

any pointers would be appriciated

stillife

The Code For Positioning Images In Txt Files
It is possible to place and position images in txt.files that are being imported into movies but I have lost the script can anybody remember?

Automatically Resizing And Positioning Images
I have a dynamic website that I have been working on for about 6 months now. I have several sections that incorporate dynamically loaded images. I have no problem loading the images, but I am trying to get them to load in the same place as the holder object that I am loading them into but they always load to the corner and not the middle. I also need to auto-resize the images and wasn't sure how to do that.

my script goes something like this...

// loadPics
loadPics= function(){
this.holder.createEmptyMovieClip("imageHolder", 1);
this.holder.imageHolder.loadMovie(urlSource); //urlSource is from LoadVars object
this.holder.imageHolder._width= 100;
this.holder.imageHolder._height= 100;
this.holder.imageHolder._x= 0;
this.holder.imageHolder._y= 0;
};

I think that I need to make an onLoad function for the image that sets the size and position of the image so it runs those methods only AFTER the image has loaded. The other thing though, is I am not sure how to setup the registration point for the image to load in the center of the 'holder' movie clip. Help would be greatly appreciated.

[F8] Positioning Dynamically Loaded Images
hey!
i'm loading some images into the site i'm building dynamically and want them to come onto the screen bang in the middle. i'm loading them into an empty movieclip, called empty that's on the root timeline. here's my not-working script:


Code:
tempWedge.onRelease = function(){
launchImage();
loadMovie("illustration/"+_root.whichImage+".jpg", empty);
posEmpty();
trace(empty.width);
}
function launchImage(){
Tweener.addTween(overlay,{_alpha:80, time:0.4, transition:"easeInOutSine"});
Tweener.addTween(btmNav.bubble,{_alpha:0, time:0.4, transition:"easeInOutSine"});
}
function posEmpty(){
empty._x = (Stage.width/2) - empty.width;
empty._y = (Stage.height/2) - empty.height;
}


my trace of empty.width comes back as undefined. can anyone spot what i'm doing wrong here?
thanks guys!
emma.

Positioning Images In Movie Clip From Xml
Hi,
I am loading images from an xml file into an empty movie clip. Is there any code either for the xml or for the flash movie clip to specify each position for each image?
Thanks

Menu W/ Dynamic Images + Width & Positioning
For part of a site I'm working on, I'm creating dynamic submenus that are built from a loop into an empty movie clip, attaching set-up movie clips to display product names and load in external JPGs. I'd like to be able to center the entire menu horizontally but I realize that the widths of these movie clips cannot be determined until the JPGs are fully loaded in. My question is, how would I set up a function that could determine when all of these JPGs are loaded and then center their parent clip? And this function would have to apply to varying numbers of menu items and JPGs of varying widths -- can anyone help? Thanks...

Positioning Loaded Images In A Movie Clip
I have a movie clip (large) where I loaded an image into by using:

Code:
loadMovie(place+".jpg","large");
However the upper left corner of the image lines up with the center of the movie clip by default. I would like to have the center of the image line to the center of the clip. I am not sure what direction I should go in with the code or if I should rethink loading the image.

Any thoughts from anyone?

Positioning Images Loaded Through Html Formatted Xml
I have some questions, I have an xml file that's loaded into flash, with html formatting, like this:


Code:
<PAGE>
<ITEM>
<img src="img/logo.png"/><b>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Morbi lacus felis, euismod at, pulvinar sit amet, dapibus eu, eros. Etiam tellus. Nam vestibulum porttitor urna. Phasellus aliquet pretium quam. Proin pharetra, wisi nec tristique accumsan, magna sapien pulvinar purus, vel hendrerit ipsum tellus at ante.</b>
</ITEM>
</PAGE>
this will give me a left aligned image with text wrapping around it, starting on the right side of the image, and when the image ends it continues under it, now to the question, is there an easy way to make the image aligned to the right with the text to the left and then continuing under it?

or do I have to come up with another solution for this?
and if so, do you have any tips on the most efficient way to do it?

Dynamic Positioning Of The Rollover Images In A Movie Clip
hi everybody...

i am facing a problem... i have a movie in which i have 50 thumbnails dynamically added to a mc and i have a scroller to scroll the mc which works fine.. on each thumb i have a rollover image (which is a bigger image of the thumb) which works fine but i want the rollover image to be shown within the area of mask area which is not happening now.. i am attaching herewith the fla and swf...
please help..

Problems With Positioning Dyn. Attached Buttons & Centering Loaded Images [renamed]
this is a piece of my script...
what it has to do is to generate "j" buttons (j being the number of registrations from my database) and arrange them in rows of 5 or 6...
unfortunately the buttons are generated but are not arranged properly. i have 9 registrations in the database so there are 9 buttons... the first 8 are next to each other and the last one is somewhere to the right...

further on, at the release of a button it should create the lwLogo movieclip and load there a certain pic (the path being taken from my database). then the lwLogo mc should be centered on the screen... as this doesn't happen in the _root the center of the screen would be -442 in this movie clip so normally to center the image i should place lwLogo at -442-(lwLogo._width/2) but this doesn't work. the photos are loaded but not in the center...

would anyone please take a look?
thanks in advance



Code:
serie=0;
serii=0;
for(j=workEntries-1;j>=0; j--){
var mc = copyButton.duplicateMovieClip("copy"+j,j+10);
mc._x = (j-serii)*20;
if (mc._x>=120) {serie=serie+35; serii=serii+5}
mc._y =(15 + serie);
mc.id = workSection.childNodes[j].childNodes[1];
mc.nr=j;
mc.onRelease = function(){
removeMovieClip(_root.lwLogo);
this.createEmptyMovieClip(lwLogo)
lwLogo._alpha=0;
lwLogo.loadMovie(unescape(workSection.childNodes[this.nr].childNodes[2].firstChild.nodeValue));
if (lwLogo.getBytesLoaded() == lwLogo.getBytesTotal()) {
lwLogo._x=-442-(lwLogo._width/2);
this.onEnterFrame = function() {if (lwLogo._alpha<=100) {
lwLogo._alpha += 10;

Problems With Positioning Dyn. Attached Buttons & Centering Loaded Images [renamed]
this is a piece of my script...
what it has to do is to generate "j" buttons (j being the number of registrations from my database) and arrange them in rows of 5 or 6...
unfortunately the buttons are generated but are not arranged properly. i have 9 registrations in the database so there are 9 buttons... the first 8 are next to each other and the last one is somewhere to the right...

further on, at the release of a button it should create the lwLogo movieclip and load there a certain pic (the path being taken from my database). then the lwLogo mc should be centered on the screen... as this doesn't happen in the _root the center of the screen would be -442 in this movie clip so normally to center the image i should place lwLogo at -442-(lwLogo._width/2) but this doesn't work. the photos are loaded but not in the center...

would anyone please take a look?
thanks in advance



Code:
serie=0;
serii=0;
for(j=workEntries-1;j>=0; j--){
var mc = copyButton.duplicateMovieClip("copy"+j,j+10);
mc._x = (j-serii)*20;
if (mc._x>=120) {serie=serie+35; serii=serii+5}
mc._y =(15 + serie);
mc.id = workSection.childNodes[j].childNodes[1];
mc.nr=j;
mc.onRelease = function(){
removeMovieClip(_root.lwLogo);
this.createEmptyMovieClip(lwLogo)
lwLogo._alpha=0;
lwLogo.loadMovie(unescape(workSection.childNodes[this.nr].childNodes[2].firstChild.nodeValue));
if (lwLogo.getBytesLoaded() == lwLogo.getBytesTotal()) {
lwLogo._x=-442-(lwLogo._width/2);
this.onEnterFrame = function() {if (lwLogo._alpha<=100) {
lwLogo._alpha += 10;

Jpeg Gallery Help: Slow Loading + Trouble With Loading Gallery Swf Into Other Swf
HI (PC MX2004)

I am using the code below to load dynamically load jpegs into the swf. I am then loading that swf into another swf using loadMovie on a button. I have two unavoidable problems. Firstly when I click a button to load the swf all I get is the 'loading' text. then I click a different button for a different swf gallery and those images work fine. Then I click back on the first button and the images. I have attached a test file to illistrate this.

Secondly with the code below, the jpegs are fine up to about 7/8 then it slows down. I need to be able to have up to 25 images in each gallery. Is it something in the code or am I better off changing to an xml gallery? Much appreciated

link to show patheticness of transitions is http://www.louisasloan.com/gallery/drawings.html




Code:
code: //on layer called var//

var totalNumPics=1;
var maxDepth=1000;
var cpicnum=0;
var xi=50;
var yi=20;
var btnWidth=25;
var path="pics/1image";
var currentpic=0;



//on layer called functions//


function fadeout() {
if (this._alpha<0) {
this.onEnterFrame = undefined;
} else {
this._alpha -= 15;
}
}
function fadein() {
if (this._alpha>95) {
this.onEnterFrame = undefined;
} else {
this._alpha += 15;
}
}
function loadNextPic() {
if (_root.cpicnum<_root.totalNumPics) {
var pic_mcl = new MovieClipLoader();
var listener:Object = new Object();
listener.onLoadProgress = function(target:MovieClip, bytesLoaded:Number, bytesTotal:Number) {
trace(target+".onLoadProgress with "+bytesLoaded+" bytes of "+bytesTotal);
_root.percent = int(bytesLoaded*100/bytesTotal);
};
listener.onLoadComplete = function(target_mc:MovieClip, httpStatus:Number) {
_root.percent = "Done!";
var param = {_x:(_root.xi+_root.cpicnum*_root.btnWidth), _y:_root.yi};
var temp = _root.attachMovie("btn", "btn"+_root.cpicnum, _root.getNextHighestDepth(), param);
temp.num = _root.cpicnum+1;
if (_root.cpicnum == 0) {
_root["picHolder"+_root.cpicnum].onEnterFrame = _root.fadein;
}
_root.cpicnum++;
loadNextPic();
};
var temp = _root.attachMovie("picHolder", "picHolder"+cpicnum, maxDepth--, {_alpha:0, _x:50, _y:50});
pic_mcl.loadClip(_root.path+_root.cpicnum+".jpg", temp);
pic_mcl.addListener(listener);
}
}
loadNextPic();
// I added the below code to solve previous problem of loaded swf taking charge stage and emptying all other swfs. i am not sure if that is correct terminology but it fixed problem somehow on stage
this._lockroot = true;

XML Photo Gallery Trouble
I've got xml photo gallery which you can see at www.suziklinik.cz under the "Galerie".
Everything works pretty fine until I update the xml code with more then 5 albums. When I do that....for ex. I choose "album 2 or 3" and then I choose thumb/picture 1st or 2nd it always jumps to last album...why?
Please help guys
here is the flash code

Code:
this._lockroot = true;



// SETTING VARIABLES
currentpage = 1;
_global.whichalbum = 1;



//////////////////////////////////
function scalerf(w,h)
{
diffw = (w-bigframew);
diffh = (h-bigframeh);

if(diffw<=0&&diffh<=0)
{
scaler = 1 * 100;
}
else if (diffw==Math.max(diffw,diffh)) //scale to height
{
scaler = (bigframew/w) * 100;
}
else if (diffh==Math.max(diffw,diffh)) //scale to width
{
scaler = (bigframeh/h) * 100;
}
return scaler;
}

//LOADCLIP ACTIVITIES
_root.createEmptyMovieClip("looploop",-1000);
var my_mcl = new MovieClipLoader();
myListener = new Object();
myListener.onLoadStart = function (target_mc)
{
var loadProgress = my_mcl.getProgress(target_mc);
}
myListener.onLoadProgress = function (target_mc, loadedBytes, totalBytes)
{
///////////////////////////////////
// FOR PRELOADER PURPOSES
loaded = loadedBytes;
total = totalBytes;
percentage = Math.round(100*(loaded/total));
progressbar_mc.progresser_mc._xscale = percentage;
}
myListener.onLoadComplete = function (target_mc)
{
var loadProgress = my_mcl.getProgress(target_mc);
imageframe_mc.hold._alpha=0;
velo = 0;
imageframe_mc.hold.onEnterFrame = function()
{
w = imageframe_mc.hold._width;
h = imageframe_mc.hold._height;
if(w!=0&&h!=0)
{
scaler = scalerf(w,h);
if(scaler!=100)
{
imageframe_mc.hold._xscale = scaler;
imageframe_mc.hold._yscale = scaler;
}
imageframe_mc.hold._x = (bigframew - (w*(scaler/100)))/2;
imageframe_mc.hold._y = -1+(bigframeh - (h*(scaler/100)))/2;


if(imageframe_mc.hold._alpha<100)
{
accel = 0.3;
velo = velo + accel;
imageframe_mc.hold._alpha +=velo;

}

}
}
}


myListener.onLoadInit = function (target_mc)
{
//target_mc._width = 100;
//target_mc._width = 100;
}
myListener.onLoadError = function (target_mc, errorCode)
{
}
my_mcl.addListener(myListener);


/////////////////////////////////////
// XML PARSING
function imageListLoaded(whichalbum) {
//clear stage
for (var rr = 0; rr < noofrow * noofcolumn; rr++)
{
rr = rr + pageindex;
this["thumbframe"+rr].removeMovieClip();
this["thumbframein_mc"+rr].removeMovieClip();
rr = rr - pageindex;
}


//parameters
param = this.imageList_xml.firstChild.firstChild;
pc = int(param.attributes.noofcolumn);
pr = int(param.attributes.noofrow);
ptx = int(param.attributes.thumbxs);
pty = int(param.attributes.thumbys);
_global.ptw = int(param.attributes.thumbwidth);
_global.ptl = int(param.attributes.thumbheight);
_global.bigframew = int(param.attributes.bigframewidth);
_global.bigframeh = int(param.attributes.bigframeheight);
albumnamesx = int(param.attributes.albumnamesxs);
albumnamesy = int(param.attributes.albumnamesys);
albumnamescolor = param.attributes.albumnamescolor;
////////////////////////////////////////
var albumCountXML = this.imageList_xml.firstChild.childNodes;
albumCount = albumCountXML.length - 1;

var mainNode = this.imageList_xml.firstChild.childNodes[whichalbum].firstChild;
var listBoxData = createResourceList (mainNode.childNodes,pc,pr,ptx,pty,ptw,ptl);
////////////////////////////////////
// Number of Album
albumtextbox.text = "Album "+whichalbum+">>>";
albumtextbox.background = true;
albumtextbox.backgroundColor = 0xF0CC64;
for (t=1;t<=albumCount;t++)
{

category.text = "A L B U M Y";
//category.background = true;
category.backgroundColor = 0xF0CC64;
////////////////////////////////////
//Creating text box

this.createEmptyMovieClip("albumnames"+t,900+t);
albumname_mc = this["albumnames"+t];
albumname_mc.createTextField("albumnametxt"+t,1000+t,0,0,200,200);
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = albumnamescolor;
my_fmt.font = "Tahoma"
my_fmt.size = 11;
albumname_mc["albumnametxt"+t].text = this.imageList_xml.firstChild.childNodes[t].attributes.albumname;
albumname_mc["albumnametxt"+t].setTextFormat(my_fmt);
albumname_mc._x = albumnamesx;
albumname_mc._y = albumnamesy + t * 15;
albumname_mc.sett = t;
albumname_mc.onRelease = function()
{
currentpage = 1;
filename.text = "";
for (var rr = 0; rr < noofrow * noofcolumn; rr++)
{
rr = rr + pageindex;
this["thumbframe"+rr].removeMovieClip();
this["thumbframein_mc"+rr].removeMovieClip();
rr = rr - pageindex;
}
imageListLoaded(this.sett)
_global.whichalbum = this.sett;
}
}


}


function createResourceList(resource_array,noofcolumn,noofrow,thumbxs,thumbys,thumbwidth,thumblength,bigimagewidth) {
_global.noofcolumn = noofcolumn;
_global.noofrow = noofrow;
var listData = new DataProviderClass ();
resourceCount = resource_array.length;
noofpage = Math.ceil(resourceCount/(noofcolumn*noofrow));
ofof.text = "strana: "+currentpage+"/"+noofpage;
ofof.background = true;
ofof.backgroundColor = 0xF0CC64;
var resource, image, tmb;
images = new Array();
infotexts = new Array();

pageindex =((currentpage-1) * noofrow * noofcolumn);

for (var r = 0; r < noofrow; r++)
{

for (var c = 0; c < noofcolumn; c++) {
i = (r * noofcolumn) + c + pageindex;

if(i<resourceCount)
{
nodigits = new String(resourceCount);
resource = resource_array[i];
images[i] = resource.attributes.imagename;
infotexts[i] = resource.attributes.infotext;
loadme = "flashimg/thmb/"+images[i];
findme = images[i];
whichframe = "frame"+i;
this.attachMovie("thumbframe","thumbframe"+i,i+1);
this["thumbframe"+i]._x = (c * thumbwidth)+thumbxs;
this["thumbframe"+i]._y = (r * thumblength)+thumbys;
createEmptyMovieClip("thumbframein_mc"+i,(i+1)*1000);
onEnterFrame = function()
{
for (var tr = 0; tr < noofrow; tr++)
{

for (var tc = 0; tc < noofcolumn; tc++) {
ti = (tr * noofcolumn) + tc + pageindex;

if(ti<resourceCount)
{
tw = this["thumbframein_mc"+ti]._width;
th = this["thumbframein_mc"+ti]._height;
this["thumbframein_mc"+ti]._x = this["thumbframe"+ti]._x+(thumbwidth - tw)/2;
this["thumbframein_mc"+ti]._y = this["thumbframe"+ti]._y+(thumblength - th)/2;

}
}
}
}
this["thumbframein_mc"+i].loadMovie(loadme);
noofthumbs = (currentpage-1) * noofcolumn * noofrow;
nom = noofthumbs;
callbig(nom);
this.filename.text = " "+images[nom];
this["thumbframe"+i].onPress = function()
{
startsubstring = 10;
endsubstring = startsubstring + nodigits.length;
largeindex=this._name.substring(startsubstring,endsubstring);
callbig(largeindex);
}
}
}
}
}

function callbig(index)
{
filename.text = " "+images[index];
info.text = infotexts[index];
imageframe_mc.createEmptyMovieClip("hold",0);
imageframe_mc.pictoral._width = _global.bigframew + 3;
imageframe_mc.pictoral._height = _global.bigframeh;


my_mcl.loadClip("flashimg/img/"+images[index],this.imageframe_mc.hold);
imageframe_mc.onPress = function()
{getURL("flashimg/pics/"+images[index],"_blank");}

}



imageList_xml = new XML ();
imageList_xml.ignoreWhite = true;
imageList_xml.onLoad = function (success) {
if (success) {
imageListLoaded(whichalbum);
}
};

//////////////////////////////////////////
//HERE IS WHERE YOU DECLARE YOUR XML FILE
imageList_xml.load ("albums.xml");
//////////////////////////////////////////

rightbt.onRelease=function()
{
if(currentpage != noofpage)
{
currentpage ++;
imageListLoaded(_global.whichalbum);
}
}

leftbt.onRelease=function()
{
if(currentpage > 1)
{
currentpage --;
imageListLoaded(_global.whichalbum);
}
}
stop();
thanks and have a great weekend

Trouble With My Photo Gallery
Greetings!

I've been working with the photo gallery tutorial created by sbeener

I am trying to write code that will not only load externally stored jpgs (as the tutorial currently does), but will also simultaneously load swf files containing text descriptions into another movie clip. However, I'm having some trouble.

After I've added the additional code to load the swf files from a new array, when I test the movie, the jpgs cease loading when the swf files load.

I think I've located the source of my problems, I have two conflicting onEnterFrame commands, the latter of which I have illustrated in my code.

If anyone could take a look at my .fla file and give me some pointers on where I can go with this, I'd be indebted to you.

Thumbnail Gallery Trouble
I created a gallery using the tutorial located here:

Thumbnail Tutorial

Here is the gallery I created:
jacqueline kimberly collection

I modified it by adding the ability to call separate XML files based on a selection made at the bottom to show just earings or just necklaces from the collection. Everything works fine except, I need to find a way to clear the thumbnails each time the new xml is loaded.

For example, if a collection has 10 images, and I open another collection with 2 images, the two images load over the top of the old 10, but the remaining 8 thumbnails from the previous XML load remain. Is there a way to clear the old instance of the tscroller? Any Ideas?

Trouble XML Photo Gallery
I've got xml photo gallery which you can see at www.suziklinik.cz under the "Galerie".
Everything works pretty fine until I update the xml code with more then 5 albums. When I do that....for ex. I choose "album 2 or 3" and then I choose thumb/picture 1st or 2nd it always jumps to last album...why?
here is the flash code


Code:
this._lockroot = true;


//////////////////////////////////////////////////////////////
// SETTING VARIABLES
currentpage = 1;
_global.whichalbum = 1;



//////////////////////////////////
function scalerf(w,h)
{
diffw = (w-bigframew);
diffh = (h-bigframeh);

if(diffw<=0&&diffh<=0)
{
scaler = 1 * 100;
}
else if (diffw==Math.max(diffw,diffh)) //scale to height
{
scaler = (bigframew/w) * 100;
}
else if (diffh==Math.max(diffw,diffh)) //scale to width
{
scaler = (bigframeh/h) * 100;
}
return scaler;
}

//LOADCLIP ACTIVITIES
_root.createEmptyMovieClip("looploop",-1000);
var my_mcl = new MovieClipLoader();
myListener = new Object();
myListener.onLoadStart = function (target_mc)
{
var loadProgress = my_mcl.getProgress(target_mc);
}
myListener.onLoadProgress = function (target_mc, loadedBytes, totalBytes)
{
////////////////////////////////////////////////////////
// FOR PRELOADER PURPOSES
loaded = loadedBytes;
total = totalBytes;
percentage = Math.round(100*(loaded/total));
progressbar_mc.progresser_mc._xscale = percentage;
////////////////////////////////////////////////////////
}
myListener.onLoadComplete = function (target_mc)
{
var loadProgress = my_mcl.getProgress(target_mc);
imageframe_mc.hold._alpha=0;
velo = 0;
imageframe_mc.hold.onEnterFrame = function()
{
w = imageframe_mc.hold._width;
h = imageframe_mc.hold._height;
if(w!=0&&h!=0)
{
scaler = scalerf(w,h);
if(scaler!=100)
{
imageframe_mc.hold._xscale = scaler;
imageframe_mc.hold._yscale = scaler;
}
imageframe_mc.hold._x = (bigframew - (w*(scaler/100)))/2;
imageframe_mc.hold._y = -1+(bigframeh - (h*(scaler/100)))/2;


if(imageframe_mc.hold._alpha<100)
{
accel = 0.3;
velo = velo + accel;
imageframe_mc.hold._alpha +=velo;

}

}
}
}


myListener.onLoadInit = function (target_mc)
{
//target_mc._width = 100;
//target_mc._width = 100;
}
myListener.onLoadError = function (target_mc, errorCode)
{
}
my_mcl.addListener(myListener);


///////////////////////////////////////////////////////////////
// XML PARSING
function imageListLoaded(whichalbum) {
//clear stage
for (var rr = 0; rr < noofrow * noofcolumn; rr++)
{
rr = rr + pageindex;
this["thumbframe"+rr].removeMovieClip();
this["thumbframein_mc"+rr].removeMovieClip();
rr = rr - pageindex;
}


//parameters
param = this.imageList_xml.firstChild.firstChild;
pc = int(param.attributes.noofcolumn);
pr = int(param.attributes.noofrow);
ptx = int(param.attributes.thumbxs);
pty = int(param.attributes.thumbys);
_global.ptw = int(param.attributes.thumbwidth);
_global.ptl = int(param.attributes.thumbheight);
_global.bigframew = int(param.attributes.bigframewidth);
_global.bigframeh = int(param.attributes.bigframeheight);
albumnamesx = int(param.attributes.albumnamesxs);
albumnamesy = int(param.attributes.albumnamesys);
albumnamescolor = param.attributes.albumnamescolor;
//////////////////////////////////////////////////////////////

var albumCountXML = this.imageList_xml.firstChild.childNodes;
albumCount = albumCountXML.length - 1;

var mainNode = this.imageList_xml.firstChild.childNodes[whichalbum].firstChild;
var listBoxData = createResourceList (mainNode.childNodes,pc,pr,ptx,pty,ptw,ptl);
//////////////////////////////////////////////////////////////////
// Number of Album
albumtextbox.text = "Album "+whichalbum+">>>";
albumtextbox.background = true;
albumtextbox.backgroundColor = 0xF0CC64;
for (t=1;t<=albumCount;t++)
{

category.text = "A L B U M Y";
//category.background = true;
category.backgroundColor = 0xF0CC64;
/////////////////////////////////////////////////////////////
//Creating text box

this.createEmptyMovieClip("albumnames"+t,900+t);
albumname_mc = this["albumnames"+t];
albumname_mc.createTextField("albumnametxt"+t,1000+t,0,0,200,200);
var my_fmt:TextFormat = new TextFormat();
my_fmt.color = albumnamescolor;
my_fmt.font = "Tahoma"
my_fmt.size = 11;
albumname_mc["albumnametxt"+t].text = this.imageList_xml.firstChild.childNodes[t].attributes.albumname;
albumname_mc["albumnametxt"+t].setTextFormat(my_fmt);
albumname_mc._x = albumnamesx;
albumname_mc._y = albumnamesy + t * 15;
albumname_mc.sett = t;
albumname_mc.onRelease = function()
{
currentpage = 1;
filename.text = "";
for (var rr = 0; rr < noofrow * noofcolumn; rr++)
{
rr = rr + pageindex;
this["thumbframe"+rr].removeMovieClip();
this["thumbframein_mc"+rr].removeMovieClip();
rr = rr - pageindex;
}
imageListLoaded(this.sett)
_global.whichalbum = this.sett;
}
}


}


function createResourceList(resource_array,noofcolumn,noofrow,thumbxs,thumbys,thumbwidth,thumblength,bigimagewidth) {
_global.noofcolumn = noofcolumn;
_global.noofrow = noofrow;
var listData = new DataProviderClass ();
resourceCount = resource_array.length;
noofpage = Math.ceil(resourceCount/(noofcolumn*noofrow));
ofof.text = "strana: "+currentpage+"/"+noofpage;
ofof.background = true;
ofof.backgroundColor = 0xF0CC64;
var resource, image, tmb;
images = new Array();
infotexts = new Array();

pageindex =((currentpage-1) * noofrow * noofcolumn);

for (var r = 0; r < noofrow; r++)
{

for (var c = 0; c < noofcolumn; c++) {
i = (r * noofcolumn) + c + pageindex;

if(i<resourceCount)
{
nodigits = new String(resourceCount);
resource = resource_array[i];
images[i] = resource.attributes.imagename;
infotexts[i] = resource.attributes.infotext;
loadme = "flashimg/thmb/"+images[i];
findme = images[i];
whichframe = "frame"+i;
this.attachMovie("thumbframe","thumbframe"+i,i+1);
this["thumbframe"+i]._x = (c * thumbwidth)+thumbxs;
this["thumbframe"+i]._y = (r * thumblength)+thumbys;
createEmptyMovieClip("thumbframein_mc"+i,(i+1)*1000);
onEnterFrame = function()
{
for (var tr = 0; tr < noofrow; tr++)
{

for (var tc = 0; tc < noofcolumn; tc++) {
ti = (tr * noofcolumn) + tc + pageindex;

if(ti<resourceCount)
{
tw = this["thumbframein_mc"+ti]._width;
th = this["thumbframein_mc"+ti]._height;
this["thumbframein_mc"+ti]._x = this["thumbframe"+ti]._x+(thumbwidth - tw)/2;
this["thumbframein_mc"+ti]._y = this["thumbframe"+ti]._y+(thumblength - th)/2;

}
}
}
}
this["thumbframein_mc"+i].loadMovie(loadme);
noofthumbs = (currentpage-1) * noofcolumn * noofrow;
nom = noofthumbs;
callbig(nom);
this.filename.text = " "+images[nom];
this["thumbframe"+i].onPress = function()
{
startsubstring = 10;
endsubstring = startsubstring + nodigits.length;
largeindex=this._name.substring(startsubstring,endsubstring);
callbig(largeindex);
}
}
}
}
}

function callbig(index)
{
filename.text = " "+images[index];
info.text = infotexts[index];
imageframe_mc.createEmptyMovieClip("hold",0);
imageframe_mc.pictoral._width = _global.bigframew + 3;
imageframe_mc.pictoral._height = _global.bigframeh;


my_mcl.loadClip("flashimg/img/"+images[index],this.imageframe_mc.hold);
imageframe_mc.onPress = function()
{getURL("flashimg/pics/"+images[index],"_blank");}

}



imageList_xml = new XML ();
imageList_xml.ignoreWhite = true;
imageList_xml.onLoad = function (success) {
if (success) {
imageListLoaded(whichalbum);
}
};

//////////////////////////////////////////
//HERE IS WHERE YOU DECLARE YOUR XML FILE
imageList_xml.load ("albums.xml");
//////////////////////////////////////////

rightbt.onRelease=function()
{
if(currentpage != noofpage)
{
currentpage ++;
imageListLoaded(_global.whichalbum);
}
}

leftbt.onRelease=function()
{
if(currentpage > 1)
{
currentpage --;
imageListLoaded(_global.whichalbum);
}
}
stop();
and for any case here is xml code

Code:
<!--
bigframeheight: the top big frame's height
bigframewidth: the top big frame's width
noofcolumn: number of columns for the thumbnails
noofrow: number of row for the thumbnails
thumbxs: x coordinate of thumbnails matrix(topleft)
thumbys: y coordinate of thumbnails matrix(topleft)
thumbwidth: a single thumbnail holder's width
thumbwidth: a single thumbnail holder's height
albumnamesxs: x coordinate of albumnames' list
albumnamesys: y coordinate of albumnames' list
albumnamescolor: Color code for albumnames' texts
-->

<photoalbum>
<parameters bigframeheight = "264" bigframewidth = "451" noofcolumn="8" noofrow="1" thumbxs="10" thumbys="275" thumbwidth="74" thumbheight="73" albumnamesxs="0" albumnamesys="0" albumnamescolor="0xF0CC64"/>
<album albumname="1 ~ Jeep">
<images>
<image imagename="jeep0001.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0002.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0003.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0004.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0005.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0006.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0007.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0008.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0009.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0010.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0011.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0012.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0013.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0014.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0015.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0016.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0017.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0018.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0019.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0020.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0021.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0022.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0023.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0024.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0025.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0026.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0027.jpg" infotext="Jeep Restaurování"/>
<image imagename="jeep0028.jpg" infotext="Jeep Restaurování"/>
</images>
</album>
<album albumname="2 ~ Motor 1.3 ">
<images>
<image imagename="engine0001.jpg" infotext="Suzuki Samurai 1.3 Restaurování"/>
<image imagename="engine0002.jpg" infotext="Suzuki Samurai 1.3 Restaurování"/>
<image imagename="engine0003.jpg" infotext="Suzuki Samurai 1.3 Restaurování"/>
<image imagename="engine0004.jpg" infotext="Suzuki Samurai 1.3 Restaurování"/>
<image imagename="engine0005.jpg" infotext="Suzuki Samurai 1.3 Restaurování"/>
<image imagename="engine0006.jpg" infotext="Suzuki Samurai 1.3 Restaurování"/>
<image imagename="engine0007.jpg" infotext="Suzuki Samurai 1.3 Restaurování"/>
<image imagename="engine0008.jpg" infotext="Suzuki Samurai 1.3 Restaurování"/>
<image imagename="engine0009.jpg" infotext="Suzuki Samurai 1.3 Restaurování"/>

</images>
</album>
<album albumname="3 ~ V Akci">
<images>
<image imagename="action0001.jpg" infotext="V Akci" />
<image imagename="action0002.jpg" infotext="V Akci" />
<image imagename="action0003.jpg" infotext="V Akci" />
<image imagename="action0004.jpg" infotext="V Akci" />
<image imagename="action0005.jpg" infotext="V Akci" />
<image imagename="action0006.jpg" infotext="V Akci" />
<image imagename="action0007.jpg" infotext="V Akci" />
<image imagename="action0008.jpg" infotext="V Akci" />
</images>
</album>
<album albumname="4 ~ Ford Transit">
<images>
<image imagename="transit0001.jpg" infotext="" />
<image imagename="transit0002.jpg" infotext="" />
<image imagename="transit0003.jpg" infotext="" />
<image imagename="transit0004.jpg" infotext="" />
<image imagename="transit0005.jpg" infotext="" />
</images>
</album>
<album albumname="5 ~ Transit po Požáru">
<images>
<image imagename="fire0001.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0002.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0003.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0004.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0005.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0006.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0007.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0008.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0009.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0010.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0011.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0012.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0013.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0014.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0015.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0016.jpg" infotext="Ford Transit po Požáru" />
<image imagename="fire0017.jpg" infotext="Ford Transit po Požáru" />
</images>
</album>
<album albumname="6 ~ Projekt Tatarak">
<images>
<image imagename="tatarak0001.jpg" infotext="" />
<image imagename="tatarak0002.jpg" infotext="" />
<image imagename="tatarak0003.jpg" infotext="" />
<image imagename="tatarak0004.jpg" infotext="" />
<image imagename="tatarak0005.jpg" infotext="" />
<image imagename="tatarak0006.jpg" infotext="" />
<image imagename="tatarak0007.jpg" infotext="" />
<image imagename="tatarak0008.jpg" infotext="" />
<image imagename="tatarak0009.jpg" infotext="" />
<image imagename="tatarak0010.jpg" infotext="" />
<image imagename="tatarak0011.jpg" infotext="" />
<image imagename="tatarak0012.jpg" infotext="" />
<image imagename="tatarak0013.jpg" infotext="" />
<image imagename="tatarak0014.jpg" infotext="" />
<image imagename="tatarak0015.jpg" infotext="" />
<image imagename="tatarak0016.jpg" infotext="" />
<image imagename="tatarak0017.jpg" infotext="" />
<image imagename="tatarak0018.jpg" infotext="" />
<image imagename="tatarak0019.jpg" infotext="" />
<image imagename="tatarak0020.jpg" infotext="" />
<image imagename="tatarak0021.jpg" infotext="" />
<image imagename="tatarak0022.jpg" infotext="" />
<image imagename="tatarak0023.jpg" infotext="" />
<image imagename="tatarak0024.jpg" infotext="" />
<image imagename="tatarak0025.jpg" infotext="" />
<image imagename="tatarak0026.jpg" infotext="" />
<image imagename="tatarak0027.jpg" infotext="" />
<image imagename="tatarak0028.jpg" infotext="" />
<image imagename="tatarak0029.jpg" infotext="" />
<image imagename="tatarak0030.jpg" infotext="" />
<image imagename="tatarak0031.jpg" infotext="" />
<image imagename="tatarak0032.jpg" infotext="" />
<image imagename="tatarak0033.jpg" infotext="" />
<image imagename="tatarak0034.jpg" infotext="" />
<image imagename="tatarak0035.jpg" infotext="" />
<image imagename="tatarak0036.jpg" infotext="" />
<image imagename="tatarak0037.jpg" infotext="" />
<image imagename="tatarak0038.jpg" infotext="" />
<image imagename="tatarak0039.jpg" infotext="" />
<image imagename="tatarak0040.jpg" infotext="" />
<image imagename="tatarak0041.jpg" infotext="" />
<image imagename="tatarak0042.jpg" infotext="" />
<image imagename="tatarak0043.jpg" infotext="" />
<image imagename="tatarak0044.jpg" infotext="" />
<image imagename="tatarak0045.jpg" infotext="" />
<image imagename="tatarak0046.jpg" infotext="" />
<image imagename="tatarak0047.jpg" infotext="" />
<image imagename="tatarak0048.jpg" infotext="" />
<image imagename="tatarak0049.jpg" infotext="" />
<image imagename="tatarak0050.jpg" infotext="" />
<image imagename="tatarak0051.jpg" infotext="" />
<image imagename="tatarak0052.jpg" infotext="" />
<image imagename="tatarak0053.jpg" infotext="" />
<image imagename="tatarak0054.jpg" infotext="" />
<image imagename="tatarak0055.jpg" infotext="" />
<image imagename="tatarak0056.jpg" infotext="" />
<image imagename="tatarak0057.jpg" infotext="" />
<image imagename="tatarak0058.jpg" infotext="" />
<image imagename="tatarak0059.jpg" infotext="" />
<image imagename="tatarak0060.jpg" infotext="" />
<image imagename="tatarak0061.jpg" infotext="" />
<image imagename="tatarak0062.jpg" infotext="" />
<image imagename="tatarak0063.jpg" infotext="" />
<image imagename="tatarak0064.jpg" infotext="" />
<image imagename="tatarak0065.jpg" infotext="" />
<image imagename="tatarak0066.jpg" infotext="" />
<image imagename="tatarak0067.jpg" infotext="" />
<image imagename="tatarak0068.jpg" infotext="" />
<image imagename="tatarak0069.jpg" infotext="" />
<image imagename="tatarak0070.jpg" infotext="" />
</images>
</album>
<!--<album albumname="7 ~ Náš TUNING">
<images>
<image imagename="tuning0001.jpg" infotext="" />
<image imagename="tuning0002.jpg" infotext="" />
<image imagename="tuning0003.jpg" infotext="" />
<image imagename="tuning0004.jpg" infotext="" />
<image imagename="tuning0005.jpg" infotext="" />
<image imagename="tuning0006.jpg" infotext="" />
<image imagename="tuning0007.jpg" infotext="" />
<image imagename="tuning0008.jpg" infotext="" />
<image imagename="tuning0009.jpg" infotext="" />
<image imagename="tuning0010.jpg" infotext="" />
<image imagename="tuning0011.jpg" infotext="" />
<image imagename="tuning0012.jpg" infotext="" />
<image imagename="tuning0013.jpg" infotext="" />
<image imagename="tuning0014.jpg" infotext="" />
<image imagename="tuning0015.jpg" infotext="" />
</images>
</album>-->
<!--<album albumname="8 ~ Sady">
<images>
<image imagename="sady0001.jpg" infotext="" />
<image imagename="sady0002.jpg" infotext="" />
<image imagename="sady0003.jpg" infotext="" />
<image imagename="sady0004.jpg" infotext="" />
</images>
</album>-->
</photoalbum>
thanks guys

XML Gallery Thumbnail Trouble
Hi all, I've just worked through the XML gallery with thumbnails tutorial and something bizarre is happening to my thumbnails. They scroll fine form left to right but when they first load in the load into the centre of the field. Why would this be happening? I've not altered the code in any way.
I've put up an example to show you what I mean here: http:www.bencatchpole.co.uk/michele/

Ta

Xml Image Gallery Trouble
I'm trying to create an xml image gallery at the moment. I've made it so it works but I'm now cleaning the code and I want to separate the navigation into a class of its own. Here is the Gallery class...


ActionScript Code:
package _classes{    import flash.display.Sprite;    import flash.display.Stage;    import flash.display.StageAlign;    import flash.display.StageScaleMode;    import flash.net.URLLoader;    import flash.net.URLRequest;    import flash.events.Event;    import _classes.media.displays.ImageDisplay;    import _classes.media.controllers.ImageController;    public class Gallery extends Sprite {        private var _xmlLoader:URLLoader = new URLLoader();        private var _xmlData:XML;        public var pImageList:XMLList;        public function Gallery() {            initStage();            loadContent();        }                private function loadContent():void {            _xmlLoader.addEventListener(Event.COMPLETE, onContentLoaded);            _xmlLoader.load(new URLRequest("gallery.xml"));        }                private function initStage():void {            stage.frameRate = 61;            stage.scaleMode = StageScaleMode.NO_SCALE;            stage.align = StageAlign.TOP_LEFT;        }                private function onContentLoaded(event:Event):void {            _xmlData = _xmlData = new XML(event.target.data);            pImageList = _xmlData.image.imagePath;            initController();        }                private function initController():void {            var imageController:ImageController = new ImageController(pImageList);            addChild(imageController);        }    }}


ImageController class


ActionScript Code:
package _classes.media.controllers{    import flash.display.Sprite;    import flash.events.MouseEvent;    import _classes.media.displays.ImageDisplay;    public class ImageController extends Sprite {        private var _imageCurrPos:Number = 1;        public function ImageController(pImageList:XMLList) {                        var navBack:NavBack = new NavBack();            addChild(navBack);            navBack.x = 0;            navBack.y = 373;            var prevButton:PrevButton = new PrevButton();            addChild(prevButton);            prevButton.x = 0;            prevButton.y = 373;            prevButton.addEventListener(MouseEvent.MOUSE_DOWN, previousClick);            var nextButton:NextButton = new NextButton();            addChild(nextButton);            nextButton.x = stage.stageWidth - nextButton.width;            nextButton.y = 373;            nextButton.addEventListener(MouseEvent.MOUSE_DOWN, nextClick);            var navContainer:Sprite = new Sprite();            addChild(navContainer);            navContainer.y = 374;            for (var i:uint = 1; i <pImageList.length() + 1; i++) {                var imageElement:XML = pImageList[i];                var button:ImageButton = new ImageButton();                navContainer.addChild(button);                button.addEventListener(MouseEvent.MOUSE_DOWN, onMouseClick);                button.x = i * 18;                button.useHandCursor = true;                button.buttonText.text = String(i);            }            navContainer.x = stage.stageWidth - (navContainer.width + prevButton.width + 20);            function onMouseClick(event:MouseEvent):void {                var image:ImageDisplay = new ImageDisplay(pImageList[(event.target.text) - 1]);                addChild(image);                _imageCurrPos = Number(event.target.text);                trace(_imageCurrPos);            }            function previousClick(event:MouseEvent):void {                var image:ImageDisplay = new ImageDisplay(pImageList[_imageCurrPos - 1]);                addChild(image);                _imageCurrPos = _imageCurrPos - 1;                trace(_imageCurrPos);            }            function nextClick(event:MouseEvent):void {                var image:ImageDisplay = new ImageDisplay(pImageList[_imageCurrPos + 1]);                addChild(image);                _imageCurrPos = _imageCurrPos + 1;                trace(_imageCurrPos);            }        }    }}


I'm trying to pass a public XMLList variable from the gallery to the controller and I get this error...


Code:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at _classes.media.controllers::ImageController$iinit()
at _classes::Gallery/::initController()
at _classes::Gallery/::onContentLoaded()
at flash.events::EventDispatcher/flash.events:EventDispatcher::dispatchEventFunction()
at flash.events::EventDispatcher/dispatchEvent()
at flash.net::URLLoader/flash.net:URLLoader::onComplete()
Any help would be greatly appreciated...

David

Flash Gallery With XML Trouble
I am making a site with a scrolling photo gallery. The site is located at
www.finstofurstaxidermy.com/taxidermy.html
I have a scrolling thumbnail gallery that is perfect for me. I am happy with it with one exception. I used the loadmovie function to make it and for some reason it takes a long time on slower internet for the movie to initially load. What i would like to do is have the movie open up fairly fast and the individual pictures can load once they are clicked. I want to use xml however i don't know how to do it. I would like to keep the same setup on my photo page but i want to use xml because i think it would be better on loading. I am interested in this type of gallery.

www.finstofurstaxidermy.com/fashmo.swf

I found this online and put it on my server. I love this gallery I just want these effects and xml layout in my gallery. I dont even have to have the cool fade effects i just need the site to load faster and the pictures to load individually. Please i need some help anyone.

Photo Gallery Trouble
i'm a newbie in AS but i'm willing to learn and i've started to make my own flash site...made some simple motion tween, some buttons and then i wanted to make a simple photo gallery but using a transition effect by using action script cause this way i could make the transition backwards unlike using a motion tween that can only make the transition forward...
so googling i found this:
http://tutorialoutpost.com/view/4717...photo-gallery/
i saw that tutorial to work pretty well so i made a movie clip inside another movie clip inside my flash site and i repeated the tutorial above only this time on a movie clip and not on the main scene... and it just wont work...
the only thing i see is the blue shape that is under the mask and where the photos should appear...
any idea what i did wrong here??

[CS3] Sliding Image Gallery Trouble
Hi,

I'm trying to create an sliding image gallery with ease like this: http://www.webdesign.org/web/flash-&...ing.12433.html but I would like to have only two arrow buttons back and forward but still remain the same kind of sliding with ease- function that the example has. Could someone give me a hand on how modify the code to get it work with only those two buttons?

Cheers,
Satu

Thumbnail Trouble, Image Gallery, Xml.
Hi, I'm making an image gallery and are having some issues with the thumbnails.

What I want is to be able to have thumbnails with the same height but different width.



Attached the fla.

Trouble With Preloading For Flash Gallery
Go to this link to see what I mean:

http://www.philleith.com/BJ.html

The images are loading but the preloader is saying "100%" with a full bar as if they are taking no time to load. If you look at the third photo, it it takes a little while to load and the preloader says the same thing -- so I know there is a problem. What it SHOULD do is have an increasing status bar and percentage as it loads in.

This works fine when I run it in flash when I Simulate Download, but for some reason when I put it up online, it gets weird.

If anyone knows what may be causing this, please enlighten me I would much appreciate it

Having Trouble With Flash Gallery When Repositioning
the gallery I downloaded from http://www.kirupa.com/developer/mx20...togallery9.htm
has a problem that I cannot solve
when I increase the carvas size to 1000 by 700, and I move the whole gallery to right at the center of the carvas, and then I test movie, it ceased working, when I undo the last step, it fix itself, I just don't understand, I read through the code, nothing is really concerning the carvas size, but it's just so weird, help!!

Trouble With The Photo Gallery Using XML And Flash
The tutorial was great, I renamed the mc to mygallery. When I test mygallery locally everything works fine. However, I am loading it externally into my main mc. When I do this I encounter the following problem.

the mc appears to load however the first image will no load, if I click next, the second will load and then I can click previous and the first will then load.

I have traced it to the firstImage() function and it won't get past this line
if (loaded == filesize)

loaded is TRUE
filesize is UNDEFINED
picture is UNDEFINED

I've tried my best to figure it out but I was hoping someone had the answer.

Cheers!
Dan

Gallery + XML Trouble With Opera And Firefox
Please, someone could help me?

When I access my page that cointains the XML Gallery (tutorial by kirupa) with Opera and Firefox, nothing works! It only works in Internet Explorer. Well, it's not working when the site is online, because here, at my computer, offline, everything works!

The address is: http://www.portalcachoeirademinas.co...ver/amelia.htm

The files used there are here: http://rapidshare.de/files/20235606/Gallery.zip.html

I don't know why Opera and Firefox doesn't load the pictures when the site is in the server.

Pls, help me!!!

And I don't speak English, Google helps me a lot, but I know that it's not perfect... Sorry...

Copyright © 2005-08 www.BigResource.com, All rights reserved