onMouseDown is a 'mouse' event that is independent of the movie. The movie
simply can define a handler to run when the onMouseDown even occurs. Put a
square symbol on the stage named 'box' and place this code on the script
layer...
box.onMouseDown = function () {
trace('function called');
}
The function is triggered whether you click on the box or not...
Now change it to the following:
box.onPress = function () {
trace('function called');
}
Now this is only called if you press down when over the object (assuming you
have some kind of graphic already in the movie clip). If it is an empty
movie clip, the onPress function will not be called.
So... a lengthy explanation, but it's getting somewhere... your root level
is just like an empty movieclip.... you may be at the root level, but there
is nothing that you are 'on' to press so the function will not call.. The
stage doesn't count.. it's a separate entity. And clicking on other elements
won't work either because they are not considered to be INSIDE of the
root... they simply reside at the root level. Same reason the root changes
if the swf is imported into another Flash file... and navigating to the
imported file if imported in, say, mcHolder clip would be
mcHolder.box.someFunction(), and not mcHolder.IMPORTEDSWF.box.someFunction
()...
Yes.. long winded I know, but I hope it sheds a little light on the
differences. :)
On 11/8/06, John VanHorn <[EMAIL PROTECTED]> wrote:
onMouseDown works fine.....which got me to thinking that when your on the
root, onMouseDown and onPress are essentially the same event, since your
mouse is always over the root. that makes sense.
but, at least to me, it doesnt make sense that one works and the other one
doesnt.
On 11/8/06, Carl Welch <[EMAIL PROTECTED]> wrote:
>
> what about onMouseDown?
>
>
> --
> Carl Welch
> http://www.carlwelch.com
> [EMAIL PROTECTED]
> 805.403.4819
>
> On 11/8/06, John VanHorn <[EMAIL PROTECTED]> wrote:
> > on the root timeline:
> >
> > this.onPress = function(){
> > trace(this);
> > }
> >
> > does not work? the _root/_level0 movie does not take onPress or
> onRelease?
> > other events like onMouseMove or onEnterFrame work fine....why not
> onPress?
> > how have i not run into this before?
> >
> > --
> > 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
>
--
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