A Flash Developer Resource Site

Results 1 to 6 of 6

Thread: [F8] loadMovie Button Not Working

  1. #1

    [F8] loadMovie Button Not Working

    I have a button that calls an external movie SWF -- with the following code:

    on(release) {
    loadMovie("Environment.swf", "this.loadzone");
    }


    The "loadzone" is an instance name of a MovieClip in a layer that is below the menu bar and logo, but above my background. For some reason, the code isn't working. Any ideas?

    I also tried using the Level loadMovieNum -- when I do, it works, but the SWF comes up on top of everything else (hiding the menu and logo)

    I thought it would be easier to load the SWF into an instance of a MovieClip that resided on the layer desired instead of messing with levels.

    Any advice?

  2. #2
    Senior Member
    Join Date
    Sep 2006
    Posts
    225
    A few things may be up here.

    Firstly, I dont think you should have quotes around the target movieclip, and I believe that by using 'this' before the movieclip, flash will be looking inside the button instance for the loadzone movieclip.

    for the sake of trying it out, try putting the following code on your button instead:

    Code:
    on(release) {
    loadzone.loadMovie("Environment.swf");
    }
    Really you should put all your actions onto a single keyframe on a seperate layer on the first frame of your timeline (or the first main frame if you're using a preloader).

    All your code remains in one place and is easier to edit and find should you need to make amendments. But any way one step at a time, get it working first and if you want after that I can try to explain more about what I mean about keeping your code seperate.
    "I used to be with 'it', but then they changed what 'it' was. Now, what I'm with isn't 'it', and what's 'it' seems weird and scary to me."

  3. #3
    Great, it worked! But if I load more than one movieclip into my movie, then they overlap eachother. How do I bring the one that is most recently loaded to the top?

  4. #4
    Senior Member
    Join Date
    Sep 2006
    Posts
    225
    strange, are you loading the movies into different movieclips?

    if you load them all into the same one movieclip they should automatically replace each other, leaving the most recently loaded the only one visible.
    "I used to be with 'it', but then they changed what 'it' was. Now, what I'm with isn't 'it', and what's 'it' seems weird and scary to me."

  5. #5
    All the movieclips are being loaded into the main timeframe.

    Here is the file I'm working on:
    http://www.ijdesign.com/LBA/

    I've added the Load Movie code to the sub-menu buttons "Offices" and "Environment" located within the Welcome expanded menu.

    Right now, if I first click on Offices, it loads the Office's MovieClip, and then when I click on Environment, it opens the Environment MovieClip -- replacing the Office's MovieClip. I don't want it to replace the MovieClips, rather, I want it open the clicked button's movieclip over TOP of the other open MovieClips. Is this possible? I don't want the background to always jump back to the original background, as it looks choppy... I'd rather them open up over eachother. Make sense?

  6. #6
    Senior Member
    Join Date
    Sep 2006
    Posts
    225
    Hmm, I'm sadly at home alone on a Friday night (it's 9.40pm here in the UK) sad eh?

    Anyway I've not got Flash on my home PC - got to escape sometime eh - so I can't examine your .fla files should you be happy to let me look at them, besides I'm now 1/2 way through a bottle of pinot, so can't say how much help I can be from now on this evening, however...

    try something like:

    Code:
    on(release) {
    loadzone.loadMovie("Environment.swf");
    loadzone.swapDepths(getNextHighestDepth);
    }
    Not sure whether I have got the syntax of that correct, so double check it with f1 help.

    You'll need to create a different 'container' movieclip for each of your seperate external clips, and obviously assign the appropriate clip with an individual container.

    It maybe more complex than I think, but I'm sure that the principle is right :P

    Sorry if I've not been much use...
    "I used to be with 'it', but then they changed what 'it' was. Now, what I'm with isn't 'it', and what's 'it' seems weird and scary to me."

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