Hi,
I have created dynamic text on a button. How can I get the text to display the hand tool instead of the arrow tool. I have made the text not selectable and given it an instance name then used

itbl_text.buttonMode = true;

it is all contained inside a movie clip called iTunes and in the main stage I have the code

iTunes.buttonMode = true;

How can I make the hand tool come up?

Dani AI

Generated

The symptom is almost always that the TextField (or a child inside the clip) is intercepting mouse events, so the parent never gets the hover and the hand cursor. pointed this out and confirmed that the suggested approach worked. The reliable fix is to make the clip that should act like a button receive the mouse events and stop its children from capturing them.

Example (ActionScript 3 — adjust names to your instances):

var wrapper:MovieClip = /* your container clip */;
wrapper.mouseChildren = false;
wrapper.buttonMode = true;
wrapper.useHandCursor = true;

var label:TextField = wrapper.getChildByName("label") as TextField;
label.selectable = false;
label.mouseEnabled = false;

What each line does: disabling mouseChildren makes the container handle mouse input instead of its children; buttonMode makes the cursor eligible to change; useHandCursor ensures a hand is used where applicable; turning off mouseEnabled on the TextField prevents it from stealing clicks or rollovers. If you must keep the text selectable, instead create a transparent hit area (a separate Sprite on top) that receives mouse events and shows the hand while leaving the TextField interactive underneath.

Troubleshooting tips: run the code after the clip is on stage (or listen for ADDED_TO_STAGE), ensure the container is a MovieClip/Sprite (not a TextField), check nested clips for their own mouse settings, and test in the SWF player (not only the authoring view). This covers the common causes when a hand cursor will not appear.

Recommended Answers

All 5 Replies

Member Avatar for Member #46692

Just tested this and it works...

Thanks for sharing these great informations.

Yep that worked thanx =)

there must be a thread for seo field as it is the most demanding field in USA.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.