Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AS3: addChild from an AS file

Status
Not open for further replies.
Jan 3, 2008
4
KR
Hello,

I have a fla file with a MovieClip named Billy (class: Billy, Base Class: flash.display.MovieClip) linked to Billy.as.

I am trying to get .as file to add an instance of the MovieClip Billy onto the stage with no luck. If anybody can help me here, Thank You! I am not getting any error messages, just a blank swf file...

this is the code in Billy.as. The fla file is blank.

package
{
import flash.display.MovieClip;
import Billy;

public class Billy extends MovieClip
{
private var _billy:Billy;

public function Billy()
{
_billy = new Billy();
addChild(_billy);
}
}
}
 
Billy.as
Code:
package {
	import flash.display.MovieClip;

	public class Billy extends MovieClip {
		public function Billy() {
			// Constructor
		}
	}
}

Main Timeline (or inside Document Class)
Code:
addChild(new Billy());

Kenneth Kawamoto
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top