Copy link to clipboard
Copied
I made a rectangle to a movieclip and want to change the color on a mouseover. I can change the color of the textfield but with my background rectangle it's not working (not working code is bold and italic).
This is my code for now:
var _this = this;
stage.enableMouseOver(3);
_this.Start_Level_1.on('mouseover', function(){
_this.Start_Level_1.Start_Level_1_Grafik.color = 'blue';
_this.Start_Level_1.Start_Level_1_Text.color = 'black';
});
Thanks for your help.
Copy link to clipboard
Copied
Hi.
If your MovieClip instance only contains a text field and a raw vector shape and if you're are using Animate's default publish settings, then you could use the _fill property like this:
var _this = this;
stage.enableMouseOver(3);
_this.Start_Level_1.on('mouseover', function(e)
{
e.currentTarget.yourTextField.color = 'blue';
e.currentTarget.children[0].graphics._fill.style = 'black';
});
I hope this helps.
Regards,
JC
Copy link to clipboard
Copied
you should really convert the rectangle to an symobl (eg, movieclip), assign it an instance name and then assign its children[0].graphics._fill.style.