Advertisement

05.02.2008 at 08:15AM PDT, ID: 23371887 | Points: 500
[x]
Attachment Details

Assigning Dynamic Text from a Function in AS3

Asked by rgarimella in Macromedia Flash

Hi Folks,

New to AS3, here is what I am trying to do. I have a function, check the code snippet nextFunction.

I have a template_mc movie clip on the stage. It has a dynamic text field named "textKontent" inside the template_mc movieclip.

I am getting a error message when the next_btn is clicked

Error #1009: Cannot access a property or method of a null object reference.

Any ideas

RGStart Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
next_btn.addEventListener(MouseEvent.CLICK, nextFunction);
 
function nextFunction(event:MouseEvent):void {
	if (count != maincontent.textContent.length - 1){
		
		count++;
		var templateName:String = maincontent.template[count];
		
		template_mc.gotoAndStop(templateName);
 
		template_mc.textKontent.htmlText = maincontent.textContent[count];
 
	}
}
[+][-]05.02.2008 at 08:50AM PDT, ID: 21487635

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.02.2008 at 08:53AM PDT, ID: 21487657

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.02.2008 at 09:54PM PDT, ID: 21491352

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.05.2008 at 10:03AM PDT, ID: 21501350

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628