?
Solved

change cursor to finger

Posted on 2010-04-06
15
Medium Priority
?
807 Views
Last Modified: 2013-11-11
Can anyone tell me how to change the cursor from a text cursor to a finger on a dynamic text button on rollover?

Thanks Heaps
0
Comment
Question by:RipleyWasp
15 Comments
 
LVL 37

Expert Comment

by:CyanBlue
ID: 30012356
Make sure that the textField in the text button you have does not have 'Selectable' button selected in the properties panel... (The Ab button right next to the Single line drop down menu...)
   http://www.computer-training-software.com/manuels/images-flash-02/textfield.jpg

CyanBlue
0
 
LVL 7

Expert Comment

by:halfbloodprince
ID: 30029564
set the button's following properties:
useHandCursor = true
buttonMode = true
mouseChildren = false
0
 

Author Comment

by:RipleyWasp
ID: 30058855
Neither of these options are working. I am using dynamic text so it is coming in from a stylesheet as TextFields. When clicked on either text the image changes. The actionscript is quite long but I have included some of it so you get an idea of how one of the buttons works.

function makeGUI():void{
      addChild(about);
}

var myTextL:URLLoader = new URLLoader();
var myTextR:URLRequest = new URLRequest("style.css");
myTextL.load(myTextR);
myTextL.addEventListener(Event.COMPLETE, dataOK);

var about:TextField = new TextField();
about.text = "about";
about.filters = new Array(dropS);
about.x = textX; about.y = textY + 50;

about.setTextFormat(myTF);

about.addEventListener(MouseEvent.CLICK, aboutAction);

function aboutAction(e:MouseEvent):void {
      myR = new URLRequest("2.jpg");
      loadImage();
      myInputText.htmlText = textA[1];
}

Thanks for helping!!
0
Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

 
LVL 37

Expert Comment

by:CyanBlue
ID: 30059513
Add this line after you set the x/y of it...

CyanBlue
about.selectable = false;

Open in new window

0
 

Author Comment

by:RipleyWasp
ID: 30069552
Sort of fixed, the cursor stays as arrow now, would like to change to pointer on rollover.
0
 
LVL 37

Expert Comment

by:CyanBlue
ID: 30074525
I don't think you can do that unless you create an invisible sprite above or down below the textField and then make that do rollOver...  The textField is not supposed to be an UI element...

CyanBlue
0
 

Author Comment

by:RipleyWasp
ID: 30074605
Ok thanks
0
 
LVL 37

Expert Comment

by:CyanBlue
ID: 30074977
Sure thing...  Please close the topic if you think your question is answered...  

CyanBlue
0
 

Author Comment

by:RipleyWasp
ID: 30075152
Would like to keep open as I have seen a site that has it working and know they did it dynamically.
0
 
LVL 37

Expert Comment

by:CyanBlue
ID: 30081360
Okay...  Keep us posted...  ;)

CyanBlue
0
 

Author Comment

by:RipleyWasp
ID: 30081433
Will do.
0
 
LVL 8

Accepted Solution

by:
IqAndreas earned 2000 total points
ID: 30596621
Did you ever get that official solution you were looking for?

As was already mentioned, it is not possible to change the cursor when over a TextField directly. You can see a list of all available properties and methods of the TextField class here:
http://help.adobe.com/en_US/AS3LCR/Flash_10.0/flash/text/TextField.html#propertySummary

However, if you wrap the TextField with a Sprite, you can achieve that hand cursor effect. Give the attached source code a try, and if you have any questions about it, or if you want me to modify the source in any way to suit your needs, just ask.

Good luck with your programming,
Andreas
function makeGUI():void{
      //When is this function called?
      addChild(aboutBTN);
}

var myTextL:URLLoader = new URLLoader();
var myTextR:URLRequest = new URLRequest("style.css");
myTextL.load(myTextR);
myTextL.addEventListener(Event.COMPLETE, dataOK);


//Creat the textField
var aboutTF:TextField = new TextField();
aboutTF.text = "about";
aboutTF.filters = new Array(dropS);
aboutTF.setTextFormat(myTF);
aboutTF.selectable = false;

//Crate the button that holds the textField
var aboutBTN:Sprite = new Sprite();
aboutBTN.x = textX;
aboutBTN.y = textY + 50;

aboutBtn.buttonMode = true;
aboutBtn.mouseChildren = false;
aboutBtn.useHandCursor = true;

aboutBTN.addChild(aboutTF);

//Now make the "hitArea" for the button
var hit:Sprite = new Sprite();
hit.graphics.beginFill(0x000000);
hit.graphics.drawRect(0,0,aboutBtn.width, aboutBtn.height);
aboutBtn.hitArea = hit;

//Now, listen for the mouse events!
aboutBTN.addEventListener(MouseEvent.CLICK, aboutAction);

function aboutAction(e:MouseEvent):void {
      myR = new URLRequest("2.jpg");
      loadImage();
      myInputText.htmlText = textA[1];
}

Open in new window

0
 
LVL 37

Expert Comment

by:CyanBlue
ID: 30609902
Uh, ain't that what I have been said already???

CyanBlue
0
 

Author Comment

by:RipleyWasp
ID: 30658013
Yes I am closing it, I havent tried this yet, but it wasn't what I was after but will probably work. Have given up on this one.
0
 
LVL 37

Expert Comment

by:CyanBlue
ID: 30658627
I'd say that's a nonsense, but if you say so...

CyanBlue
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
The last time I worked with Flash and Socket connections was in AS1. A recent project required flash connecting to a Socket, and sending receiving information - we figured it would be easy enough - we all know about the socket policy documents and c…
The goal of the tutorial is to teach the user how to how to record live broadcast.
The goal of the tutorial is to teach the user how to use the auto adjust feature and what the different options do. When your video is not working right you can choose the auto adjust feature to help choose your settings.
Suggested Courses

588 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