Button in swf file no longer working once loaded into the master swf

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Max58kl
    New Member
    • Nov 2007
    • 37

    Button in swf file no longer working once loaded into the master swf

    Hi

    I have a main swf file that loads in 2 other swfs.
    The 2 other swfs have on their timeline a movieClipContro ller the plays
    their timeline in reverse when a button is clicked.
    When I view the 2 swfs on their own everything works as it should, the timeline
    plays in reverse.
    But when I load either of the swfs into the main swf and click on the button that reverses the timeline nothing happens.

    I tried turning the information on the timeline of the main swf into a movie clip and giving it an instance name "base"
    Then I added the instance name to the path on the button of the loaded clip

    on (release) {
    _root.base.cont rol.gotoAndPlay (2);
    }

    which made no difference.

    Can someone please help with this.


    Regards Max
  • nomad
    Recognized Expert Contributor
    • Mar 2007
    • 664

    #2
    Originally posted by Max58kl
    Hi

    I have a main swf file that loads in 2 other swfs.
    The 2 other swfs have on their timeline a movieClipContro ller the plays
    their timeline in reverse when a button is clicked.
    When I view the 2 swfs on their own everything works as it should, the timeline
    plays in reverse.
    But when I load either of the swfs into the main swf and click on the button that reverses the timeline nothing happens.

    I tried turning the information on the timeline of the main swf into a movie clip and giving it an instance name "base"
    Then I added the instance name to the path on the button of the loaded clip

    on (release) {
    _root.base.cont rol.gotoAndPlay (2);
    }

    which made no difference.

    Can someone please help with this.


    Regards Max
    Max:

    Try some thing like this
    Make a new layer called labels.
    Make a blank keyframe at each movieClip and give them a name in the Propeties Window.
    Frame base
    Label type: Name

    Then on your button:
    on (release) {
    //Movieclip GotoAndStop Behavior
    this.gotoAndSto p("base");
    //End Behavior
    }

    Make a copy before you do this thou...

    nomad

    Comment

    • Max58kl
      New Member
      • Nov 2007
      • 37

      #3
      HI

      I tried creating a new layer and adding a frame label as you suggested,
      and still nothing happens when I click the button that should play the timeline in reverse.
      The is the code on each frame of the MC Controller

      Frame 1. stop();

      Frame 2. _root.prevFrame (); // Frame 2 has the label "base" on the layer above.

      Frame 3. gotoAndPlay("ba se");

      This is the code on the (play in reverse) button

      on (release) {
      _root.control.g otoAndPlay("bas e");
      }



      Any further suggestions would be appreciated!

      Regards Max

      Comment

      • nomad
        Recognized Expert Contributor
        • Mar 2007
        • 664

        #4
        Originally posted by Max58kl
        HI

        I tried creating a new layer and adding a frame label as you suggested,
        and still nothing happens when I click the button that should play the timeline in reverse.
        The is the code on each frame of the MC Controller

        Frame 1. stop();

        Frame 2. _root.prevFrame (); // Frame 2 has the label "base" on the layer above.

        Frame 3. gotoAndPlay("ba se");

        This is the code on the (play in reverse) button

        on (release) {
        _root.control.g otoAndPlay("bas e");
        }



        Any further suggestions would be appreciated!

        Regards Max
        Max
        did you make the button or did you use one from the library.
        Can you please tell me what you used to create the button and what keyframes you used as well.

        nomad

        Comment

        • Max58kl
          New Member
          • Nov 2007
          • 37

          #5
          Hi

          I recently received the following information, which thankfully resolved the issue.


          scope issue.

          when you play the 2 movies alone _root refers to it's own root timeline. when you load that movie into a new parent movie, _root refers to the parent's main timeline.

          you can either:

          set _lockroot to true on the movieclips that you load in.

          or:

          change your references to _root in the loaded movieclips to relative paths instead of absolute paths.
          I placed -
          Code:
          this._lockroot = true;
          on the first frame of the first scene in both of the loaded swfs
          and the timelines successfully play in reverse when loaded into the main movie.

          Regards Max

          Comment

          Working...