Topic: onRollOver main Image to show Before/After images ??


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 into the

// 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){

and ImageArea:

public function showImageB4(mCurrentImageIndex:Number){
    if (mImageB4s[mCurrentImageIndex].imageLoadError){
        mError_mc._visible = true;    
        mError_mc._visible = false;                     

to load up the Before images in the StageManager:

mImageArea.createImageB4s(); //addition

As another attempt on the showImageB4 function I used a simplified version:

public function showImageB4(mCurrentImageIndex:Number){

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!

Re: onRollOver main Image to show Before/After images ??

thanks Jamin!

Felix Turner
SimpleViewer Support Team.

Re: onRollOver main Image to show Before/After images ??

You're welcome.  :)

Is there something like an answer or a hint in the direction of how to make the image rollOver start actually happening?


Re: onRollOver main Image to show Before/After images ??

OK i've got the onRollOver working... almost.

It works perfectly on the First image in the gallery, and it coughs and just blinks the main image with a loading progress bar on all the others. 

And yes I tested switching which image loaded first... the index 0 in the gallery is the only one that fires properly.  The trace line does show the right file name for each section, but it only shows the first one.

Question:  Should I be doing this in the file instead of the ImageArea? 


The latest iteration of the rollover functions is:

public function onRollOverB4(){ 
    trace("mImageB4s: "+ mXMLManager.imageFileB4s[mCurrentImageIndex]);

public function onRollOutB4(){