Skip to main content
Participant
October 14, 2013
Question

hover link to change text

  • October 14, 2013
  • 1 reply
  • 596 views

Okay so I have a simple request.. Can someone help me find a tutorial on how to make it so when I hover over a picture it will change the text in a text box to what I want? I tried looking around.. Couldn't find anything.. Must be looking in the wrong places cause I'm sure this is a simple/basic process. Thanks for the help. And BTW.. I'm a noob to flash, so that's why I'd rather have a tutorial then to have someone explain it in short terms. Thanks again.

This topic has been closed for replies.

1 reply

Inspiring
October 14, 2013

//picture IS THE INSTANCE name of the Sprite/MovieClip that holds the picture

picture.addEventListener(MouseEvent.ROLL_OVER, showText);

picture.addEventListener(MouseEvent.ROLL_OUT, hideText);

//tf is the instance name of the dynamic Textfield that alters its text

function showText(e:MouseEvent):void{

    tf.text = "This is a picture";

}

function hideText(e:MouseEvent):void{

    tf.text = "";

}

schpenAuthor
Participant
October 14, 2013

Grrr, I posted this in the wrong section I think.. im actually using AS 2.0.. so that actually is giving me errors.. is this still possible to do in AS 2.0?

Scene=Scene 1, layer=Layer 1, frame=1, Line 1The class or interface 'MouseEvent' could not be loaded.
Scene=Scene 1, layer=Layer 1, frame=1, Line 4The class or interface 'MouseEvent' could not be loaded.
Scene=Scene 1, layer=Layer 1, frame=1, Line 8Statement must appear within on/onClipEvent handler
Scene=Scene 1, layer=Layer 1, frame=1, Line 9Statement must appear within on/onClipEvent handler
Inspiring
October 15, 2013