Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Keep getting this error - 1061: Call to a possibly undefined method play...

Guest
Mar 17, 2013 Mar 17, 2013

I am making application for children as a part of my media course at uni.

I have included four different types of sounds - right answer, wrong answer, win game and loose game.

Each of these sounds have been imported into my library and exported for actionscript.

I used the following code for each sound;

var correctSound:WellDone = new WellDone();

var correctChannel: SoundChannel = new SoundChannel();

var wrongSound:WrongAnswer = new WrongAnswer();

var wrongChannel: SoundChannel = new SoundChannel();

var winnerSound:Winner = new Winner();

var winnerChannel: SoundChannel = new SoundChannel();

var loserSound:Loser = new Loser();

var loserChannel: SoundChannel = new SoundChannel();

Then I have used the following code in the places that i need it..

correctChannel = correctSound.play();

wrongChannel = wrongSound.play();

loserChannel = Loser.play();

winnerChannel = Winner.play();

The first two sounds work perfectly but i am getting the error for the next two saying i am trying to call to an undefined method play.

Game, Layer 'Actions', Frame 9, Line 1741061: Call to a possibly undefined method play through a reference with static type Class.

I haven't been learning ActionScript 3 for very long so any help is much appreciated!!

Thank you!

TOPICS
ActionScript
449
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 17, 2013 Mar 17, 2013
LATEST

does WellDone extend the sound class?

if yes, try:

correctChannel = Sound(correctSound).play();

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines