Highlighted

Separate AS3

New Here ,
Apr 27, 2020

Copy link to clipboard

Copied

Hi ... i'm trying to move AS3 to separate file

but i always got error

Line 13 1120: Access of undefined property loader.

Line 13 1120: Access of undefined property handle_loadComplete.

Line 14 1120: Access of undefined property loader.

 

this is my code

 

package 
{
	import flash.events.Event;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	import flash.text.TextField;// ini untuk dynamic text
	import se.svt.caspar.template.CasparTemplate;

	public class ParsingXML extends CasparTemplate
	{
		private var loader:URLLoader = new URLLoader();

		loader.addEventListener(Event.COMPLETE, handle_loadComplete);
		loader.load(new URLRequest("pembuktian.txt"));

		private function handle_loadComplete(e:Event):void
		{

			myTextField.text = e.target.data;

		}
	}
}

 

 

before i move to separate file i had test it inside .fla file and it work

 

var loader:URLLoader = new URLLoader();

loader.addEventListener(Event.COMPLETE, handle_loadComplete);
loader.load(new URLRequest("pembuktian.txt"));

function handle_loadComplete(e:Event):void
{

	myTextField.text = e.target.data;

}

 

is there anyone can point me into right direction

 

comment and help would be appreciate

 

Best Regard

 

Gilar Kadarsah | Indonesia

 

 

Note: i also upload the AS3 File and FLA File incase need to open it

Views

176

Likes

Translate

Translate

Report

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

Separate AS3

New Here ,
Apr 27, 2020

Copy link to clipboard

Copied

Hi ... i'm trying to move AS3 to separate file

but i always got error

Line 13 1120: Access of undefined property loader.

Line 13 1120: Access of undefined property handle_loadComplete.

Line 14 1120: Access of undefined property loader.

 

this is my code

 

package 
{
	import flash.events.Event;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	import flash.text.TextField;// ini untuk dynamic text
	import se.svt.caspar.template.CasparTemplate;

	public class ParsingXML extends CasparTemplate
	{
		private var loader:URLLoader = new URLLoader();

		loader.addEventListener(Event.COMPLETE, handle_loadComplete);
		loader.load(new URLRequest("pembuktian.txt"));

		private function handle_loadComplete(e:Event):void
		{

			myTextField.text = e.target.data;

		}
	}
}

 

 

before i move to separate file i had test it inside .fla file and it work

 

var loader:URLLoader = new URLLoader();

loader.addEventListener(Event.COMPLETE, handle_loadComplete);
loader.load(new URLRequest("pembuktian.txt"));

function handle_loadComplete(e:Event):void
{

	myTextField.text = e.target.data;

}

 

is there anyone can point me into right direction

 

comment and help would be appreciate

 

Best Regard

 

Gilar Kadarsah | Indonesia

 

 

Note: i also upload the AS3 File and FLA File incase need to open it

Views

177

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Apr 27, 2020 0
Adobe Community Professional ,
Apr 28, 2020

Copy link to clipboard

Copied

Hi.

 

Your initialization code must be inside of the constructor method of the ParsingXML class.

 

ParsingXML.as

package
{
	import flash.events.Event;
	import flash.net.URLLoader;
	import flash.net.URLRequest;
	import flash.text.TextField;
	import se.svt.caspar.template.CasparTemplate;

	public class ParsingXML extends CasparTemplate
	{
		private var loader:URLLoader = new URLLoader();

		public function ParsingXML()
		{
			loader.addEventListener(Event.COMPLETE, handle_loadComplete);
			loader.load(new URLRequest("pembuktian.txt"));
		}

		private function handle_loadComplete(e:Event):void
		{
			myTextField.text = e.target.data;
		}
	}
}

 

CasparTemplate.as

package se.svt.caspar.template
{
	import flash.display.MovieClip;

	public class CasparTemplate extends MovieClip
	{
		public function CasparTemplate()
		{
			
		}
	}
}

 

I hope this helps.

 

Regards,

JC

__________________________________________
HTML5, JSFL, and AS3 samples: http://bit.ly/2mJgDoG

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 28, 2020 0