Topic: onRollOver main Image to show Before/After images ??
G'mornin.
I work as a photo retoucher, and I'm in the process of altering the SVPro to include onRollOver functions for the main images to show the Before/After forms of the image.
I'm a reasonable programmer (in several Other languages), but still working on getting the basics on Flash and ActionScript. Why I start by making changes to some pre-existing coolness is a whole other question. :) Heheh.
So anyway...
I've added another Option and also a 3rd field to the gallery.xml info file with the name of the Before image, and I've got that loading into an array (mImageB4s) alongside the filenames (mImages) and captions.
Essentially the before image filenames are matched along with the Index ids of the main images.
The kicker is this...
How the $%@% do I get the onRollOver to work on the main image?
Since there's no object (please correct if wrong) in the Library to attach this event to, I'm trying to code it into the script files.
I've duplicated some of the functions from the Thumb.as into the Image.as
enableMouseB4s();
[snip..]
// B4 image onRollOver functions
private function enableMouseB4s(mIndex:Number){
mClip_mc.onRollOver = Delegate.create(this,onRollOverB4(mIndex));
mClip_mc.useHandCursor = false;
}
public function onRollOverB4(mCurrentImageIndex:Number){
if (Options.showBefore){
mImageArea.showImageB4(mCurrentImageIndex);
}
}
and ImageArea:
public function showImageB4(mCurrentImageIndex:Number){
if (mImageB4s[mCurrentImageIndex].imageLoadError){
mError_mc._visible = true;
//mImageB4s[mCurrentImageIndex].hideImage();
mImages[mCurrentImageIndex].showImage();
}else{
mError_mc._visible = false;
mImages[mCurrentImageIndex].hideImage();
mImageB4s[mCurrentImageIndex].showImage();
}
}
to load up the Before images in the StageManager:
mImageArea.createImages();
mThumbArea.createThumbs();
mImageArea.createImageB4s(); //addition
As another attempt on the showImageB4 function I used a simplified version:
public function showImageB4(mCurrentImageIndex:Number){
mImageB4s[mCurrentImageIndex].showImage();
}
The main issue (I think) I'm having is in the onRollOverB4 function calling mImageArea.showImageB4 ... should I call it as method to something else? Either that, or it's not being linked to the imageArea itself, i.e. the imageArea isn't responding to the mouse event.
ANY help is greatly appreciated.
I'll happily fill in more details if needed.
Thanks much!
-Jamin-