Flash Change Text Color On Rollover

Posted on 2004-11-09
Last Modified: 2011-04-14
Trying to get text to change color on rollover event, but not working.

level = this;
if (_global.broadcastID_array.length>i) {
      level["invisibleBtn"+i+"_mc"].invisible_btn.onRollOver = function() {
            //CHANGE COLOR OF DATE
            rollOverDateformat = new TextFormat();
            rollOverDateformat.color = 0xFFFFFF;
            // var i = this._name.split("invisible").join("").split("_btn").join("");
            var i = this._name.split("invisibleBtn").join("").split("_mc").join("").split("invisible").join("").split("_btn").join("");

Thanks for any help!

Question by:splendorx
    LVL 16

    Expert Comment


    You may try simply using

    level ["date_txt" + i].textColor = 0XFFFFFF;

    By the way, is that level ["date_txt" + i] pointing to a textfield?
    If not~ the function won't work~

    LVL 1

    Author Comment

    The var i is not recognized in loop; therefore, I created a function and now works using onEnterFrame:

    function highlightText(highlightNo) {
          level = this;
          _root.onEnterFrame = function() {
                highlightDateformat = new TextFormat();
                highlightDateformat.color = 0xFFFFFF;
                delete _root.onEnterFrame;

    Accepted Solution

    Closed, 200 points refunded.
    Community Support Moderator

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
    I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
    In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
    The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…

    734 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    22 Experts available now in Live!

    Get 1:1 Help Now