You probably just need some content in your _root!
onPress, onRelease etc. do only work if the mouse is over some content
of the MovieClip, even of _root.
For better understanding: If you have a filled circle as movieClip,
onPress events work only within the circle, not in the "corners" of
its bounding rectangle box. So onPress is working on _root only, if it
has some content you can click on.

you should see a handcursor above clickable movieclip instances or
even _root, when you set _root.useHandCursor = true (default).

hth,
Matthias

2006/11/9, John VanHorn <[EMAIL PROTECTED]>:
i know it doesnt make any sense to use onPress on the root because of
children, and nested mc's, its just something i ran into today. i was
debugging something, and i arbitrarily chose _root.onPress to fire off a
trace. when that didnt work, i figured out that _root.onPress was being
ignored.

what makes no sense, is that _root IS a movie clip.....or so i thought it is
supposed to be....it at least acts like one and has all the methods and
properties of a MovieClip.

trace(_root instanceof MovieClip) //traces true

and heres something else i tried:
in a new flash document, on the root timeline, i put:

this.onPress = function(){
   trace(this);
}

published, and nothing happened. i then created another new document, made
an empty movie clip and loaded the other movie with the code above, and it
worked....the onPress was being assigned to that movie.

it just seems weird to me that onPress is a property of the movieclip class,
but just doesnt seem to work with the _root movieclip.

On 11/8/06, Reuben Stanton <[EMAIL PROTECTED]> wrote:
>
> I think the explanation stated that _root is not in fact a MovieClip
> in the same sense. onMouseDown works because it fires globally in
> response to the mouse, not because _root is a MovieClip.
>
> Can I ask, why do you need to use onPress and onRelease on _root
> anyway? Is there some other solution? If you use a release handler on
> _root it will make the release handlers on all nested MovieClips
> inaccessible which seems like a bad way to go to me...
>
>
> On 09/11/2006, at 3:19 PM, John VanHorn wrote:
>
> > no, no.....
> > i totally understand the difference between onMouseDown and onPress
> > for
> > movieclips. i am saying only one works when placed on the root. the
> > player
> > seems to ignore _root.onPress or _root.onRelease.....which makes no
> > sense to
> > me because it is a movieclip and the events will work when assigned
> > to any
> > other movie clip. even using a mouse listener does not work. i even
> > tried
> > setting the hitArea of the root, but to no evail. when the stage is
> > clicked,
> > onPress and onRelease will not fire. you dont even get a hand cursor.
>
> _______________________________________________
> [email protected]
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>



--
John Van Horn
[EMAIL PROTECTED]
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to