A Flash Developer Resource Site

Results 1 to 12 of 12

Thread: Controlling container swf with internal one

  1. #1
    Junior Member
    Join Date
    May 2007
    Posts
    9

    Controlling container swf with internal one

    i have an external swf with an internal swf. is it possible to click on a button in the internal swf so that the external one changes scenes?

  2. #2
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    use frame labels on all target frames
    main.swf resides on level 0

    code in sub.swf
    _level0.gotoAndPlay("a_label");

  3. #3
    Junior Member
    Join Date
    May 2007
    Posts
    9
    what if i used the "loadmovie" method?

  4. #4
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    in main.swf - container.loadMovie("sub.swf");

    main.swf to sub.swf - container.gotoAndPlay("a_label");
    sub.swf to main.swf - _level0.gotoAndPlay("b_label");

  5. #5
    Junior Member
    Join Date
    May 2007
    Posts
    9
    hmmm..... does the level0 have to be defined anywhere else? cause so far i have: a button on internal saying: "on release, loadmovie.root_content"

  6. #6
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    on release, loadmovie.root_content .. total garbage, i'm afraid

    please post the exact code

  7. #7
    Junior Member
    Join Date
    May 2007
    Posts
    9
    {
    loadMovie("websitemainmenu.swf", _root.content);
    }

    content being the empty movie clip. should i send the .fla?

  8. #8
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    and this code is in the main swf ?
    and you want a button action in websitemainmenu.swf to control the main swf ?

    on(release){
    _level0.gotoAndPlay("your_label_name");
    }

    simple MX6 files attached
    Attached Files Attached Files

  9. #9
    Official FK nice guy and MOD 3PRIMATES's Avatar
    Join Date
    Apr 2002
    Location
    Portland Oregon
    Posts
    1,645
    Something to remember if I am not mistaken(its been awhile),
    _root and_level0 are identical if within the scope of the main movie, but if you are within a loaded movie, _root refers to the _root timeline of the loaded movie you are in, and _level0 refers to the main timeline or root of the main movie that contains the loaded movie.

    I remember years ago this caused me many a headache.

    Is that correct?

    3P
    Last edited by 3PRIMATES; 11-04-2007 at 04:26 AM. Reason: typo

  10. #10
    FK'n_dog a_modified_dog's Avatar
    Join Date
    Apr 2003
    Location
    "aaarf"
    Posts
    9,176
    good info. at this link

    Differences between _root and _level0
    http://kb.adobe.com/selfservice/view...4686&sliceId=2

  11. #11
    Junior Member
    Join Date
    May 2007
    Posts
    9
    it works!!! thank you so much

  12. #12
    Junior Member
    Join Date
    May 2007
    Posts
    9
    ok now i have this new problem.......

    it loads perfectly and everything, but once the timeline reaches the end of the scene where i have a stop command, the loaded swf dissappears. i checked all my masks and the stop command is even in a different layer. im not sure what is going on.

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