Jump to content
Sign in to follow this  
soupking

AS3 Error #1063: Argument count mismatch [SOLVED]

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!

Share this post


Link to post
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 {

}

Share this post


Link to post
Share on other sites

Awesome, thanks a bunch Jack.

 

That would've taken me all day (if not more time to find).

 

I'll look in that direction.

 

The Best,

-soupking

Share this post


Link to post
Share on other sites

That's it!!!

 

I commented out all the TweenLite commands with onComplete and the error disappeared.

 

Thanks again Jack!!! :D

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.