Hey everyone! I, like many others, have used kirupa’s photo gallery tutorial to help me with my portfolio. I’ve done a slideshow for a mini-portfolio once before, for school purposes, using a slightly different script… and it worked out fine (images and text showed up properly, etc)… but for my portfolio website I wanted to be able to add the thumbnail script for better navigation, so I decided to start from scratch using kirupa’s script so that the thumbnails could be added and have a better chance of working properly.
The thing is… even with just the gallery script, my portfolio is only half-working, lol! For reasons beyond me, only the images decide to show up, and none of my dynamic text…! >:0 I’ve tried changing the instance names, changing the xml, applying the old actionscript from my first slideshow (but to no avail! somehow, a script that works fine in one swf doesn’t work at all when I apply it to this one–the images don’t even show at ALL, lol!!)… so I’m kind of at a loss.
Sorry to bring up the photo gallery again, and perhaps a redundant question in this forum…! I’ve tried to look for threads here and in other forums that address this specific problem, but I’ve mostly found that people are having problems when they modify the script to add extras… rather than little ol’ me, who can’t even get the base script to work fully. >_>;;
Anyway, here’s my actionscript:
function loadXML (loaded ){
if (loaded ){
xmlNode =this .firstChild ;
image =[] ;
notes =[] ;
completed =[] ;
caption =[] ;
total =xmlNode .childNodes .length ;
for (i=0;i<total ;i++) {
image *=xmlNode .childNodes *.childNodes [2].firstChild .nodeValue ;
notes *=xmlNode .childNodes *.childNodes [3].firstChild .nodeValue ;
completed*=xmlNode .childNodes *.childNodes [1].firstChild .nodeValue ;
caption*=xmlNode .childNodes *.childNodes [0].firstChild .nodeValue ;
}
firstImage () ;
}else {
content ="file not loaded!" ;
}
}
xmlData =new XML () ;
xmlData .ignoreWhite =true ;
xmlData .onLoad =loadXML ;
xmlData .load ("print.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 ;
if (picture._alpha <100 ){
picture._alpha += 30 ;
}
}
};
function nextImage () {
if (p<( total -1)) {
p = p + 1 ;
if (loaded == filesize ){
picture._alpha =0;
picture.loadMovie (image [p],1);
ptitle_txt.text = caption [p];
pdate_txt.text = completed [p];
pnotes_txt.text = notes [p];
}
}
}
function prevImage () {
if (p>0){
p = p - 1 ;
picture._alpha =0;
picture.loadMovie (image [p],1);
ptitle_txt.text = caption [p];
pdate_txt.text = completed [p];
pnotes_txt.text = notes [p];
}
}
function firstImage () {
if (loaded == filesize ){
picture ._alpha =0;
picture .loadMovie (image [0],1);
ptitle_txt.text = caption [p];
pdate_txt.text = completed [p];
pnotes_txt.text = notes [p];
}
}
function picture_num () {
current_pos = p + 1;
ppos_txt.text = current_pos +" of " +total ;
}
And here’s my xml, which I think has no errors… but I could be wrong:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<print>
<pic>
<caption>Eclectic Typography Spreads</caption>
<completed>Completed in April, 2006.</completed>
<image>images/print-3-03.jpg</image>
<notes>First page of one of 3 magazine spreads designed to be in a fictional magazine, for YSDN's Editorial Design course. Currently in progress.</notes>
<thumb>images/print-3-03_th.jpg</thumb>
</pic>
<pic>
<caption>Nip-Hop Park 2006</caption>
<completed>Completed in March, 2006.</completed>
<image>images/print-2006-01.jpg</image>
<notes>This is the first version of a promotional poster that I completed for the premiere Hip-Hop dance party event at Toronto's Annual Anime North convention.</notes>
<thumb>images/print-2006-01_th.jpg</thumb>
</pic>
<pic>
<caption>Engrish Unicase Promo Poster</caption>
<completed>Completed in November, 2005.</completed>
<image>images/print-3-02.jpg</image>
<notes>A promotional poster for the Unicase Typeface that I designed for the Typography 4 course in the YSDN program. Actual size is 24" x 30", and the theme of the poster is Japanese-inspired.</notes>
<thumb>images/print-3-02_th.jpg</thumb>
</pic>
<pic>
<caption>Series of Four Postage Stamps</caption>
<completed>Completed in October, 2005.</completed>
<image>images/print-3-01.jpg</image>
<notes>Communication Design 2 project, done with the idea that the series of stamps would be proposed to Canada Post. Stamp illustrations created by myself in Procreate Painter Classic program.</notes>
<thumb>images/print-3-01_th.jpg</thumb>
</pic>
<pic>
<caption>Dadaist Manifesto</caption>
<completed>Completed in April, 2005.</completed>
<image>images/print-2-05.jpg</image>
<notes>The Dadaist Manifesto, laid out to use an accordion fold, for Typography 3 in the YSDN Program.</notes>
<thumb>images/print-2-05_th.jpg</thumb>
</pic>
<pic>
<caption>Futurist Manifesto</caption>
<completed>Completed in April, 2005.</completed>
<image>images/print-2-04.jpg</image>
<notes>Composition of the Futurist Manifesto, for Typography 3 in the YSDN Program.</notes>
<thumb>images/print-2-04_th.jpg</thumb>
</pic>
<pic>
<caption>Futura Book</caption>
<completed>Completed in January/February, 2005.</completed>
<image>images/print-2-03.jpg</image>
<notes>A booklet created for the Typography 3 course in the YSDN Program, overviewing the Futura Book typeface. Used one spot colour used for the front cover and the two-page spread.</notes>
<thumb>images/print-2-03_th.jpg</thumb>
</pic>
<pic>
<caption>Your Health Down The Toilet</caption>
<completed>Completed in October, 2004.</completed>
<image>images/print-2-02.jpg</image>
<notes>Composition to promote awareness for eating disorders. Took place in Communication Design 1 in the YSDN Program.</notes>
<thumb>images/print-2-02_th.jpg</thumb>
</pic>
<pic>
<caption>Paul Renner Booklet</caption>
<completed>Completed in October, 2003.</completed>
<image>images/print-2-01.jpg</image>
<notes>Black and white information booklet on Type Designer Paul Renner, for Typography 2 course in the YSDN Program.</notes>
<thumb>images/print-2-01_th.jpg</thumb>
</pic>
</print>
(note: this xml has a node for the thumbnails, which I haven’t tried to introduce yet).
A few other things I tried to change in order to make my dynamic text show up is the font, since I read in another forum that Verdana doesn’t always show up… but that also made no difference. I assume that something must be right, since the images show up… and I also used a trace on the script, and the proper text showed up in the output window, so think everything should be pointing to the correct nodes too… but please let me know if you see any mistakes that I can’t! T_T;; so frustrated
Thanks in advance! (And sorry for the loooonnnggg post…!)