Topic: photo resizing onRollOver function

hi all,

i'd like to enable an onRollOver function that when the user points his mouse over the large picture (target area), it will enlarge to predefined dimensions. I tried a million options but i cannot figure it out entirely  :( .

What i did manage is creating a mc on the stage (of simpleviewer.fla ) and adding an onRollOver function that repositioned the large picture and even made it smaller by setting smaller dimensions. However, if i entered larger dimensions than the original ones, it just stays the same???

///___<zoom function>_____\

zoom_btn.useHandCursor = true;  //set to false to remove hand cursus

zoom_btn.onRollOver = function&#40;&#41; &#123;
    StageManager.mImageArea.setPosn&#40;100,-10&#41;; //new positions, relative to ????
    StageManager.mImageArea.setSize&#40;100,100&#41;; // new dimensions. i.e. smaller than original. Larger than original doesnt work!!!

    Options.maxImageHeight = 200;
    Options.maxImageWidth = 200;

zoom_btn.onRollOut = function&#40;&#41; &#123;
    //return to original position and dimensions 

///___</zoom function>_____\

alternatively, i figured that the pictures were loaded into some MC by an MCL. so i figured i just resize that MC (called MC below), like so:

///___<zoom function>_____\

// zoom_btn &#40;= mc. Only used as hit area&#41; dimensions and positions equal to MC containing the large picture, to enable onRollOver function on large picture. 

zoom_btn._width = MC._width;
zoom_btn._height = MC._height;                            

zoom_btn._x = MC._x;
zoom_btn._y = MC._y;

MC.setDepthTo&#40;100&#41;;     // setting it to the lower depth to enable zoom_btn to reside on higher depth. DOESNT WORK, see questions below

zoom_btn.useHandCursor = true;

zoom_btn.onRollOver = function&#40;&#41; &#123;
    //this doenst seem to work as i dunno which MC to select. &#40;
    MC._x -= this._width/2;
    MC._y -= this._height/2;
        MC._xscale = 200;
    MC._yscale = 200;
/* //alternative    

    MC._width = imgW*2;
    MC._height = imgH*2;                            
    MC._x -= imgX/2;
    MC._y -= imgY/2;

zoom_btn.onRollOut = function&#40;&#41; &#123;
bla bla inverted data as above... &#125;

but i do not know what the relevant MC is that containes the large picture?
i tried:
mClip_mc    //i think this is the MC in which everything is loaded
mImageHolder_mc   //this should be the one?
mLoader_mc  // dunno what its for

BTW if you encounter the issue that the variable that you are referring to hasnt got the property 'static', or otherwise, most of the time i just changed the properties to 'public static' in stead of e.g. 'private'. Hope thats ok. it doesnt always work. :?

Also i dont know on what depth MC resides, which i need to know to put the zoom_btn mc on top of MC. also, the arrows appear to be on a higher depth, as they hoover over the picture when i moved it to the left.

o by the by, i moved the thumbnails to down left , titles top left, and large picture down right. Just to be clear. :)

Hope anyone can help me out.

Re: photo resizing onRollOver function


so i figured most of it out

the following code allows me to resize the MC. it turned out to be mImageHolder_mc after all, but i forgot that the mc was embedded in ...tss...

///___<zoom function>_____\

zoom_btn.useHandCursor = true;

zoom_btn.onRollOver = function&#40;&#41; &#123;

    ImageArea.mImageHolder_mc._x = -300;
    ImageArea.mImageHolder_mc._y = -250;
    ImageArea.mImageHolder_mc._xscale = 150;
    ImageArea.mImageHolder_mc._yscale = 150;
zoom_btn.onRollOut = function&#40;&#41; &#123;

    ImageArea.mImageHolder_mc._xscale = 100;
    ImageArea.mImageHolder_mc._yscale = 100;
    ImageArea.mImageHolder_mc._x += 300;
    ImageArea.mImageHolder_mc._y += 250;

///___</zoom function>_____\

but some questions remain.

how can i make sure that the enlarged picture is on top of all other items (arrows, thumbs etc)? ImageArea.mImageHolder_mc.getNextHighestDepth(); didnt work

also, if i want to position the zoom_btn mc the same as ImageArea.mImageHolder_mc, and with the same dimensions, how would i go about doing that? the following code didnt work:

zoom_btn._width = ImageArea.mImageHolder_mc._height;
zoom_btn._height = ImageArea.mImageHolder_mc._width;                            

zoom_btn._x = ImageArea.mImageHolder_mc._x;
zoom_btn._y = ImageArea.mImageHolder_mc._y;

anyone :?: