A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: button help for external swf

  1. #1
    Member
    Join Date
    May 2002
    Posts
    35
    Hi,
    I have built a main movie which is used for navigation, and within that movie I have a blank MC called dummy. When the user makes a choice from the main movie, an eternal swf is loaded into the dummy clip.
    The exernal file that is loaded has one frame, and uses an onClipEvent(enterFrame)for most of the code. The code does not seem to work when the file is loaded into the dummy clip, but if I pre-view the movie by itself it works fine.
    I know it is something simple, but I can not get it to work right.
    Thanks in advance,
    Josh

  2. #2
    [title goes here]
    Join Date
    Apr 2002
    Location
    usa
    Posts
    124

    mc help...

    move the onclipevent code to the dummy clip on the main timeline.......it will work once the mc loads into the dummy

    in other words.......if the dummy clip is called 'dummy'
    then it is at _root.dummy
    and if you load mc1.swf into _root.dummy
    them the timeline of mc1.swf is now referenced as _root.dummy

    Last edited by hansel; 08-27-2003 at 03:18 AM.

  3. #3
    Member
    Join Date
    Apr 2002
    Posts
    31
    using the example above, lets say u got a movieclip named, myLoadedMovie in the mc1.swf, after it was loaded into the movie, it will have the level like :

    _root.dummy.myLoadedMovie (not _root.myLoadedMovie)

    what i think your problem is the components or movieclips in the movieclip to be loaded, eg mc1.swf, is using the level, _root.myLoadedMovie ,this works fine when it is standalone but if you loaded into a movie the level will be wrong. The whole mc1.swf movie will take place of the component in the movie where you load it to, and become the component itself, so in fact all the movieclips in mc1.swf will become lower level.

    The best way is to use a relative address when you do the child movie, _parent. , or if u want to use the absolute address you wont be able to test the child movie, you have to load the main movie then call the child movie to test it. Each _parent. will go back one level. Hence _parent._parent. will go back 2 level.

  4. #4
    Member
    Join Date
    May 2002
    Posts
    35
    thanks for the help, I made the changes and it worked right away.

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