Skip to main content
Known Participant
September 2, 2009
Answered

how to tween a fadeIn on frame

  • September 2, 2009
  • 1 reply
  • 1383 views

I am working on using AS3 to do my  tweens, rather than working solely on the timeline.

Just a quick question, say I have a logo... when I get to frame 5 I want that to fadeIn. I  have the AS3 to tween it in, however, I am not sure what I assign my function to? If that makes sense?

thanks.

This topic has been closed for replies.
Correct answer Ned Murphy

You don't need to use a function if the tween will happen when you enter the frame, just have that one line of code in that frame (along with whatever import statments you need for the tween to work)...

var fadeIn:Tween = new Tween(btn_home,"alpha",None.easeNone,0,1,1,true);

1 reply

bamaurerAuthor
Known Participant
September 2, 2009

actually, perhaps my code is flawed too, here is my first attempt:


btn_home.onEnterFrame = function (logoIn) {
}

function logoIn (onEnterFrame):void{
    fadeIn = new Tween(btn_home,"alpha",None.easeNone,0,1,1,true);
}

Ned Murphy
Ned MurphyCorrect answer
Legend
September 2, 2009

You don't need to use a function if the tween will happen when you enter the frame, just have that one line of code in that frame (along with whatever import statments you need for the tween to work)...

var fadeIn:Tween = new Tween(btn_home,"alpha",None.easeNone,0,1,1,true);

bamaurerAuthor
Known Participant
September 2, 2009

ah! that makes more sense, thanks Ned.