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
LVL 1
bjv211Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

trigger-happyCommented:
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
0
trigger-happyCommented:
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;
      }
}
0
vickerleungCommented:
It is better to initialize the variable before use

Add this line beforehand

_global.sized = 0;

Vicker
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

bjv211Author Commented:
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.
0
vickerleungCommented:
bjv211,

Change this:

onClipEvent (mouseDown) {
      fadein(pic4_big);
}

to

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

See if it helps~~ :)

Vicker
0
vickerleungCommented:
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
0
negatyveCommented:
Your functions don't work because you are exporting your movie for the flash 5 player, while onEnterFrame syntax is valid from flash player 6+...
Follow me:

- create an empty movieclip in the first frame of your movie main timeline
- give it the instance name "fader"
- create inside it 5 empty frames:

1 frame script (no label):
// =============
stop();
// =============

2 frame (labeled "fadeout");
// =============
if(this.target._alpha > 0){
      this.target._alpha -= 6;
} else {
      this.gotoAndStop(1);
}
// =============

3 frame (no label);
// =============
gotoAndPlay("fadeout");
// =============

4 frame (labeled "fadein");
// =============
if(this.target._alpha < 100){
      this.target._alpha += 6;
} else {
      this.gotoAndStop(1);
}
// =============

5 frame (no label);
// =============
gotoAndPlay("fadein");
// =============


- change the script in the first frame of the main timeline to:

// ======================================
fscommand ("allowscale", "false");
      title = new Array(...)
      subtitle = new Array(...);
function getinfo(num) {
      out.title = title[num];
      out.subtitle = subtitle[num];
}
function getstandby () {
      out.title = "Ben '&' Lauren";
      out.subtitle = "2004";
}
function fadeout(target) {
      fader.target = target;
      fader.gotoAndPlay("fadeout");
}
function fadein(target) {
      fader.target = target;
      fader.gotoAndPlay("fadein");
}
this.camera._alpha = 15;
this.pic4_big._alpha = 0;
// ======================================


- change the button script to:

// ======================================
onClipEvent (mouseDown) {
      if (this.over) {
            _root[this.zoomed ? "fadeout" : "fadein"](_root.pic4_big);
            this.zoomed = !this.zoomed;
      }
}
// ======================================
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
bjv211Author Commented:
Oh negatyve, you amaze me once again, and thanks to everyone else for getting this going...Negatyve you rock
0
bjv211Author Commented:
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?
0
negatyveCommented:
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.....?
0
bjv211Author Commented:
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?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Adobe Flash

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.