Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

adding motion tween to fade effect causes text to jump

Status
Not open for further replies.

myatia

Programmer
Nov 21, 2002
232
Hi,

I'm trying to put a motion tween on a graphic to make it fade out. However, every time I put a motion tween on it, in the frame after the first keyframe (where the tween is applied), the graphic jumps down about a pixel or two. This happens every time I try to do a motion tween on this particular graphic. I have a cuople of other graphics on the page doing the same thing, and they stay in the same position throughout the tween. What's going on? Please help!!

Misty
 
i dont know whats wrong but why not just have the fade with actionscript. that way the graphic stays in the same frame.
 
I just started working with Flash; I don't know how to use ActionScript.
 
give the movie clip an instance name

here i have called it clip

add this to the frame actions (right click in the frame and select actions)

i = 100;
function fadeout(){
if (i>1){
clip._alpha = i;
i -=1;
}else{
clip._alpha = i;
}
}
setInterval(fadeout,100); // control the speed of the fade by changing 100 to whatever >100 slower fade <100 faster fade

 
I don't see where I can type anything in the Action - Frames panel. All I want to do is tween something, which is a really simple action that I should be able to do without ActionScript. What gives?

Misty
 
right click in the frame
a menu will show up
select actions
paste the code above in and change clip to the instance name of your movie clip
 
I right click on the frame and select actions.

The Actions - Frames panel appears.

There's nowhere in there that I'm allowed to paste text.

I can sort of edit the Actions defined in the lefthand menu of the Actions - Frames panel, but I don't see how to add a new action altogether.

I'm using Flash MX. I'd still like to know what's causing the problem in Flash so I don't have to use actionscript.

Misty
 
At the top right of the actions window, there is a menu you can click. You need to go into Expert Mode to paste your own code.
 
Bill often leaves important stuff out, assuming everybody has reach his level of knowledge. To be able to paste text in the actions window, you have to be in Expert Mode. Click on the arrow icon on the right of the window and select Expert mode. You'll then be able to paste his script!

But the problem in your tween could be cause by bitmap shifts. Use 1% & 99% on your tween rather than 0% and 100% levels. If that doesn't work check this:

Regards,

oldman3.gif
 
i stumbled accross this post and thought that looks interesting.....

I tried bill's script but no luck. Bill are you working in MX ?
 
Apologies BIll !!!! Yes it does work, it was my error ---
what a silly boy i am !

very good it is too
 
I have tried to use this code but keep getting an onClipEvent handler error.

I put in
onClipEvent (load) {
}

= 100;
function fadeout(){
if (i>1){
clip._alpha = i;
i -=1;
}else{
clip._alpha = i;
}
}
setInterval(fadeout,100)

I get this error

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 1: Clip events are permitted only for movie clip instances
onClipEvent (load) {

Scene=Scene 1, Layer=Layer 1, Frame=1: Line 4: Unexpected '=' encountered
= 100;

Thank you for your help. The secret in education lies in respecting the student. {Ralph Waldo Emerson}.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top