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

How To Make Text Disappear When Mouse is On a Button?

Guest
Mar 05, 2013 Mar 05, 2013

Hello,  I'm completely new to Flash and well I need some help. I created a page that has static text in the center.

The page has buttons on side and when I rollover a button text appears, but the problem is that when I rollover a button, the static text in the center is there and I want to hide it as I can't read anything because the texts are overlapped.

How do I make the text in the center disappear/hide when I rollover a button and how do I make it reappear when the the mouse is off the button?

I hope what I am explaining makes sense.

TOPICS
ActionScript
622
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

LEGEND , Mar 05, 2013 Mar 05, 2013

You can assign onRollOver and onRollOut code to the buttons to make the text dispappear, but you'll need to make the text a movieclip with an instance name that you can use to target it to turn it invisible.  In the simple example below, the button has an instance name of "btn" and the text movieclip has an instance name of "text_mc"

btn.onRollOver = function(){

      text_mc._visible = false;

}

btn.onRollOut = function(){

      text_mc._visible = true;

}

Translate
LEGEND ,
Mar 05, 2013 Mar 05, 2013

You can assign onRollOver and onRollOut code to the buttons to make the text dispappear, but you'll need to make the text a movieclip with an instance name that you can use to target it to turn it invisible.  In the simple example below, the button has an instance name of "btn" and the text movieclip has an instance name of "text_mc"

btn.onRollOver = function(){

      text_mc._visible = false;

}

btn.onRollOut = function(){

      text_mc._visible = true;

}

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
Guest
Mar 05, 2013 Mar 05, 2013

Thank you very much! It worked~

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
LEGEND ,
Mar 05, 2013 Mar 05, 2013
LATEST

You're welcome

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