Groups | Blog | Home
all groups > flash actionscript > february 2006 >

flash actionscript : Global useHandCursor?



David Stiller
2/10/2006 1:38:11 PM
blemmo,

[quoted text, click to view]

Theoretically, sure. You might have to recursively cycle among all your
movie clips and set that property to false.

[quoted text, click to view]

Which makes sense, right? useHandCursor is a MovieClip property. The
_global object is not an instance of the MovieClip class, so it doesn't have
a useHandCursor property. When you assign its value to false, you're
*creating* such a property, but it doesn't relate to anything, because
_global isn't a MovieClip instance.

[quoted text, click to view]

Recursion confuses me sometimes, I have to admit. I've successfully
used it in the past, but I don't always "get it" right away. If you recurse
among the _root's movie clips and set all their useHandCursor properties to
false, that should work.


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

David Stiller
2/10/2006 3:19:56 PM
[quoted text, click to view]

It's definitely possible. Just the recursive part that eludes me at the
moment.

[quoted text, click to view]

Yupper.

for (var clip in _root) {
if (typeof (_root[clip]) == "movieclip") {
trace(_root[clip]._name);
}
}

I can't speak for levels (_level1, _level2, etc.). I've never really
gelled with the value of those. Not saying they're un-useful, only that I
tend to stick with movie clips.


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

blemmo
2/10/2006 3:49:04 PM
Hi,

I was curios if there is a way to set the useHandCursor property for a movie
and all its MovieClips? I tried _global.useHandCursor = false, but this won't
do it.
Is there a way to do this? And would it also affect dynamically loaded
MovieClips?

Thanks,
blemmo
blemmo
2/10/2006 8:14:20 PM
Thanks David,

I was hoping you could set this property globally somehow, so that it affects
all MovieClips or Buttons within the MovieClip where the property was set.
At the moment, I add MovieClips dynamically in a loop, so it's no problem to
set the property there. But I have to set it also for every Button or MovieClip
beside that, what I hoped I could avoid.
I think it should be possible to cycle through all MovieClips, as you
described, but I don't see how to do it. I tried
for(var x in _level)
but that returns only Strings and not the objects. Any idea how this could be
done?

Thanks,
blemmo

blemmo
2/10/2006 9:14:19 PM
Hi again David,

I did use typeof(clip) and not the array syntax, so that's why it didn't work
out. Now I know how and it's all fine. Thanks :).

It would be nice to have a property for that though, like
MovieClip.noHandCursor, which would suppress the Hand cursor for all
Buttons/MovieClips inside it. Could be quite useful, imho.

Greetings,
blemmo
NSurveyor
2/10/2006 10:27:05 PM
Nice, simple, elegant:

MovieClip.prototype.useHandCursor = false;

:)
NSurveyor
2/11/2006 1:53:12 PM
Ok, now I know it's safe to use. Just today, I saw this in the ignoreWhite
entry in the Help Panel:

You can set the default ignoreWhite property for XML objects, as the following
code shows:

XML.prototype.ignoreWhite = true;

blemmo
2/12/2006 5:18:56 PM
Thanks alot, NSurveyor, this simple line does exactly what I wanted. The nice
thing is, it affects also the dynamically created MovieClips. So I don't care
if it's abusive... it's nice and elegant, like you said, and working fine. :)

cheers,
blemmo
Deklan
10/19/2007 12:04:34 PM
Just scouring the internet for this exact function and this is the only place I could find it. You guys rock! Thanks so much for your diligence.

ps. it works for buttons too

From http://www.developmentnow.com/g/69_2006_2_0_0_695355/Global-useHandCursor.htm

Posted via DevelopmentNow.com Groups
AddThis Social Bookmark Button