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

Loading external image into a movieClip - HTML5 Canvas

Contributor ,
May 29, 2025 May 29, 2025

I have a function that is to populate a movie clip with the values of variables. 

this.pd_PTSVBBEVA=function(){
// This all works fine:
exportRoot.PTSVBBEVA.pDisplay.pName.text = t_PTSVBBEVA;
exportRoot.PTSVBBEVA.pDisplay.pDesc.text = c_PTSVBBEVA;
PP_URL = u_PTSVBBEVA;

// this bit does not:
var pPic = new createjs.Bitmap(p_PTSVBBEVA);
exportRoot.PTSVBBEVA.PDisplay.pic.addChild(pPic);
exportRoot.PTSVBBEVA.PDisplay.pic.scaleX = .2; exportRoot.PTSVBBEVA.PDisplay.pic.scaleY = .2;
}

 

The error produced: Uncaught TypeError: Cannot read properties of undefined (reading 'pic')

 

JefferyWright_0-1748544873025.png

 

'pic' is certainly there in my MC, it is an empty MC:

 

JefferyWright_1-1748544992563.png

 

Looks like it should work, I have a similar function that populates another type of MC in other applications that displays the image just fine, what might I be missing here?

Thanks! 

 

TOPICS
Error
274
Translate
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

Community Expert , May 29, 2025 May 29, 2025

Hi.

 

Inside the function you have exportRoot.PTSVBBEVA.pDisplay and outside of it you have exportRoot.PTSVBBEVA.PDisplay. So I guess you need to correct the case for pDisplay or PDisplay.

 

Regards,

JC

Translate
Community Expert ,
May 29, 2025 May 29, 2025

Hi.

 

Inside the function you have exportRoot.PTSVBBEVA.pDisplay and outside of it you have exportRoot.PTSVBBEVA.PDisplay. So I guess you need to correct the case for pDisplay or PDisplay.

 

Regards,

JC

Translate
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
Contributor ,
May 30, 2025 May 30, 2025

You're absolutely correct, I made a rookie mistake... how emberassing! Thank you!

Translate
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 30, 2025 May 30, 2025
LATEST

Great!

 

No problem at all!

Translate
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