i used the xml gallery with thumb tutorial i just changed around the var names
everything thing runs in my xml until it gets down to tracing from the onLoadStart and the rest of the onLoads, which loads the thumbnails. i just can’t figure out what it is.
this is the function
you can see where the one trace works and the others don’t
**also wanted to know if anyone knows how to create a preloader for all the thumbnails from this code, so your not stuck with a blank screen waiting for the thumbs to download **
ActionScript Code:
[FONT=Courier New][LEFT][COLOR=#000000]**function**[/COLOR] thumbs_fn[COLOR=#000000]([/COLOR]num[COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
[COLOR=#808080]*//create empty movieclips inside thumbnail_mc to hold the images in*[/COLOR]
thumbnail_mc.[COLOR=#0000ff]createEmptyMovieClip[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]"thumb"[/COLOR]+num, thumbnail_mc.[COLOR=#0000ff]getNextHighestDepth[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#808080]*///THIS WORKS *[/COLOR]
[COLOR=#0000ff]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]"thumbnail_mc.thumb"[/COLOR]+num.[COLOR=#0000ff]toString[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#808080]*//create listener for when thumbnail_mc.thumb+num is created*[/COLOR]
[COLOR=#000000]**var**[/COLOR] thumb_listener:[COLOR=#0000ff]Object[/COLOR] = [COLOR=#000000]**new**[/COLOR] [COLOR=#0000ff]Object[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#808080]*////THESE DONT WORK*[/COLOR]
[COLOR=#808080]*//onLoadStart(movieclip) method which sets the properties*[/COLOR]
thumb_listener.[COLOR=#0000ff]onLoadStart[/COLOR] = [COLOR=#000000]**function**[/COLOR][COLOR=#000000]([/COLOR]target_mc:[COLOR=#0000ff]MovieClip[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
thumbnail_mc.[COLOR=#0000ff]_x[/COLOR] = -[COLOR=#000080]200[/COLOR];
[COLOR=#0000ff]trace[/COLOR][COLOR=#000000]([/COLOR]target_mc.[COLOR=#0000ff]toString[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#808080]*//onLoadProgress(mc in which content is being loaded, # of loaded bytes, # of total bytes) method *[/COLOR]
[COLOR=#808080]*//which sets the properties and find the getBytesLoaded() and getTotalBytes() of thumbs*[/COLOR]
thumb_listener.[COLOR=#0000ff]onLoadProgress[/COLOR] = [COLOR=#000000]**function**[/COLOR][COLOR=#000000]([/COLOR]target_mc:[COLOR=#0000ff]MovieClip[/COLOR], [COLOR=#0000ff]bytesLoaded[/COLOR]:[COLOR=#0000ff]Number[/COLOR], [COLOR=#0000ff]bytesTotal[/COLOR]:[COLOR=#0000ff]Number[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
[COLOR=#0000ff]trace[/COLOR][COLOR=#000000]([/COLOR]target_mc + [COLOR=#ff0000]".onLoadProgress with "[/COLOR] + [COLOR=#0000ff]bytesLoaded[/COLOR] + [COLOR=#ff0000]" bytes of "[/COLOR] + [COLOR=#0000ff]bytesTotal[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#808080]*//onLoadInit is called when data has loaded and is initialized*[/COLOR]
thumb_listener.[COLOR=#0000ff]onLoadInit[/COLOR] = [COLOR=#000000]**function**[/COLOR][COLOR=#000000]([/COLOR]target_mc:[COLOR=#0000ff]MovieClip[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
[COLOR=#0000ff]trace[/COLOR][COLOR=#000000]([/COLOR]target_mc + [COLOR=#ff0000]" initialized"[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#808080]*//place each movieclip with image inside thumbnail_mc starting at 0*[/COLOR]
target_mc.[COLOR=#0000ff]_y[/COLOR] = [COLOR=#000000]([/COLOR][COLOR=#0000ff]eval[/COLOR][COLOR=#000000]([/COLOR][COLOR=#ff0000]"thumbnail_mc.thumb"[/COLOR]+num[COLOR=#000000])[/COLOR].[COLOR=#0000ff]_height[/COLOR]+[COLOR=#000080]10[/COLOR][COLOR=#000000])[/COLOR]*k;
[COLOR=#808080]*//giving target_mc its own property(pictureValue) as num to be used to select the right thumb to image *[/COLOR]
target_mc.[COLOR=#000080]pictureValue[/COLOR] = num;
[COLOR=#000000]}[/COLOR]
[COLOR=#808080]*//onLoadComplete method is invoked when the content has completely loaded*[/COLOR]
thumb_listener.[COLOR=#0000ff]onLoadComplete[/COLOR] = [COLOR=#000000]**function**[/COLOR][COLOR=#000000]([/COLOR]target_mc:[COLOR=#0000ff]MovieClip[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
[COLOR=#0000ff]trace[/COLOR][COLOR=#000000]([/COLOR]target_mc + [COLOR=#ff0000]" completed"[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#808080]*//ALSO TWEEN LINE AND UP AND DOWN BUTTON HERE TOO*[/COLOR]
[COLOR=#808080]*//tween thumbnail_mc from x point to 0*[/COLOR]
[COLOR=#000000]**var**[/COLOR] thumbX_twn:Tween = [COLOR=#000000]**new**[/COLOR] Tween[COLOR=#000000]([/COLOR]thumbnail_mc, [COLOR=#ff0000]"_x"[/COLOR], Strong.[COLOR=#000080]easeOut[/COLOR], thumbnail_mc.[COLOR=#0000ff]_x[/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#000080]2[/COLOR], [COLOR=#000000]**true**[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#808080]*//tween thumbnail_mc _alpha from 0 100*[/COLOR]
[COLOR=#000000]**var**[/COLOR] thumbALPHA_twn:Tween = [COLOR=#000000]**new**[/COLOR] Tween[COLOR=#000000]([/COLOR]thumbnail_mc, [COLOR=#ff0000]"_alpha"[/COLOR], Strong.[COLOR=#000080]easeOut[/COLOR], [COLOR=#000080]0[/COLOR], [COLOR=#000080]100[/COLOR], [COLOR=#000080]2[/COLOR], [COLOR=#000000]**true**[/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#808080]*//when the thumbALPHA_twn is complete *[/COLOR]
thumbALPHA_twn.[COLOR=#000080]onMotionFinished[/COLOR] = [COLOR=#000000]**function**[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
[COLOR=#808080]*//envoke the firstImage function*[/COLOR]
firstImage[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#808080]*/////////////////////////*[/COLOR]
[COLOR=#808080]*//target_mc(thumbnails)onRollOver, RollOut, onRelease functions*[/COLOR]
[COLOR=#808080]*//all are in the onLoadComplete function*[/COLOR]
[COLOR=#808080]*//////////////////////////*[/COLOR]
[COLOR=#808080]*//onRollOver-- target_mc lower _alpha to 50*[/COLOR]
target_mc.[COLOR=#0000ff]onRollOver[/COLOR] = [COLOR=#000000]**function**[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
target_mc.[COLOR=#0000ff]onEnterFrame[/COLOR] = [COLOR=#000000]**function**[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
[COLOR=#0000ff]if[/COLOR][COLOR=#000000]([/COLOR]target_mc.[COLOR=#0000ff]_alpha[/COLOR] >= [COLOR=#000080]50[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
target_mc.[COLOR=#0000ff]_alpha[/COLOR] -= [COLOR=#000080]5[/COLOR];
[COLOR=#000000]}[/COLOR][COLOR=#0000ff]else[/COLOR][COLOR=#000000]{[/COLOR]
[COLOR=#0000ff]delete[/COLOR] [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]onEnterFrame[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]
[COLOR=#808080]*//onRollOut-- target_mc raise _alpha to 100 from current _alpha*[/COLOR]
target_mc.[COLOR=#0000ff]onRollOut[/COLOR] = [COLOR=#000000]**function**[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
target_mc.[COLOR=#0000ff]onEnterFrame[/COLOR] = [COLOR=#000000]**function**[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
[COLOR=#0000ff]if[/COLOR][COLOR=#000000]([/COLOR]target_mc.[COLOR=#0000ff]_alpha[/COLOR] <= [COLOR=#000080]100[/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
target_mc.[COLOR=#0000ff]_alpha[/COLOR] += [COLOR=#000080]5[/COLOR];
[COLOR=#000000]}[/COLOR][COLOR=#0000ff]else[/COLOR][COLOR=#000000]{[/COLOR]
[COLOR=#0000ff]delete[/COLOR] [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]onEnterFrame[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]
[COLOR=#000000]}[/COLOR]
[COLOR=#808080]*//onRelease-- make the p variable to match the thumbnail selected*[/COLOR]
[COLOR=#808080]*// then take p value and apply it to nextImage() which loads the image selected*[/COLOR]
target_mc.[COLOR=#0000ff]onRelease[/COLOR] = [COLOR=#000000]**function**[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]
[COLOR=#808080]*//target_mc.pictureValue = num -- its subtracted by one to match the loop of p*[/COLOR]
p = target_mc.[COLOR=#000080]pictureValue[/COLOR]-[COLOR=#000080]1[/COLOR];
selectedImage[COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
[COLOR=#000000]}[/COLOR]
[COLOR=#808080]*//ends on onLoadComplete function*[/COLOR]
[COLOR=#000000]}[/COLOR]
[COLOR=#808080]//add movie clip loader[/COLOR]
image_mcl = [COLOR=#000000]new[/COLOR] [COLOR=#0000ff]MovieClipLoader[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#808080]//addlistener for tlistener[/COLOR]
image_mcl.[COLOR=#0000ff]addListener[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#808080]//loadClip whenever tlistener is envoked[/COLOR]
image_mcl.[COLOR=#0000ff]loadClip[/COLOR]COLOR=#000000[/COLOR];
[COLOR=#000000]}[/COLOR]
[/LEFT]
[/FONT]