A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Adding a rollover state to a movieclip

  1. #1
    Junior Member
    Join Date
    Nov 2008
    Posts
    24

    Adding a rollover state to a movieclip

    I have a flash piece with a number of shapes/text that are movieclips, that take you to various sections when clicked. I'd like the text to change color when you roll-over them.

    I know you can do this with buttons but I've already done a lot of work and they're movieclips. Can I do that?
    Last edited by SteelCurtn75; 11-12-2008 at 10:52 AM.

  2. #2
    :
    Join Date
    Dec 2002
    Posts
    3,518
    What version of Flash and AS are you using?
    Is the text in the movieclips dynamic?

    With dynamic textfields and AS2 on main timeline....
    Code:
    var my_fmt = new TextFormat();
    btn1.dispTxt.text = "one";
    btn2.dispTxt.text = "two";
    //
    function doRollOver() {
    	my_fmt.color = 0xFF0000;
    	this.dispTxt.setTextFormat(my_fmt);
    	this.onRollOut = doRollOut;
    }
    function doRollOut() {
    	my_fmt.color = 0x000000;
    	this.dispTxt.setTextFormat(my_fmt);
    }
    btn1.onRollOver = doRollOver;
    btn2.onRollOver = doRollOver;

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center