I need help with my code.
I have gallery which I want to modify. Now, I load big image on the stage by clicking thumbnal menu. I can see a small preview of that thumbnail on mouse over. Thumbnail preview is done by cloning thumbnail image and nest that image into thumbnail preview window.
Bellow is the function which does it:
[COLOR=#0066cc]private[/COLOR] [COLOR=#000000]**function**[/COLOR] onMouseOver[COLOR=#66cc66]([/COLOR]evt:MouseEvent[COLOR=#66cc66])[/COLOR]:[COLOR=#0066cc]void[/COLOR] [COLOR=#66cc66]{[/COLOR]
[COLOR=#808080]*// Get the thumbnail*[/COLOR]
[COLOR=#000000]**var**[/COLOR] thumbnail:Thumbnail = evt.[COLOR=#0066cc]target[/COLOR] as Thumbnail;
[COLOR=#b1b100]if[/COLOR] [COLOR=#66cc66]([/COLOR]thumbnail != [COLOR=#000000]**null**[/COLOR] && thumbnail.[COLOR=#006600]galleryItem[/COLOR].[COLOR=#006600]thumbnail[/COLOR] != [COLOR=#000000]**null**[/COLOR][COLOR=#66cc66])[/COLOR] [COLOR=#66cc66]{[/COLOR]
thumbnail.[COLOR=#006600]playMouseOver[/COLOR][COLOR=#66cc66]([/COLOR][COLOR=#66cc66])[/COLOR];
[COLOR=#808080]*// Copy the content of the thumbnail*[/COLOR]
[COLOR=#808080]*/////////////////////////////INSERT PHOTO INTO THUMBNAIL WINDOW//////*[/COLOR]
thumbWindow.[COLOR=#006600]thumbnail[/COLOR] = [COLOR=#000000]**new**[/COLOR] Bitmap[COLOR=#66cc66]([/COLOR]thumbnail.[COLOR=#006600]galleryItem[/COLOR].[COLOR=#006600]thumbnail[/COLOR].[COLOR=#006600]bitmapData[/COLOR].[COLOR=#006600]clone[/COLOR][COLOR=#66cc66]([/COLOR][COLOR=#66cc66])[/COLOR][COLOR=#66cc66])[/COLOR];
[COLOR=#808080]*// calculate the position of the thumbnail window*[/COLOR]
thumbWindow.[COLOR=#006600]x[/COLOR] = [COLOR=#66cc66]([/COLOR]container.[COLOR=#006600]x[/COLOR] + thumbnail.[COLOR=#006600]x[/COLOR][COLOR=#66cc66])[/COLOR] - [COLOR=#66cc66]([/COLOR][COLOR=#66cc66]([/COLOR]thumbWindow.[COLOR=#0066cc]width[/COLOR] - ConfigManager.[COLOR=#006600]SMALL_THUMB_MASK_WIDTH[/COLOR][COLOR=#66cc66])[/COLOR] / [COLOR=#cc66cc]2[/COLOR][COLOR=#66cc66])[/COLOR];
thumbWindow.[COLOR=#006600]y[/COLOR] = menuMask.[COLOR=#006600]y[/COLOR] - thumbWindow.[COLOR=#0066cc]height[/COLOR] - [COLOR=#cc66cc]3[/COLOR];
thumbWindow.[COLOR=#006600]alpha[/COLOR] = [COLOR=#cc66cc]0[/COLOR];
[COLOR=#808080]*// Play animation*[/COLOR]
[COLOR=#000000]**var**[/COLOR] oldY:[COLOR=#0066cc]Number[/COLOR] = thumbWindow.[COLOR=#006600]y[/COLOR];
thumbWindow.[COLOR=#006600]y[/COLOR] += [COLOR=#cc66cc]20[/COLOR];
Tweener.[COLOR=#006600]addTween[/COLOR][COLOR=#66cc66]([/COLOR]thumbWindow, [COLOR=#66cc66]{[/COLOR]y:oldY, alpha:[COLOR=#cc66cc]1[/COLOR], [COLOR=#0066cc]time[/COLOR]:[COLOR=#cc66cc]0[/COLOR].[COLOR=#cc66cc]7[/COLOR], transition:Equations.[COLOR=#006600]easeOutQuart[/COLOR][COLOR=#66cc66]}[/COLOR][COLOR=#66cc66])[/COLOR];
[COLOR=#66cc66]}[/COLOR]
What I want is to load the big image instead of cloning thumbnail image.
The big image is loaded with this method below:
[COLOR=#000000]**var**[/COLOR] photo:Photo = category.[COLOR=#006600]photos[/COLOR][COLOR=#66cc66][[/COLOR]thumbnail.[COLOR=#0066cc]index[/COLOR][COLOR=#66cc66]][/COLOR];
[COLOR=#808080]*// If photo is not loaded, load*[/COLOR]
[COLOR=#b1b100]if[/COLOR] [COLOR=#66cc66]([/COLOR]!photo.[COLOR=#0066cc]loaded[/COLOR][COLOR=#66cc66])[/COLOR] [COLOR=#66cc66]{[/COLOR]
photo.[COLOR=#006600]addEventListener[/COLOR][COLOR=#66cc66]([/COLOR]GalleryItem.[COLOR=#006600]PHOTO_LOADED[/COLOR], onPhotoLoaded, [COLOR=#000000]**false**[/COLOR], [COLOR=#cc66cc]0[/COLOR], [COLOR=#000000]**true**[/COLOR][COLOR=#66cc66])[/COLOR];
[COLOR=#66cc66]}[/COLOR] [COLOR=#b1b100]else[/COLOR] [COLOR=#66cc66]{[/COLOR]
_timer.[COLOR=#0066cc]start[/COLOR][COLOR=#66cc66]([/COLOR][COLOR=#66cc66])[/COLOR];
[COLOR=#66cc66]}[/COLOR]
[COLOR=#808080]*// load image to photo stage*[/COLOR]
photoStage.[COLOR=#006600]photo[/COLOR] = photo;
I’d like to be able to change reference instead of cloning the thumbnail to change the target to where the big image is loaded. I tried to modify the reference below.
[LEFT]thumbWindow.[COLOR=#006600]thumbnail[/COLOR] = [COLOR=#000000]**new**[/COLOR] Bitmap[COLOR=#66cc66]([/COLOR]thumbnail.[COLOR=#006600]galleryItem[/COLOR].[COLOR=#006600]thumbnail[/COLOR].[COLOR=#006600]bitmapData[/COLOR].[COLOR=#006600]clone[/COLOR][COLOR=#66cc66]([/COLOR][COLOR=#66cc66])[/COLOR][COLOR=#66cc66])[/COLOR];[/LEFT]
However, it did not work yet. I do something wrong. I am wondering if someone can help me to figure it out. I spent a lot of time to modify it as It looked like a simple thing but without any success. I will provide more information if needed. The project consists of many classes I can explain more if the information I provided is not enough.
Please help! Any advice is highly appreciated.