I have an instance on my stage that I dragged from my library at design time. This instance links to a custom class who’s constructor takes an argument.
package
{
import flash.display.MovieClip;
import flash.media.Sound;
public class PianoKey extends MovieClip
{
var note:Sound;
public function PianoKey(note:Sound)
{
this.note = note;
}
}
}
Obviously, trying to run the the code as is yields the following argument count error:
ArgumentError: Error #1063: Argument
count mismatch on PianoKey(). Expected
1, got 0.
Is there any way to set arguments on an instance that has been manually dragged to the stage?
This may help you. Just little changes are required in Custom Class