I have a movieclip "achtergrond" from my library which I put on stage with a function like this:
function set_game ()
{
oefNr = 4;
var bg:achtergrond = new achtergrond();
bg.x = 0;
bg.y = 0;
bg.name = "bg";
bg.gotoAndStop ("uit");
addChild (bg);
set_next ();
}
The movieclip contains 2 frames "aan" and "uit" and it starts on the frame "uit". Further in my game I want to set the frame to "aan" while a sound is playing, like this:
function playSnd ():void
{
getChildByName("bg").gotoAndStop("aan");
snd = new Sound(new URLRequest("phonetic_" + curArr[curSnd] + ".mp3"));
cnl = snd.play();
cnl.addEventListener (Event.SOUND_COMPLETE, completeSnd);
}
But for the life of me I can't find the correct way to do this. Flash keeps going on about displayObjects and other things, and I have no clue why I can't address my movieclip. Actually, I have a clue, but no more than that. I don't understand this part of Flash very well yet.