# Flash Gallery/Slideshow

**URL:** <https://forum.kirupa.com/t/flash-gallery-slideshow/236033>\
**Category:** flash\
**Created:** [August 16, 2007, 4:47pm UTC](https://forum.kirupa.com/t/flash-gallery-slideshow/236033 "2007-08-16T16:47:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![switchBack](https://avatars.discourse-cdn.com/v4/letter/s/9dc877/32.png) [@switchBack](https://forum.kirupa.com/u/switchBack)\
**Post date:** [August 16, 2007, 4:47pm UTC](https://forum.kirupa.com/t/flash-gallery-slideshow/236033/1 "2007-08-16T16:47:02Z")

</div>

Hey everyone. I’m having some problems getting this to work exactly the way I want it to.

What I am wanting to do is generate a movieclip with a textField inside. These will each be created in a forLoop so that they will be created in accordance to a number of photos that I am loading. Each number (the movieclip with the textField inside) should then be able to be clicked on to change the currently loaded photo.

Here is what I have so far:

function setFormat(){  
var format = new TextFormat();

format.bold = true;  
format.color = 0x580028;  
format.font = “\_sans”;

pic\_mc.curPic.autoSize = true;  
pic\_mc.curPic.selectable = false;  
pic\_mc.curPic.setTextFormat(format);  
};  
function loadNumbers(){  
var pictures = my\_xml.firstChild.childNodes;

for (var i = 0; i \< pictures.length; i++){  
var currentPicture = pictures\*;

var pic\_mc = \_root.createEmptyMovieClip(“loader\_mc” +i, i);  
pic\_mc.\_x = (i \* spacing) + 40;  
pic\_mc.\_y = playPause.\_y;

pic\_mc.createTextField(“curPic”, +i, 0, 0, 50, 50);  
pic\_mc.curPic.text = i + 1;  
setFormat();

load\_main = currentPicture.attributes.url

pic\_mc.image = load\_main;

loader.loadMovie(currentPicture.attributes.url);

pic\_mc.onRelease = function(){  
loader.loadMovie(this.image);  
};  
};  
};

The problems I am having are:

1. For some reason the setFormat() function isn’t being called.
2. The movieClip with the textField inside has a huge hit area and I don’t understand why that is, and I want it to only be the size of the text field.

Thanks

_Update_ - sorry quick update. When I move:

pic\_mc.curPic.autoSize = true;  
pic\_mc.curPic.selectable = false;

inside the forLoop it fixes the problem I was having with the size of the hit box. I still can’t figure out why the I am unable to call the setFormat() function however.
