A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Five Minute Fix - Loading movies within themselves

  1. #1
    Getting Better With Time
    Join Date
    Jun 2001
    Location
    Canada
    Posts
    54

    Five Minute Fix - Loading movies within themselves

    Hello there,

    I am having a bit of trouble with a site I am making.
    Here is what I've done.

    a) I've constructed a main page where I have my header and buttons for navigation at the top. At the bottom I have a footer with some basic contact info.

    b) In the middle I have various pages load. I have used the following code to load these movies.

    //Projects Button - loads the Projects SWF file into the main time line.
    function openProjects() {
    _root.createEmptyMovieClip("siteContentPage_mc",_r oot.getNextHighestDepth());
    _root.siteContentPage_mc.loadMovie("../projects/Projects.swf");
    _root.siteContentPage_mc._y=68;
    _root.siteContentPage_mc._x=0;
    }



    Now the problem I am having occurs after this page successfully loads a new set of buttons for a person to select to see various completed projects.

    In this movie called Projects.swf, I want to create another empty movie clip, where another page can be displayed beneath the new set of buttons. I am having a tough time figuring out the path to get the movie to load correctly in my browser. I've tried many variations with the code, but it has not proven to be very successful. Here is what I've done:


    _root.siteContentPage_mc.createEmptyMovieClip("Loa dedPortfolio_mc",_root.siteContentPage_mc.getNextH ighestDepth());
    _root.siteContentPage_mc.LoadedPortfolio_mc.loadMo vie("instructions/Instructions.swf");
    _root.siteContentPage_mc.LoadedPortfolio_mc._y=17;
    _root.siteContentPage_mc.LoadedPortfolio_mc._x=135


    If you would like to see the site it is at www.modainteriordesign.ca

    Thanks for your help,

    Greg
    ____________________________
    Greg White
    http://www.prestigeinteractive.com

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    you have a pathing problem caused by using _root in the loaded movie, use _parent to remedy. eg.

    sub.swf has code -
    trace(_root.myVar);
    //will trace from a.swf timeline.

    load sub.swf into main.swf using the movieClip.loadMovie(); command
    trace(_root.myVar);
    //will now attempt to trace from main.swf timeline. Change to -
    trace(_parent.myVar);
    //will trace from sub.swf timeline.

  3. #3
    Getting Better With Time
    Join Date
    Jun 2001
    Location
    Canada
    Posts
    54

    Pathing Problem 101

    Hello again,
    Thanks for your response. I am not 100% clear as to what I need to change. I need to do a bit more research on the pros and cons of path vs. root. In my code...

    _root.siteContentPage_mc.createEmptyMovieClip("Loa dedPortfolio_mc",_root.siteContentPage_mc.getNextH ighestDepth());
    _root.siteContentPage_mc.LoadedPortfolio_mc.loadMo vie("instructions/Instructions.swf");
    _root.siteContentPage_mc.LoadedPortfolio_mc._y=17;
    _root.siteContentPage_mc.LoadedPortfolio_mc._x=135


    Do i change all of the roots to _parent?

    Thanks again for your time,

    Greg
    ____________________________
    Greg White
    http://www.prestigeinteractive.com

  4. #4
    Getting Better With Time
    Join Date
    Jun 2001
    Location
    Canada
    Posts
    54

    Darn these paths...

    http://www.modainteriordesign.ca/help/

    I tried what you had suggested. Sadly it did not work. Above is a like to a .rar of the site. I would love it if someone could open it, and then get my link to work.

    Thanks for your help.
    ____________________________
    Greg White
    http://www.prestigeinteractive.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center