Hi, newbie beginners question: I'm trying to target a movieclip on the timeline in order to change the colour of an element inside the movieclip.
The movieclip on the timeline is called 'meCircle', and inside meCircle there is another movieclip called 'meCircleRed'
I thought I'd be able to use this to change the colour of the movieclip inside;
this.meCircle.meCircleRed.style.backgroundColor = #000;
But does not work... is it correct that meCircleRed should be a movieclip, or perhaps a button?
Finding it difficult to find any examples online to learn from! any pointers to good online guides much appreciated...
Copy link to clipboard
No, you cannot slap CSS styles on movieclips. Canvas mode Does Not Work That Way. To recolor objects in Canvas documents you use the ColorFilter class.
There are alternative approaches too, like storing versions of the graphic pre-drawn in the colors you'll need, or tinting the object with an alpha overlay, or redrawing the object from scratch in code.
ah, thought it seemed a bit too easy... thanks, will read through a lot more of your link!
while I'm here, would you mind just pointing me to the code for tinting an object with an alpha overlay – I think that might be the solution I need...
There is no code. You just put a transparent colored thing over the thing you want to tint. You know, like in the real world.
ah, okay, I see! thanks!