LoadMovie Question
- Started
- Last post
- 6 Responses
- unfittoprint0
might be me, but if you work with extending classes, complex tree structures and others 'rich' parent/children hierarchies you rarely call the
_root node directly.by using _parent or creating an alternative ___root var to specific regions/scopes of specific purposes you make your code modular, something that can be integrated at any depth of your project.
_lockroot seems more of a hack than good coding, imo.
- CyBrainX0
Couldn't you also use movieclip._lockroot to keep the scope of the loaded movie intact?
I tried to get to the page on the Dictionary from Macromedia, but it doesn't seem to be working today.
See if this page works: http://livedocs.macromedia.com/f…
- j_red0
CyBrainX, I just tried to log on NT and your NT username/password were on this computer. I erased them - don't worry, i didn't take notes
- unfittoprint0
avoid using _root.
why?
because your 'child' movie's _root is now its 'parent's' _root.
#note1: don't target your _root to load a movie. use a blank target [createEmptyMovieClip] to become the holder. otherwise it will erase everything on stage. including your button.
#note2: don't write on(whatever) functions directly on buttons/mc's. that's deprecated. use an unique action layer to paste all your code.
/*example of an mc targeting its root [when placed directly on the stage]:*/
var target:MovieClip = this.createEmptyMovieClip("targe... this.getNextHighestDepth());
mc.onRelease = function() {
this._parent.target.loadMovi e("id.swf");
}
- yurimon0
thanks for the help :)
- CyBrainX0
That doesn't sound good.