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

Movieclip change Color

Community Beginner ,
Jul 14, 2023 Jul 14, 2023

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.

Views

102

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 ,
Jul 14, 2023 Jul 14, 2023

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

 

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 ,
Jul 14, 2023 Jul 14, 2023

Copy link to clipboard

Copied

LATEST

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.

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