loading External SWF error. Layer
A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: loading External SWF error. Layer

  1. #1
    Junior Member
    Join Date
    Jun 2014
    Posts
    4

    loading External SWF error. Layer

    Hey people!
    Im from Brazil.
    my problem is simple(I think).
    I making my site all in flash, so when I clicked in a button I want to call External swf
    For example I Click in a MovieClip "HOME" I want Call External swf HOME, where contain my All Home Page.
    So, the problem is when I Use
    on (release){
    loadMovie("home.swf", 2);
    }
    It works and External SWF comes to my stage.
    but the problem is the home.swf sits on top of my page and my custom mouse

    Its possible call a External SWF in specify layer, or frame?
    give a instance for a frame for example....
    I tried but not worked....


    so, Thanks a lot for the help!

  2. #2
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,100
    Hi,

    Try loading your swf into an empty movieclip on the main stage.

    loadMovie("home.swf", emptyClip);

    or

    emptyClip.loadMovie("home.swf");

  3. #3
    Junior Member
    Join Date
    Jun 2014
    Posts
    4
    it worked
    loadMovie("home.swf", _root.mc);
    but the problem is mc do not can have transparency, so home.swf will get transparency too.
    Other problem is the size....
    What I supose to do a emptyClip? an square?
    if you work with shpares will change the size of SWF

    so Still this 2 problens...

    you can teach me make empty movie clip?

    Thanks!

  4. #4
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,100
    Hi,

    Off the top of my head

    PHP Code:
    _root.createEmptyMovieClip("emptyClip",_root.getNextHighestDepth());
    _root.emptyClip._x 100;
    _root.emptyClip._y 100;

    loadMovie("home.swf"_root.emptyClip); 

  5. #5
    Junior Member
    Join Date
    Jun 2014
    Posts
    4
    Quote Originally Posted by fruitbeard View Post
    Hi,

    Off the top of my head

    PHP Code:
    _root.createEmptyMovieClip("emptyClip",_root.getNextHighestDepth());
    _root.emptyClip._x 100;
    _root.emptyClip._y 100;

    loadMovie("home.swf"_root.emptyClip); 

    The Code work fine, I get the external swf, but the problem is the still getting Over all others MovieClipe

    for example I have Index.swf and a Want to load Page2.swf

    when I click in MovieClip for load page2.swf

    the page2.swf get Over all Layers, like be in the last one, and site get covered....

    The mouse Effect get under page2.swf

    Can you Understand?

    Its very complicated

    But thanks a lot for your help

  6. #6
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,100
    Hi,

    It's just a matter of depth, I suggest you make the mouse effect use the same principle as the loading movieclips, getNextHighestDepth(), make the mouse effect goto the next highest depth.

    Or you could make your emptymovieclips at a lower deptht than your mouse effect.

    with a liitle playing around you should get it to work how you like, remeber, placing something directly on the stage gives it a negative depth ( -10000)

  7. #7
    Junior Member
    Join Date
    Jun 2014
    Posts
    4
    Quote Originally Posted by fruitbeard View Post
    Hi,

    It's just a matter of depth, I suggest you make the mouse effect use the same principle as the loading movieclips, getNextHighestDepth(), make the mouse effect goto the next highest depth.

    Or you could make your emptymovieclips at a lower deptht than your mouse effect.

    with a liitle playing around you should get it to work how you like, remeber, placing something directly on the stage gives it a negative depth ( -10000)

    Can you give me a example?

    for example I click on button
    on (release){

    so what next?

    }

    its not possible load swf on especify Layer or Graphic ?

    The problem is the transparency and SWF get over all document

  8. #8
    Senior Member
    Join Date
    Nov 2001
    Posts
    1,145
    When you do this code, you are creating an empty movieclip at a certain DEPTH. The DEPTH sets which clip is on top.

    _root.createEmptyMovieClip("emptyClip",_root.getNe xtHighestDepth());

    When you set the DEPTH to getNextHighestDepth(), you are saying get the next available number. Which is why you should never use this and don't need it.

    Set your DEPTH yourself.

    _root.createEmptyMovieClip("mcBackground",20);
    _root.createEmptyMovieClip("mcPicture",600);
    _root.createEmptyMovieClip("mcTextOverPicture",800 );
    _root.createEmptyMovieClip("mcPicture2",620);

  9. #9
    . fruitbeard's Avatar
    Join Date
    Oct 2011
    Posts
    1,100
    Hi,

    When I was doing my AS2 site I used to use nextHighestDepth quite a bit, due to the fact that I had an index swf with 7 or 8 external movies loaded in when required, so when one clip was clicked it appeared at the top.

    So I wouldn't say never use it, I did need it.

  10. #10
    Senior Member
    Join Date
    Nov 2001
    Posts
    1,145
    Yeah we all used it at some point. It's just that it's not a good solution. Like when you're using it to manage visibility. You should use the visible property to make things visible.

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

Poll by Flashkit.com