Link to home
Start Free TrialLog in
Avatar of bjv211
bjv211

asked on

Actionscript for FLash to Fadein larger pics on MOUSE DOWN. 500 POINTS!!

I have the followin flash at http://homepages.nyu.edu/~bjv211   The FLA is http://homepages.nyu.edu/~bjv211/slide_rev.fla  .  I would like the photos to enlarge when you click on them and then go back when you click again.  Any thoughts!!!  thanks
Avatar of trigger-happy
trigger-happy
Flag of Philippines image

Hello bjv211,
        Have you tried using the _xscale and _yscale property of the movie clip? You can have it something like this:

on(press){
      if(_global.sized == 0){
            this._xscale = 100;
            this._yscale = 100;
      }else{
            this._xscale = 80;
            this._yscale = 80;
      }
}

try using that, you can change it to suit your needs.

--trigger-happy
Oops, i forgot

on(press){
      if(_global.sized == 0){
            this._xscale = 100;
            this._yscale = 100;
            _global.sized = 1;
      }else{
            this._xscale = 80;
            this._yscale = 80;
            _global.sized = 0;
      }
}
Avatar of Vicker Leung
It is better to initialize the variable before use

Add this line beforehand

_global.sized = 0;

Vicker
Avatar of bjv211
bjv211

ASKER

My flash file has moved...you can download my fla from http://homepages.nyu.edu/~bjv211/slide.fla   I am trying to use the fadin and fadeout functions I defined in Scene1 layer actionscript on each movieclip when I click.
bjv211,

Change this:

onClipEvent (mouseDown) {
      fadein(pic4_big);
}

to

onClipEvent (mouseDown) {
      _root.fadein(pic4_big);
}

See if it helps~~ :)

Vicker
bjv211,

sorry~
It should be

onClipEvent (mouseDown) {
     _root.fadein(_root.pic4_big);
}

That would be safer

However I found that the fade in function don't work
in this line

target.onEnterFrame = function()

I am thinking why is it like that~

Vicker
ASKER CERTIFIED SOLUTION
Avatar of negatyve
negatyve

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of bjv211

ASKER

Oh negatyve, you amaze me once again, and thanks to everyone else for getting this going...Negatyve you rock
Avatar of bjv211

ASKER

ok Negatyve, sorry to jump to conclusions, at first glance the fading was working, however if I click anywhere on the bar of movieclips the same picture comes up, it is not recognizing individual clips I assume?
I didn't know what kind of effect you are exactly trying to achieve. You want to fadein the proper image at the first click on the proper thumb, and then.....?
Avatar of bjv211

ASKER

thats correct and then fadeout on second click. To recap:  The movie scrolls, the user clicks once on the image, it fades in the larger image and remains until the user clicks again?