A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: Problem Loading Multiple Movies

  1. #1
    Junior Member
    Join Date
    Oct 2003
    Posts
    15

    Problem Loading Multiple Movies

    Hi,

    I have a main menu (cpu.swf) which loads a menu selection. When you select one of the menu, it will load another submenu (type.swf). In type.swf when I click on the submenu buttons, it doesn't load what I want to but when you run type.swf alone, it works fine. I don't know what is wrong. Can someone please help me?


    Thanks a million!
    Joann3
    Attached Files Attached Files

  2. #2
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Where is the "empty" located exactly?

  3. #3
    I tried... dbarbarian's Avatar
    Join Date
    Aug 2003
    Location
    Berkeley, California, USA
    Posts
    678
    I also couldnt find the container clip, but here might be your problem.

    one problem that i could think of is that you are targeting teh container clip wrong.
    After the type.swf is loaded into the cpu.swf, the _root will become the cpu.swf _root. So, if you put _root.TypeContainer.loadMovie() in type.swf, it will not load the movie because it is trying to find TypeContainer in the cpu.swf. I didin't explain that very well, but here is how you can fix it.
    In the cpu.swf you have a container, lets call it container1. In the type.swf you have another container, lets call that container2.
    Right now, you probably have something like this to load the movie for container1.
    _root.container1.loadMovie("type.swf");
    And in the type.swf you probably have something like this:
    _root.container2.loadMovie("whatever");
    To solve your problem you need to change the code in type.swf to:
    _root.container1.container2.loadMovie("whatever");

    Make sense?
    Last edited by dbarbarian; 10-11-2003 at 12:09 PM.

  4. #4
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Works wonders by simply loading on another level (5 for example) rather than in the empty container clip, in "type.swf".

    on (release) {
    //loadMovie("intel.swf", "empty");
    loadMovieNum("intel.swf", 5);
    this.gotoAndPlay("rollout");
    }

    All you then have to do is position intel.swf within itself (in the .fla), I used something like this on it's first frame...

    this._x = 200;
    this._y = 200;

    And add unloadMovieNum(5); on your back button.

    You can keep loading your different movies on level 5, just make sure you replace your _root's with this, as I did above.

  5. #5
    Junior Member
    Join Date
    Oct 2003
    Posts
    15
    Hi,

    Thanks! I got it to work! But there is one more problem... When I mouseover the MENU button in type.swf it doesn't rollin the menu again.

    on (rollOver) {
    _root.gotoAndPlay("rollin");
    }

    I tried changing the "_root" to "this" but it still doesn't play the "rollin". It works again if you play the type.swf by itself but not when combined with the cpu.swf


    Very confused

  6. #6
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    You got it to work when loading on another level?

    Will check the rollin!

  7. #7
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    Using the following (this), works fine for me...

    on (rollOver) {
    this.gotoAndPlay("rollin");
    }

    But watch it, you have an extra keyframe (with the same script using _root) on the end of your menu layer in type.swf. Script has to also be corrected with this rather than _root.

  8. #8
    Junior Member
    Join Date
    Oct 2003
    Posts
    15

    Thanks!

    Hi!

    It all works fine now... Thanks so much... I just have some questions if you don't mind answering. When there is only one swf invloved (_root) will be used is it? and when the second swf is invloved (this) is used? what if there is a 3rd swf? i am having problems understanding when to use (_root) (this) and whatever the 3rd layer will be using...


    Thanks!
    Joann3

  9. #9
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    First thing you should clear for me is...
    Are you loading on a level or still in a container clip?

  10. #10
    Junior Member
    Join Date
    Oct 2003
    Posts
    15
    Hi,

    I am quite new in flash actually. I have done flash before but its the simple kind. I am currently loading swf onto blank movie clips. I actually want to load afew swf onto each other. But everytime I add another onto each one, the new one don't work anymore.

    When you said containier does it mean a blank movie clip? if it is then yes i am loading onto containier. I am really curious about the levels that i should use (eg. root, this,...)

    I have tried looking on the web and on flash's help but there is nothing that teaches about this. I am sorry if I have asked a stupid question.

    What I am trying to do.
    =======================
    I am trying to make a menu system where every menu button loads another swf file onto a blank movie clip. but the more i load i find myself having problems with them not loading or loaded but don't function properly.


    Regards,
    Joann3

  11. #11
    Banned
    Join Date
    Apr 2001
    Location
    Montréal, Québec.
    Posts
    25,397
    And all this time I thought you were now loading on a level!

    Getting late here and I'm about to hit the sack, will pick this up tomorrow.

  12. #12
    Junior Member
    Join Date
    Oct 2003
    Posts
    15
    Hi,

    I have attached my files as its all done except one part. The main menu (main.swf) cannot load (cpu.swf) onto it. instead it replaces the whole (cpu.swf) onto (main.swf). This makes the main menu disappear and the user worn't be able to select from the main menu anymore unless they reload (main.swf) again.


    Regards,
    Joann3
    Attached Files Attached Files

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