2 Replies Latest reply on Oct 8, 2007 4:45 PM by egoldin

    Problems with movie clip button inside another MC

      Hi all,
      So I solved one problem earlier thanks to this site, but it's generated a different problem. I was able to figure out how to get external text to load into a text box inside a movie clip. However, the problem is that I want to have a series of buttons also inside said MC which will change, onPress, the text in the box (by loading in text from another file). I'm running into problems, however, because I can't seem to figure out how to get the movie clip buttons to work.

      A short brief on setup. I have a master.swf that loads in splash.swf (the menu and splash animation) and about.swf (a subsection loaded when you click on "about" in the navi bar). When about.swf opens, I have a movie clip play, and text and the submenu appear after 20 frames.

      This is the code I have placed on frame 1 of about.swf:

      [PHP]boxmovie.btn_about2.onPress = function () {
      trace("button was pressed");
      _level0.loadText(loadedInfo, 'vars/about2.txt');

      You can download the files

      Any help would be MUCH appreciated!
        • 1. Re: Problems with movie clip button inside another MC
          clbeech Level 3
          I'm guessing wait I've got the file hold on ... OK, did you give the 'more' button that instance name? ('btn_about2') it's not there in the file that I have. Next, this code needs to be IN the boxmovie MC, guess where ... on frame 23, because you can't assign code to a object that doesn't exist, or has not been instantiated, on the timeline. so it should read:

          btn_about2.onPress - function() {
          _level0.loadText(loadedInfo, 'vars/about2.txt');

          (btw - if you reverse the way you're naming the btns, Flash will give you a list of class methods, when you type a '.' afterwards, as in 'about2_btn' instead, just a thought for you, same with like 'boxmoive_mc' for instance ;)
          • 2. Re: Problems with movie clip button inside another MC
            egoldin Level 1
            Cbeech, you are a god among mere mortals. Thanks for the fifth time.