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

Alter movie clip colour with javascript

Contributor ,
May 14, 2020 May 14, 2020

Hi

 

I have a movieclip in the library (NOT on the stage) which has linkage myBall. I am adding a balls to the time line like this:

var newBall = new lib.myBall();
newBall.x=30;
newBall.y=100;
ballField.addChild(newBall);
	

ballField is a mc on the timeline

 

This is all working fine.

I want to change the colour of the ball. I have tried several things: including this before the above code

lib.myBall.shape.graphics._fill.style = "#FF00FF"; 

which gives lib.myBall.shape is undefined

... and this before the addChild command

newBall.shape.graphics._fill.style = "#FF00FF"; 

which gives newBall.shape is undefined

TOPICS
Code
242
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
no replies

Have something to add?

Join the conversation