Jump to content
Search Community

AS3 Error #1063: Argument count mismatch [SOLVED]

soupking test
Moderator Tag

Recommended Posts

Hi Jack & Co.,

 

I wouldn't post here except I'm totally boggled and it seems to refer to TweenLite.

 

This is my error:

 

ArgumentError: Error #1063: Argument count mismatch on MethodInfo-102(). Expected 2, got 0.

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

at gs::TweenLite/complete()

at gs::TweenLite/render()

at gs::TweenLite$/updateAll()

 

It won't tell me what line the error is on so I have very little to work with in terms of tracing it. Additionally, since this is the posting additional code would be somewhat arbitrary as the error looks to be pretty static.

 

All I know is I'm not supplying two parameters for something....somewhere. It occurs right after the preloader finishes it's so on top of not having a line # to refer to a gang of events are happening.

 

If this is a common occurance with TweenLite and the way it can be improperly implemented, I'd love to know what could be the issue to a ballpark degree.

 

Thanks!

Link to comment
Share on other sites

You're using an onComplete to call a function that requires two parameters but you forgot to pass any. For example:

 

BAD:

TweenLite.to(mc, 1, {x:100, onComplete:myFunction});
function myFunction(param1:Number, param2:Number):void {

}

 

GOOD:

TweenLite.to(mc, 1, {x:100, onComplete:myFunction, onCompleteParams:[1, 2]});
function myFunction(param1:Number, param2:Number):void {

}

 

ALSO GOOD (add default values for your parameters so they're not required):

TweenLite.to(mc, 1, {x:100, onComplete:myFunction});
function myFunction(param1:Number=0, param2:Number=0):void {

}

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