You can always do this in your first keyframe of your root movie:
_global.myRoot = this;
and just use _global.myRoot wherever you would have used _root. This gives you
the slight advantage that should you later want to embed what used to be your
root movie into another swf, all your '_root-y' method calls will still work.
Or you can do something like this:
class MyRoot
{
public static var _root:MovieClip = _root;
}
...and just have a lot of MyRoot._root calls all over the place, if that looks
prettier than _global to you. (or hide it behind a singleton and end up with
MyRoot.getInstance().getRoot() and blah blah blah...)
I'm not exactly sure what the problem is you're running into. _root is just
another movie clip reference that you know will always point to something. How
is it working differently than you expect? Having to reference _root directly
often is generally a bad idea -- just try to pass in into whatever class(es)
will need it when they are constructed or allow everything to reach it via a
singleton.
Eh? Sorry, long day.
-mark hawley
>
> From: [EMAIL PROTECTED]
> Date: 2006/06/28 Wed PM 04:32:32 CDT
> To: [email protected]
> Subject: [Flashcoders] Q:Determining timeline scope from within class
>
> Hi
> Normally when defining local scopes in the timeline I'll use
>
> //set local scope
> _global.localScope=this;
>
>
> However
> this doesn't seem to work if I need to call a 'timeline based' method from a
> class.
>
> Only '_root' seems to work which I'd like to avoid using...
>
> Any suggestions?
> Thanks in advance
> Jim Bachalo
>
> [e] jbach at bitstream.ca
> [c] 416.668.0034
> [w] www.bitstream.ca
> --------------------------------------------
> "...all improvisation is life in search of a style."
> - Bruce Mau,'LifeStyle'
> _______________________________________________
> [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 Mark Hawley
The Nilbog Group
773.968.4980 (cell)
_______________________________________________
[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