Skip to main content

LoadMovie Question 66 Responses

Last post: 2 years, 11 months ago | Thread started: Sep 14, 05, 4:29 a.m.

RespondNew TopicDisable Images

  • yurimon

    Is there another way to load a swf file where the action script inside this file still retains functionality. It loads into the main movie but all action script functions are null. none action script animation works.

    on (release) {
    _root.mload.loadMovie("id.swf");
    }

    Sep 14, 05, 4:29 a.m. – Permalink
  • unfittoprint

    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");
    }

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earSep 14, 05, 4:40 a.m. – Permalink
  • yurimon

    thanks for the help :)

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earSep 14, 05, 4:46 a.m. – Permalink
  • CyBrainX

    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…

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earSep 14, 05, 7:24 a.m. – Permalink
  • j_red

    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

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earSep 14, 05, 7:26 a.m. – Permalink
  • CyBrainX

    That doesn't sound good.

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earSep 14, 05, 8:32 a.m. – Permalink
  • unfittoprint

    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.

    next note >add note

    You must be logged in to add a note. Login now or register for an account.

    Cancel
    Dog-earSep 14, 05, 8:47 a.m. – Permalink

Login or Register to respond to this

Skip to main content