Jump to content
Search Community

"onComplete" question

TheMightyMac test
Moderator Tag

Recommended Posts

I'm having some trouble with using the "onComplete" function. I'm trying to make an mc slide in to the stage after another mc slides off the stage in a sort of slideshow manner and it works fine until I add a second "onComplete" function on another frame. Here is the sample code on the frame after the button is pressed:

 

TweenLite.to(guagGroup2_mc, .6, {x:-449, ease:Cubic.easeOut});

TweenLite.to(nsGroup_mc, .6, {x:490.15, ease:Cubic.easeOut, delay:.5, onComplete:nsComplete});

function nsComplete()

{

MovieClip(root).gotoAndStop("stopNs");

}

stop();

 

The first instance I use this works fine until I add this code to another frame with different instance names there. Here is the error code I get (it repeats so I just pasted a piece of the error):

 

Error: Cannot tween a null object.

at com.greensock::TweenLite$iinit()

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

at webNew_fla::MainTimeline/onOut2()

TypeError: Error #1006: value is not a function.

at com.greensock::TweenLite/renderTime()

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

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

 

Has anyone had trouble like this? Any help will be greatly appreciated.

 

-Mike-

Link to comment
Share on other sites

basically TweenLite can't find guagGroup2_mc or nsGroup_mc.

 

this can be for a variety of reasons

 

1) these names in the code do not match the names on the symbols.

2) one of those movie clips is not present on the same frame that the code lives in.

 

 

 

add this to your code above the tweens

 

trace("guagGroup2_mc is " + guagGroup2_mc);

trace("nsGroup_mc is " + nsGroup_mc);

 

what do you get?

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...