I don’t know why this is not working.
I have a short quiz where in step one, the user clicks a button that populates text in a dynamic textbox. Then in step two, they do the exact same thing again.
I’ve done research that suggests I’m getting this error because something is not loaded or something is not on the stage, but all of the items are on the stage and I’m not loading anything externally. I’ve narrowed it down to my first set of event listeners, but they all look normal to me.
Here’s the code (forgive the mess, there’s probably an easier way to acheive what I’m trying to do, but I’m not versed enough to do it) and the fla:
stop();
var firstak1:String = "The conference is in Detroit";
var secondak1:String = " please let me know if you have any questions.";
var secondbk1:String = " I can easily drive to it.";
var secondck1:String = " the cost could be as low as $250 if we register by tomorrow.";
var seconddk1:String = " I think this would be a great opportunity to learn the latest techniques to help improve our business.";
var secondek1:String = " we won’t need to disrupt any of our client’s scheduled appointments.";
var pfork1:String = ", for";
var pbutk1:String = ", but";
var psok1:String = ", so";
var pandk1:String = ", and";
var pork1:String = ", or";
var psemik1:String = ";";
var pnork1:String = ", nor";
var pyetk1:String = ", yet";
var pperiodk1:String = ".";
myphrase.text = firstak1;
yesno.text = " ";
mycontinue.x = -1000;
scfor.addEventListener(MouseEvent.MOUSE_DOWN, optfork1);
scbut.addEventListener(MouseEvent.MOUSE_DOWN, optbutk1);
scso.addEventListener(MouseEvent.MOUSE_DOWN, optsok1);
scand.addEventListener(MouseEvent.MOUSE_DOWN, optandk1);
scor.addEventListener(MouseEvent.MOUSE_DOWN, optork1);
scnor.addEventListener(MouseEvent.MOUSE_DOWN, optnork1);
scyet.addEventListener(MouseEvent.MOUSE_DOWN, optyetk1);
scsemicolon.addEventListener(MouseEvent.MOUSE_DOWN, optsemicolonk1);
scperiod.addEventListener(MouseEvent.MOUSE_DOWN, optperiodk1);
mycontinue.addEventListener(MouseEvent.MOUSE_DOWN, nextscenek1);
function buttonsgooffk1(e:MouseEvent):void {
ic1.mouseEnabled = false;
ic2.mouseEnabled = false;
ic3.mouseEnabled = false;
ic4.mouseEnabled = false;
ic5.mouseEnabled = false;
scfor.mouseEnabled = false;
scbut.mouseEnabled = false;
scso.mouseEnabled = false;
scand.mouseEnabled = false;
scor.mouseEnabled = false;
scnor.mouseEnabled = false;
scyet.mouseEnabled = false;
scsemicolon.mouseEnabled = false;
scperiod.mouseEnabled = false;
}
function nextscenek1(e:MouseEvent):void{
gotoAndPlay(5);
}
function optfork1(e:MouseEvent):void {
yesno.text = "Incorrect. Try Again.";
}
function optbutk1(e:MouseEvent):void {
var phrasek1:String = firstak1 + pbutk1;
myphrase.text = phrasek1;
ic1.addEventListener(MouseEvent.MOUSE_DOWN, secondoptak1);
ic2.addEventListener(MouseEvent.MOUSE_DOWN, secondoptbk1);
ic3.addEventListener(MouseEvent.MOUSE_DOWN, secondoptck1);
ic4.addEventListener(MouseEvent.MOUSE_DOWN, secondoptdk1);
ic5.addEventListener(MouseEvent.MOUSE_DOWN, secondoptek1);
function secondoptak1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
function secondoptbk1(e:MouseEvent):void {
myphrase.text = phrasek1 + secondbk1;
yesno.text = "Correct!";
buttonsgooffk1(null);
mycontinue.x = 500;
}
function secondoptck1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
function secondoptdk1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
function secondoptek1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
}
function optsok1(e:MouseEvent):void {
var phrasek1:String = firstak1 + psok1;
myphrase.text = phrasek1;
ic1.addEventListener(MouseEvent.MOUSE_DOWN, secondoptak1);
ic2.addEventListener(MouseEvent.MOUSE_DOWN, secondoptbk1);
ic3.addEventListener(MouseEvent.MOUSE_DOWN, secondoptck1);
ic4.addEventListener(MouseEvent.MOUSE_DOWN, secondoptdk1);
ic5.addEventListener(MouseEvent.MOUSE_DOWN, secondoptek1);
function secondoptak1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
function secondoptbk1(e:MouseEvent):void {
myphrase.text = phrasek1 + secondbk1;
yesno.text = "Correct!";
buttonsgooffk1(null);
mycontinue.x = 500;
}
function secondoptck1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
function secondoptdk1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
function secondoptek1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
}
function optandk1(e:MouseEvent):void {
var phrasek1:String = firstak1 + pandk1;
myphrase.text = phrasek1;
ic1.addEventListener(MouseEvent.MOUSE_DOWN, secondoptak1);
ic2.addEventListener(MouseEvent.MOUSE_DOWN, secondoptbk1);
ic3.addEventListener(MouseEvent.MOUSE_DOWN, secondoptck1);
ic4.addEventListener(MouseEvent.MOUSE_DOWN, secondoptdk1);
ic5.addEventListener(MouseEvent.MOUSE_DOWN, secondoptek1);
function secondoptak1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
function secondoptbk1(e:MouseEvent):void {
myphrase.text = phrasek1 + secondbk1;
yesno.text = "Correct!";
buttonsgooffk1(null);
mycontinue.x = 500;
}
function secondoptck1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
function secondoptdk1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
function secondoptek1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
}
function optork1(e:MouseEvent):void {
yesno.text = "Incorrect. Try Again.";
}
function optnork1(e:MouseEvent):void {
yesno.text = "Incorrect. Try Again.";
}
function optyetk1(e:MouseEvent):void {
var phrasek1:String = firstak1 + pyetk1;
myphrase.text = phrasek1;
ic1.addEventListener(MouseEvent.MOUSE_DOWN, secondoptak1);
ic2.addEventListener(MouseEvent.MOUSE_DOWN, secondoptbk1);
ic3.addEventListener(MouseEvent.MOUSE_DOWN, secondoptck1);
ic4.addEventListener(MouseEvent.MOUSE_DOWN, secondoptdk1);
ic5.addEventListener(MouseEvent.MOUSE_DOWN, secondoptek1);
function secondoptak1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
function secondoptbk1(e:MouseEvent):void {
myphrase.text = phrasek1 + secondbk1;
yesno.text = "Correct!";
buttonsgooffk1(null);
mycontinue.x = 500;
}
function secondoptck1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
function secondoptdk1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
function secondoptek1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
}
function optsemicolonk1(e:MouseEvent):void {
var phrasek1:String = firstak1 + psemik1;
myphrase.text = phrasek1;
ic1.addEventListener(MouseEvent.MOUSE_DOWN, secondoptak1);
ic2.addEventListener(MouseEvent.MOUSE_DOWN, secondoptbk1);
ic3.addEventListener(MouseEvent.MOUSE_DOWN, secondoptck1);
ic4.addEventListener(MouseEvent.MOUSE_DOWN, secondoptdk1);
ic5.addEventListener(MouseEvent.MOUSE_DOWN, secondoptek1);
function secondoptak1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
function secondoptbk1(e:MouseEvent):void {
myphrase.text = phrasek1 + secondbk1;
yesno.text = "Correct!";
buttonsgooffk1(null);
mycontinue.x = 500;
}
function secondoptck1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
function secondoptdk1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
function secondoptek1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
}
function optperiodk1(e:MouseEvent):void {
var phrasek1:String = firstak1 + pperiodk1;
myphrase.text = phrasek1;
ic1.addEventListener(MouseEvent.MOUSE_DOWN, secondoptak1);
ic2.addEventListener(MouseEvent.MOUSE_DOWN, secondoptbk1);
ic3.addEventListener(MouseEvent.MOUSE_DOWN, secondoptck1);
ic4.addEventListener(MouseEvent.MOUSE_DOWN, secondoptdk1);
ic5.addEventListener(MouseEvent.MOUSE_DOWN, secondoptek1);
function secondoptak1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
function secondoptbk1(e:MouseEvent):void {
myphrase.text = phrasek1 + secondbk1;
yesno.text = "Correct!";
buttonsgooffk1(null);
mycontinue.x = 500;
}
function secondoptck1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
function secondoptdk1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
function secondoptek1(e:MouseEvent):void {yesno.text = "Incorrect. Try Again.";}
}
http://www.mediafire.com/file/u1uncwmnmzz/eng100_independentclause2.fla (CS4)