Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question - Getting error when trying to return from a function (via a Completer) once a sound stops. Why? #32

Open
TheIceMageX50 opened this issue Apr 5, 2015 · 4 comments

Comments

@TheIceMageX50
Copy link

I have a function like this that plays a sound and I want it to return only once the sound stops so I am trying to use a Completer.

  Future<bool> playAttackSound(AttackType type)
  {
    Sound s;
    Completer comp = new Completer();

    switch (type) {
    //init s based on type 
    ...
    }
    s.onStop.addOnce((Sound foo) => comp.complete(true));
    s.play();
    return comp.future;
  }
}

But...when I run my game once the sound plays I get these errors.

Closure call with mismatched arguments: function 'call'

NoSuchMethodError: incorrect number of arguments passed to method named 'call'
Receiver: Closure: (Sound) => dynamic
Tried calling: call(Instance of 'Sound', "")
Found: call(foo)

What's going on here?

@derrick56007
Copy link

Seems like a bug to me

@TheIceMageX50
Copy link
Author

And judging by their seeming (Github) inactivity I guess @playif is somewhat busy one way or another at the moment, huh?

@mbenatti
Copy link

mbenatti commented Apr 8, 2015

@TheIceMageX50 its true, i thinking, what do you think to create a team to do a other updated port of phaser ? how is able?

@TheIceMageX50
Copy link
Author

I wouldn't really be able to commit much time to such things at least for another few weeks but I wouldn't mind trying to help sometime. I'd kind of like to wait and see if @playif comes back around sometime soon though. If any of us could figure out what's going on with some bugs (like this one) we could always make pull requests on this repo.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants