<?xml version="1.0" encoding="iso-8859-1"?><rss version="2.0">
<channel><title><![CDATA[ActionScript.org Flash, Flex and ActionScript Resources - Comments for article: Photo Album]]></title><link>http://www.actionscript.org/resources</link><description /><language>en-us</language><copyright><![CDATA[http://www.actionscript.org/resources]]></copyright><generator>N/A</generator><webMaster>general.redirect@gmail.com</webMaster><lastBuildDate>Mon, 23 Nov 2009 11:36:20 CST</lastBuildDate><ttl>20</ttl><item><title><![CDATA[Comment #1]]></title><link>http://www.actionscript.org/resources/articles/131/1/Photo-Album/Page1.html#Comment13362</link><description><![CDATA[This is an excellent tutorial but I am having trouble getting it to work! I will post my code below, the only thing I have edited is the specifics for my images rather than yours, i.e. count, position, captions. I just cant figure out where I have gone wrong. Thanks for the help!
//CODE

var numOfPix:Number = 10;
//declaring the positions array
//The positions starts from 0 (the first image position and we add the width of each image on the right)
var pos:Array = [0, 372, 782, 1251, 1624.1, 1905.7, 2255.9, 2723.8, 3095.9, 3468.2];
//declare the informations that will be displayed in the text field, just a dummy text for the sake of ease
var theInfo:Array = ["Mock Dell Page", "Abstract 1", "Jimi Hendrix Site", "Mock Motorola Page", "Abstract 2", "RATM Graphic", "Regency Cleaning Bus. Card", "Abstract 3", "Mock Toshiba Page 1", "Abstract 4"];
//Declaring variables to control the buttons
var w:Number = _level0.the1_btn._width;
var h:Number = _level0.the1_btn._height;

//~~~ The text Format ~~~//First we create a new Text Formt that weill hold our text properties which are "align to center", "color is orange","bold", "size to 20" and our desired font that we will create it later
var theFmt:TextFormat = new TextFormat();
theFmt.align = "left";
theFmt.color = 0xFF6600;
theFmt.font = "Eurostile";
theFmt.size = 20;
theFmt.bold = true;

//creatin a text field in each of the buttons (MCs) we have
for (i=1; i<=numOfPix; i++) {
	_level0["the"+i+"_btn"].createTextField("theNum_txt", 1, 0, 0, w, h);
	_level0["the"+i+"_btn"].theNum_txt.text = i;
	_level0["the"+i+"_btn"].theNum_txt.setTextFormat(theFmt);
}

//apply the text format to the Text Field that will have the describtion, and make it not selectable
_level0.info_txt.selectable = false;
_level0.info_txt.setNewTextFormat(theFmt);

for (i=1; i<=pos.length; i++) {
	_level0["the"+i+"_btn"].n = i;
	_level0.info_txt.text = _level0.theInfo[0];
	_level0["the"+i+"_btn"].onRelease = function() {
		_level0.thePix_mc.panorama_mc._x = _level0.pos[this.n-1]*-1;
		_level0.info_txt.text = _level0.theInfo[this.n-1];
	};
}

//CODE<br/><br/>
(Comment posted by Gil at 9:05 pm, Wed 19th Aug 2009)]]></description><author>no@spam.com (Gil)</author><pubDate><![CDATA[Wed, 19 Aug 2009 21:05:50 CDT]]></pubDate><guid isPermaLink="true">http://www.actionscript.org/resources/articles/131/1/Photo-Album/Page1.html#Comment13362</guid></item></channel></rss>