# \[flashmx2004\]Thumbnail need to click twice before it open the link

**URL:** <https://forum.kirupa.com/t/flashmx2004-thumbnail-need-to-click-twice-before-it-open-the-link/210293>\
**Category:** Uncategorized\
**Created:** [December 17, 2006, 1:58pm UTC](https://forum.kirupa.com/t/flashmx2004-thumbnail-need-to-click-twice-before-it-open-the-link/210293 "2006-12-17T13:58:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![coolokoy\_me](https://avatars.discourse-cdn.com/v4/letter/c/90ced4/32.png) [@coolokoy\_me](https://forum.kirupa.com/u/coolokoy_me)\
**Post date:** [December 17, 2006, 1:58pm UTC](https://forum.kirupa.com/t/flashmx2004-thumbnail-need-to-click-twice-before-it-open-the-link/210293/1 "2006-12-17T13:58:49Z")

</div>

good day,

im so sorry for the moderators if i am flooding the forum, this is my last hope i think… i repost this here again because no one was able to give hint on the previous thread… (poor me)…

the gallery that i am working for month now is now working… (finally) but the problem is when i click on the image it needs to click twice before it loads the URL on it… i dont know where to fix… i tried to modify the value that substract to pictureValue to 0 or 3… but still the same output…

so much time is wasted…

heres the code…

```auto
var k = 0, total;
function loadThumb() {
 var target_mc = thumbnail_mc.createEmptyMovieClip("t"+k, thumbnail_mc.getNextHighestDepth());
 var temp = this.createEmptyMovieClip("tmp"+k, this.getNextHighestDepth());
 target_mc.loadMovie(thumbnails[k]);
 temp.onEnterFrame = function() {
  if (target_mc._width) {
   if (k) {
    //if it isn't the first thumb, get the y position and heigth of the previous thumb
    target_mc._x = thumbnail_mc["t"+(k-1)]._x+thumbnail_mc["t"+(k-1)]._width+1;
   } else {
    //set the first thumb to y = 0
    target_mc._x = 0;
   }
   target_mc.pictureValue = k;
   target_mc.onRelease = function() {
    p = this.pictureValue-2;
    target_mc.onRelease = function() {
             getURL(link[this.pictureValue],"_parent");
          };
   };
   target_mc.onRollOver = function() {
    this._alpha = 50;
    thumbNailScroller();
    //Hover Caption
    captionFN(true, caption[this.pictureValue], this);     
   };
   target_mc.onRollOut = function() {
    this._alpha = 100;
    captionFN(false);
   };
   nextThumb();
   delete this.onEnterFrame;
  }
 };
}
function nextThumb() {
 k<total-1 ? (k++, loadThumb()) : null;
}

```

my xml looks like this:  
\<?xml version=“1.0” encoding=“utf-8” standalone=“yes”?\>  
\<images\>  
\<pic\>  
\<caption\>Digital Cameras\</caption\>  
\<thumbnail\>[http://www.genius-me.com:8080/GENIUS/GetDoc?UniqueKeyValue=4311&ShowPath=false&Download=false](http://www.genius-me.com:8080/GENIUS/GetDoc?UniqueKeyValue=4311&ShowPath=false&Download=false)\</thumbnail\>  
\<link\>[http://www.genius-me.com:8080/GENIUS/GetRecords?Template=Genius/Sub&Type=Products\_Listing&Level=3&Parent=45](http://www.genius-me.com:8080/GENIUS/GetRecords?Template=Genius/Sub&Type=Products_Listing&Level=3&Parent=45)\</link\>  
\</pic\>  
\<pic\>  
\<caption\>Video Cameras\</caption\>  
\<thumbnail\>[http://www.genius-me.com:8080/GENIUS/GetDoc?UniqueKeyValue=4312&ShowPath=false&Download=false](http://www.genius-me.com:8080/GENIUS/GetDoc?UniqueKeyValue=4312&ShowPath=false&Download=false)\</thumbnail\>  
\<link\>[http://www.genius-me.com:8080/GENIUS/GetRecords?Template=Genius/Sub&Type=Products\_Listing&Level=3&Parent=193](http://www.genius-me.com:8080/GENIUS/GetRecords?Template=Genius/Sub&Type=Products_Listing&Level=3&Parent=193)\</link\>  
\</pic\>  
\<pic\>  
\<caption\>Home Theater\</caption\>  
\<thumbnail\>[http://www.genius-me.com:8080/GENIUS/GetDoc?UniqueKeyValue=4313&ShowPath=false&Download=false](http://www.genius-me.com:8080/GENIUS/GetDoc?UniqueKeyValue=4313&ShowPath=false&Download=false)\</thumbnail\>  
\<link\>[http://www.genius-me.com:8080/GENIUS/GetRecords?Template=Genius/Sub&Type=Products\_Listing&Level=3&Parent=44](http://www.genius-me.com:8080/GENIUS/GetRecords?Template=Genius/Sub&Type=Products_Listing&Level=3&Parent=44)\</link\>  
\</pic\>  
\<images\>
