Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > ActionScript Forums Group > ActionScript 3.0

Reply
 
Thread Tools Rate Thread Display Modes
Old 07-04-2007, 06:40 PM   #1
dvlnblk
Super Moderator
 
dvlnblk's Avatar
 
Join Date: Jan 2006
Location: Los Angeles, CA
Posts: 1,080
Send a message via AIM to dvlnblk Send a message via MSN to dvlnblk Send a message via Yahoo to dvlnblk
Default Dynamic text is Jacking up my buttonMode = true

Okay, today I am making my first ALL AS3 site. I guess I am going to have to get used to coming here everyday to get answers instead of trying to give them...cool feels like the old days. Well, here it goes:

I have a MC that has a rectangle for a background and a dynamic textField on top of it which I set in it's Class. In that Class I also set the buttonMode to true so I get a hand cursor when the user mouses over the button. The problem is that when I mouse over the background I get the hand cursor just fine but I lose it when I mouse over the dynamic text. Anyone ran into this yet?

Thanks, Dvl
dvlnblk is offline   Reply With Quote
Old 07-04-2007, 07:19 PM   #2
Mazoonist
Site Contributor
 
Mazoonist's Avatar
 
Join Date: Jun 2006
Posts: 2,060
Send a message via AIM to Mazoonist
Default

Hey, dvlnblk,

Hadn't run into it yet, but now that you mention it... I just created a similar mc/button in the authoring tool. Put a dynamic textbox in it, set the buttonMode to true, and sure enough, you're right. No hand cursor on the textbox. Changed the dynamic text box to a static one instead, and that brings back the hand cursor.

I know I'm no help... haha. But so far I don't see a way to get a hand cursor while keeping the textbox dynamic.
Mazoonist is offline   Reply With Quote
Old 07-04-2007, 07:21 PM   #3
Flash Gordon
rather be programming
 
Flash Gordon's Avatar
 
Join Date: Feb 2005
Location: City of Angels
Posts: 10,000
Default

what about not making the dynamic text selectable?

Quote:
selectable property

selectable:Boolean [read-write]

Language version: ActionScript 3.0
Player version: Flash Player 9


A Boolean value that indicates whether the text field is selectable. The value true indicates that the text is selectable. The selectable property controls whether a text field is selectable, not whether a text field is editable. A dynamic text field can be selectable even if it is not editable. If a dynamic text field is not selectable, the user cannot select its text.

If selectable is set to false, the text in the text field does not respond to selection commands from the mouse or keyboard, and the text cannot be copied with the Copy command. If selectable is set to true, the text in the text field can be selected with the mouse or keyboard, and the text can be copied with the Copy command. You can select text this way even if the text field is a dynamic text field instead of an input text field.


The default value is true.
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman
Flash Gordon is offline   Reply With Quote
Old 07-04-2007, 07:22 PM   #4
dvlnblk
Super Moderator
 
dvlnblk's Avatar
 
Join Date: Jan 2006
Location: Los Angeles, CA
Posts: 1,080
Send a message via AIM to dvlnblk Send a message via MSN to dvlnblk Send a message via Yahoo to dvlnblk
Default

haha, well at least I have company! AS3 rocks, I have a logo animation and 8 nav buttons and not one thing on the stage nor any code. If you open the FLA you would swear that it should do absolutely nothing. Also, I just got a review copy of Moock's new AS3 book and it rocks too! Man that dude is a Flash God!
dvlnblk is offline   Reply With Quote
Old 07-04-2007, 07:22 PM   #5
dvlnblk
Super Moderator
 
dvlnblk's Avatar
 
Join Date: Jan 2006
Location: Los Angeles, CA
Posts: 1,080
Send a message via AIM to dvlnblk Send a message via MSN to dvlnblk Send a message via Yahoo to dvlnblk
Default

Quote:
Originally Posted by Flash Gordon View Post
what about not making the dynamic text selectable?
Tried that already....still no worky
dvlnblk is offline   Reply With Quote
Old 07-04-2007, 07:31 PM   #6
dvlnblk
Super Moderator
 
