Copy link to clipboard
Copied
Hi all, I am new to AS3 and just ran in to this problem.
I am trying to have actionscript 3 and greensocks tweenlite change the alpha properties of another file on roll over.
I can do it using just pure actionscript 3; however when I try to use Tweenlite I run in to this error:
5007: An ActionScript file must have at least one externally visible definition
The code I have used is:
image = mc that has the rollover function added to it;
info = mc that has it's alpha set to 0 and I am trying to get it to tween to 1 in 0.5 seconds.
import com.greensock.*;
import com.greensock.easing.*;
image.addEventListener(MouseEvent.MOUSE_OVER, over);
image.addEventListener(MouseEvent.MOUSE_OUT, out);
function over(event:MouseEvent):void{
TweenLite.to(info, 0.5, {alpha:1});
}
function out(event:MouseEvent):void{
TweenLite.to(info, 0.5, {alpha:0});
}
What am I doing wrong?
Thanks in advanced!
1 Correct answer
you're welcome.
Copy link to clipboard
Copied
Oh and all my instance names are setuo properly so it's not that!
Copy link to clipboard
Copied
Nevermind.
SOLVED.
I was using Greensocks AS2 compilation.
I found someone with the same problem as me and the suggestion was to check the asctionscrip version.
Copy link to clipboard
Copied
make sure you're using the as3 version of TweenLite. if you think you are, copy and paste the first 20 or so lines of your TweenLite class.
Copy link to clipboard
Copied
Thanks Kglad 😃
This advice is true.I read about it on another forum but your advice would have helped me tooCopy link to clipboard
Copied
you're welcome.

