Jump to content
Search Community

ArgumentError on TimelineLite

derschreck test
Moderator Tag

Recommended Posts

Hi All, I am getting an ArgumentError output when I use the onComplete statement on TimlineLite.

 

import com.greensock.*;
import com.greensock.easing.*;

var timeline:TimelineLite = new TimelineLite({onComplete:sayHello});
timeline.insertMultiple(TweenMax.allTo([cosmeticsw, nailsw,makeupsw, hairsw, haircol, makeupcol, cosmeticcol], 0.5, {alpha:0}));
timeline.append(new TweenLite(nailcol, 0.8, {x:"-200", ease:Back.easeOut}));

function sayHello(evt:Event) {

trace("hello");
}

 

and the Error output

ArgumentError: Error #1063: Nicht übereinstimmende Argumentzählung für sns01_fla::Kopievonpanel_nail_21/sagHallo(). 1 erwartet, 0 erhalten.
at Function/http://adobe.com/AS3/2006/builtin::apply()
at com.greensock.core::TweenCore/complete()
at com.greensock::TimelineLite/renderTime()
at com.greensock.core::SimpleTimeline/renderTime()
at com.greensock::TweenLite$/com.greensock:TweenLite::updateAll()

 

Thanks for help

Link to comment
Share on other sites

onComplete is not like setting an event handler. By default it does not send any parameters. You would need to use onCompleteParams to set parameters.

 

var myVar:int = 10;
Tween.to(myObject,{x:10,y:10,onComplete:myFunct,onCompleteParams:[myVar]});

function myFunct(i:int):void {
 //do something
}

Link to comment
Share on other sites

got it! Thank you guys!

I used "onComplete" several times before but never get an error because of my functions doesn't wait for an event

function thisnthat():void
{
do something();
}

I thought onComplete act like an EventListener - "when tween is done goto function and do". That's WRONG!!

sorry for my misrable english. Greetings from Bavaria.

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