dvlnblk's Avatar
 
Join Date: Jan 2006
Location: Los Angeles, CA
Posts: 1,080
Send a message via AIM to dvlnblk Send a message via MSN to dvlnblk Send a message via Yahoo to dvlnblk
Default

Quote:
Originally Posted by Flash Gordon View Post
what about not making the dynamic text selectable?
Tried it in the code as well and still a no go. Good try though. Any other ideas? This one has me stumped.
dvlnblk is offline   Reply With Quote
Old 07-04-2007, 07:35 PM   #7
Flash Gordon
rather be programming
 
Flash Gordon's Avatar
 
Join Date: Feb 2005
Location: City of Angels
Posts: 10,000
Default

hm....your right

have to wait for someone else to come along.

ActionScript Code:
import flash.text.TextField; import flash.display.Sprite; var container:Sprite = new Sprite(); container.x = container.y = 200; addChild(container); var rect:Sprite = new Sprite(); rect.graphics.lineStyle(2); rect.graphics.beginFill(0xFFCCFF); rect.graphics.drawRect(0, 0, 200, 100); rect.graphics.endFill(); container.addChild(rect); rect.addEventListener("click", onClick); rect.buttonMode = true; var txt:TextField = new TextField(); txt.text = "Hello world"; txt.selectable = false; txt.x = txt.y = 40; container.addChild(txt); function onClick(event:*):void {     trace("click"); }
__________________
I'm old enough to know better and young enough to do it anyway. -- maskedman
Flash Gordon is offline   Reply With Quote
Old 07-04-2007, 07:48 PM   #8
dvlnblk
Super Moderator
 
dvlnblk's Avatar
 
Join Date: Jan 2006
Location: Los Angeles, CA
Posts: 1,080
Send a message via AIM to dvlnblk Send a message via MSN to dvlnblk Send a message via Yahoo to dvlnblk
Default

Haha oh well, thanks for the help, it is greatly appreciated. Hopefully someone has run into this and can lend a hand.
dvlnblk is offline   Reply With Quote
Old 07-04-2007, 07:59 PM   #9
Mazoonist
Site Contributor
 
Mazoonist's Avatar
 
Join Date: Jun 2006
Posts: 2,060
Send a message via AIM to Mazoonist
Default

Making a TextFormat object with an "url" property, and then setting the TextFormat object to the TextField will give you a hand cursor of it's own, but then I'm kind of stuck as to what URL it should go to. I can't think of a dummy url to go to that will have no effect. Null and undefined don't go anywhere, but then the hand cursor is gone again. And it would be kind of kludge workaround anyway.

"lend a hand" -- ha ha I get it!
Mazoonist is offline   Reply With Quote
Old 07-04-2007, 08:26 PM   #10
Mazoonist
Site Contributor
 
Mazoonist's Avatar
 
Join Date: Jun 2006
Posts: 2,060
Send a message via AIM to Mazoonist
Default

Forget that last post. That might give you the hand cursor, but would steal away the action of the CLICK or whatever it was you wanted the button/mc to do.

You're gonna hate this solution, but it works: Make an invisible button and put it over the top of your mc. Instead of programming the mc to do something when clicked or whatever, program the invisible button instead. Now your dynamic text box can stay dynamic, and you'll get a hand cursor over the top of the whole thing.

I said you'd hate it because it's mucking around in the authoring tool instead of moving on with classes and OOP, but maybe there's also a way to do it dynamically.
Mazoonist is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
calling a PDF file in Flash AudryLucy Projectors and CDs 20 12-30-2006 02:43 PM
Box Color Change Jadeivy ActionScript 2.0 7 01-27-2006 03:27 AM
2d Platform engine: "protoman project" kecho ActionScript 2.0 13 02-13-2005 01:11 AM
simple for loop >>pls help Samantha Gram ActionScript 1.0 (and below) 5 08-04-2004 10:28 AM
Using if..esle to test variables pinkaboo ActionScript 1.0 (and below) 2 06-27-2003 02:13 AM


All times are GMT. The time now is 03:41 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.