• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Uncaught TypeError when adding a new movie clip

Engaged ,
May 02, 2022 May 02, 2022

Copy link to clipboard

Copied

Hi Animate,

I'm trying to call a library movie clip with code that worked for identical clips but gives the error "lib.bellSideWht is not a constuctor" for the new one I just added.  As far as I can see, the code for the existing library item (which works) is identical to the code for the new library item which doesn't work.  The code below shows code for both clips -- the one on the top works (starSideRt_01), the one on the bottom doesn't (bellSideWht_01).  Any help will be appreciated.

 

//this is the code on the button which is nested 
this.starSideRt_01_btn.addEventListener("click", getStarSideRt.bind(this));
this.starSideRt_02_btn.addEventListener("click", getStarSideRt.bind(this));
this.starSideRt_03_btn.addEventListener("click", getStarSideRt.bind(this));


function getStarSideRt()
{
	exportRoot.positionStarSideRt();
}

this.bellSideWht_01_btn.addEventListener("click", getBellSideWht.bind(this));
this.bellSideWht_02_btn.addEventListener("click", getBellSideWht.bind(this));
this.bellSideWht_03_btn.addEventListener("click", getBellSideWht.bind(this));

function getBellSideWht()
{
	exportRoot.positionBellSideWht();
}

 

//this is the code on the main timeline
this.positionStarSideRt = function()
{
	const starSideRt_mc = new lib.starSideRt();		
	this.addChild(starSideRt_mc);
	starSideRt_mc.x = 200;
	starSideRt_mc.y = 200;
	starSideRt_mc.scale *= 0.45;

	starSideRt_mc.addEventListener("pressmove", moveSomeFlower.bind(this));
	starSideRt_mc.addEventListener("click", clickSomeFlower);
	
}

this.positionBellSideWht = function()
{
	console.log("hello");
	const bellSideWht_mc = new lib.bellSideWht();		
	//this.addChild(bellSideWht_mc);
	//bellSideWht_mc.x = 200;
	//bellSideWht_mc.y = 200;
	//bellSideWht_mc.scale *= 0.45;

	//bellSideWht_mc.addEventListener("pressmove", moveSomeFlower.bind(this));
	//bellSideWht_mc.addEventListener("click", clickSomeFlower);
	
}

 

TOPICS
Code

Views

141

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
community guidelines

correct answers 1 Correct answer

Engaged , May 03, 2022 May 03, 2022

Hi JC,

Yes, I had the linkage name in the Library.  There is nothing wrong with the code, it was something with the movie clip, bellSideWht_mc.  It's a complicated clip with nested subclips and I made it in a hurry by breaking down an existing clip and using the art work, but I must have done something that somehow made it not a constructor.  I started over, made a new clip with original art work and now it works perfectly.  Thanks for your reply.

Zaffer

Votes

Translate

Translate
Community Expert ,
May 03, 2022 May 03, 2022

Copy link to clipboard

Copied

Hi.

 

Is there a symbol with a linkage name of bellSideWht in the Library?

 

Please let us know.

 

Regards,

JC

Votes

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
community guidelines
Engaged ,
May 03, 2022 May 03, 2022

Copy link to clipboard

Copied

Hi JC,

Yes, I had the linkage name in the Library.  There is nothing wrong with the code, it was something with the movie clip, bellSideWht_mc.  It's a complicated clip with nested subclips and I made it in a hurry by breaking down an existing clip and using the art work, but I must have done something that somehow made it not a constructor.  I started over, made a new clip with original art work and now it works perfectly.  Thanks for your reply.

Zaffer

Votes

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
community guidelines
Community Expert ,
May 03, 2022 May 03, 2022

Copy link to clipboard

Copied

LATEST

Great, Zaffer.

 

I'm glad you figured it out.

 

Regards,

JC

Votes

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
community guidelines