Link to home
Start Free TrialLog in
Avatar of zenLogic
zenLogic

asked on

multi-layer alpha tween...

I think this may be a silly question but I'm stuck.

basically, I want to do a fade out/in slideshow tween a couple fotos.

I assume I just need the one layer to fade out as another layer is fading in, eh?   maybe it's one of those things where it's too simple.   anyway, the procedure to drop a foto on the stage and turn it into a movie, etc, etc, I want to make sure I'm going in the right direction.    sorry, one hat too many.   :P

I probably need one of these tweening wizards but I haven't found one that makes it any easier.   any suggestions?
well, it's either got to manage everything well via some GUI >OR< use simple coding methods that can be understood, modified and maintained.  
Avatar of blue-genie
blue-genie
Flag of South Africa image

have a look at your frame transitions  ( assuming you're using mx 2004) - all done for you.
Avatar of Billystyx
Billystyx

and if blu's suggestion is not what you looking for (but it should be - so easy - :), here is a code alternative at
www.billystyx.co.uk ->downloads->flash flas->page 5->image fade in fade out effect (first one).

good luck

billystyx
ASKER CERTIFIED SOLUTION
Avatar of marger50
marger50

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 zenLogic

ASKER


I'm using MX 2004 but am more familiar with plain MX.   where is this frame transition stuff?

sorry guys I'm more of a database type and this shit kinda boggles me.    need help with a complex MS/SQL view gimme a call.

anyway, I think I'm starting to get it tho'.
how about if I want foto #1 to fade out and foto #2 fading in starting half way thru #1's fade out?
basically, I want to fade in/out between both fotos and, of course, never have either an empty stage or just a solid foto.

soooo, I think if I have the first foto fading out from 1-20 and foto #2 fading in from 10-30 it should work, right?
Yes, as blu pointed out, there is no transitions in 6.

You will have to go with either my method using action script, or Marge's (probably best if you aren't comfortable with action script).

Marge's option should work fine for you, the only down side is it makes the file larger.

cheers, and good luck

billystyx

what is it with the alpha setting?
can't u change it after the motion tween has been inserted into the layer?
isn't it as simple as changing the starting alpha to 100 or 0 as u indicate here?
If you click on frame1 of the tween, you can adjust one end of the the alpha and then on the frame on the other end of the tween, click on that and you should be able to change the alpha setting there. Then the tween should reflect your changes.
You can only tween and change alpha on a movie clip.


I've tried that over and over and when I change the alpha setting in frame1 to zero and then go to frame20 and set it to 100 it don't take!   r u sure ya don't havta re-do the whole alpha tweening to make it work?
What does it do when you try this, specifically?


when I click in the first frame and change the alpha value and then go to the last and change it the values don't stay attached to the frames.   the original fade OUT tween is STILL in effect!!
Well, you can always start again...
To be honest, I usually use action script for tweening, due to the fact it s more friendly on file size. I am sure it is possible this way - but its been a while since I played with timeline tweening:)

add the two mcs to the stage in the same position, give them 2 separate instance names, and then add this code to the frame.
mc1._alpha=0;
mc2._alpha=100;
mc1.onEnterFrame=function(){
mc1._alpha +=5;
}
mc2.onEnterFrame=function(){
mc2._alpha -=5;
}

this will tween one in and one out at the same time - and no messing around with the timeline.

make sure of course that your instance names reflect those in this code, or the code instance names r3eflect those name you gave the clips.

billystyx

yeah, I've been avoiding AS but this looks a lot simple than the phreakn timeline.    I'm in the awkward position of being more of a VB/ASP programmer.    this C syntax with the hypercritical "{}" encapsulations are annoying.   ya ever notice how not many people want to scream from the hilltops "I AM A GREAT COMPUTER PROGRAMMER!"?    I been in the biz almost 30 years and burnt a good chunk of brain on the mainframe era.

there's always this trick with GUIs - they have to either be near perfect to give clear procedures for EVERYTHING imaginable or ya end up needing code anyway.   THAT'S what so stupid about Flash!   I just got it.   usually u use a GUI and it generates code but Flash does what?   it must just hide some generated script somewhere for what it does on the stage, eh?
not sure how it works to be honest:)
But, I do think that it works differently, otherwise the compiled swf would be no different in size one way or the other, and it isn't the case.
If you are doing if else statements, and you only have one statement you don't need the {} but it pays to get into the habit anyway.

I use vba too, and I find it clunky in a lot of ways action script/javascript isn't, but I do like the goto Here
bit in subs to skip code.
You have the equivalent of break; in AS, but only in for or while loops.

Every coding language has its pros and cons I guess  - just what you're used to..
Anyway, in the newest version of flash, as blu pointed out, transitions will do all this for you with built in classes, but before that version you are better of using your own AS.

Did it work then?
If so, good luck.

billystyx

Is it possible that you didn't set keyframes at each end of the tween? The keyframe is necessary if you want something to change from frame 1 to frame 20 (like the alpha setting).

If you want to make one fade in while the other fades out, you could put them on two different layers. And then stagger the tweens, so as one is fading out, the other is fading in.

Marge

another "hat" too far...
I don't know about u guys but having to do the one person IT dept gets a bit old after a while.
I should either figure out these transition classes in MX 2004 or get into AS.

I'm gonna try the coding approach first later today...
I'll let ya know.

thanks for the help,
Jon
no worries. good luck:)