Jump to content
Search Community

Cant find TweenLite in my folder

Jerome test
Moderator Tag

Recommended Posts

So I download the as3 folder and placed the com folder in the same folder as my file.

 

I am using the following to import:

import com.greensock.*;

import com.greensock.plugins.*;

import com.greensock.events.*;

import com.greensock.easing.*;

 

When I try to test I am getting this error: 1046: Type was not found or was not a compile-time constant: TweenLite.

For these Lines:

var container_mc_tween:TweenLite;

var full_tween:TweenLite;

var my_tween:TweenLite = TweenLite(e.target);

Link to comment
Share on other sites

Ok, so upon creating the sample fla to send I got more errors as if it found Tweenlite were it was supposed to be. But anyways the error i am getting is a result from me using TweenLite instead of the Tween class. I believe I successfully impleted this expect for this error.

 

I originally had this:

function removeFull(e:MouseEvent):void {
var my_loader:Loader = Loader (e.currentTarget);
full_tween = new Tween(my_loader, "alpha", Strong.easeOut, 1,0,0.5, true);
full_tween.addEventListener(TweenEvent.MOTION_FINISH, tweenFinished);
       container_mc_tween = new Tween(container_mc, "alpha", Strong.easeOut, 0.5,1,0.5, true);

}

function tweenFinished(e:TweenEvent):void {
var my_loader:Loader = Loader (e.target.obj);
my_loader.unload();
full_mc.removeChild(my_loader);
MovieClip(root).removeChild(full_mc);
full_mc = null;

container_mc.addEventListener(MouseEvent.CLICK, callFull);
container_mc.buttonMode = true;
container_mc.addEventListener(MouseEvent.MOUSE_OVER, onOver);
container_mc.addEventListener(MouseEvent.MOUSE_OUT, onOut);

var my_tween:Tween = Tween(e.target);
my_tween.removeEventListener(TweenEvent.MOTION_FINISH, tweenFinished);
}

 

Then I changed it to this:

 

function removeFull(e:MouseEvent):void {
var my_loader:Loader = Loader (e.currentTarget);
full_tween = new TweenLite(my_loader, 1, {alpha:0, ease:Strong.easeOut, onComplete:tweenFinished});
container_mc_tween = new TweenLite(container_mc_tween, 1, {alpha:1, ease:Strong.easeOut});
}

function tweenFinished(e:TweenEvent):void {
var my_loader:Loader = Loader (e.target.obj);
my_loader.unload();
full_mc.removeChild(my_loader);
MovieClip(root).removeChild(full_mc);
full_mc = null;

container_mc.addEventListener(MouseEvent.CLICK, callFull);
container_mc.buttonMode = true;
container_mc.addEventListener(MouseEvent.MOUSE_OVER, onOver);
container_mc.addEventListener(MouseEvent.MOUSE_OUT, onOut);

var my_tween:TweenLite = TweenLite(e.target);
my_tween.removeEventListener(my_tween, {onComplete:tweenFinished});
}

I am getting this error: 1061: Call to a possibly undefined method removeEventListener through a reference with static type com.greensock:TweenLite.

for: my_tween.removeEventListener(my_tween, {onComplete:tweenFinished});

Link to comment
Share on other sites

TweenLite doesn't dispatch events. You're trying to removeEventListener() from a TweenLite :) You simply did an onComplete callback which is NOT the same as an Event listener. No need to remove any listeners. You can just delete those last 2 lines:

 

//DELETE THESE LINES!
var my_tween:TweenLite = TweenLite(e.target);
my_tween.removeEventListener(my_tween, {onComplete:tweenFinished});

Link to comment
Share on other sites

ok I am really new scripting. I am a straight up designer, lol. But the problem I am getting now is this:

ArgumentError: Error #1063: Argument count mismatch on sample_fla::MainTimeline/tweenFinished(). Expected 1, got 0.

at Function/http://adobe.com/AS3/2006/builtin::apply()

at com.greensock.core::TweenCore/complete()

at com.greensock::TweenLite/renderTime()

at com.greensock.core::SimpleTimeline/renderTime()

at com.greensock::TweenLite$/updateAll()

 

The original tweenFinished function accepted and event parameter: function tweenFinished(e:TweenEvent):void ....

So I am not even sure how to edit this right now.

Link to comment
Share on other sites

Ok so basically I can change from:

function tweenFinished(e:TweenEvent):void {
var my_loader:Loader = Loader (e.target.obj);
my_loader.unload();
full_mc.removeChild(my_loader);
MovieClip(root).removeChild(full_mc);
full_mc = null;

container_mc.addEventListener(MouseEvent.CLICK, callFull);
container_mc.buttonMode = true;
container_mc.addEventListener(MouseEvent.MOUSE_OVER, onOver);
container_mc.addEventListener(MouseEvent.MOUSE_OUT, onOut);
}

To

function tweenFinished():void {
MovieClip(root).removeChild(full_mc);
full_mc = null;

container_mc.addEventListener(MouseEvent.CLICK, callFull);
container_mc.buttonMode = true;
container_mc.addEventListener(MouseEvent.MOUSE_OVER, onOver);
container_mc.addEventListener(MouseEvent.MOUSE_OUT, onOut);
}

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...