7 Replies Latest reply on Aug 13, 2009 2:32 AM by Sreelash

    ActionScript 2.0 and Page Flip Program.

    RyanAckley Level 1
      Again any help would be greatly appreciated here. You people are  awesome.

      With the help I have already received I was able to solve one problem only  to run into another.

      I have my "hover caption" working great but when I place my new AS2 swf's  into my
      Flash page flip program they do not work.  The hotspots are there but without the hover  caption.

      I read on the page flip site that, "If your page contains any ActionScript  code, avoid using such
      variables as _root or _level0, which link to the clip on your page. Inside  the book your page is no
      longer _root or _level0.".

      I noticed that the AS does include code that says _root in three places.  I  am very new to AS and I
      have no clue what should be removed or added to this AS where _root is to  get it to work for my Flash page flip
      to work correctly

      Here is my AS below any help would be great and the simpler the better if  possible.  Thanks.



      D901.onRollOver = function() {

       

      captionFN(true, "D901 Diamond Earrings \r 1 3/4 ct. t.w. $2,975", this);
      this.onRollOut = function() {

       

      captionFN(false);

       

      };

       

      };
      D902.onRollOver = function() {

       

      captionFN(true, "D901 Diamond Pendant \r 1 1/4 ct. t.w. $1,950", this);
      this.onRollOut = function() {

       

      captionFN(false);

       

      };

       

      };
      D903.onRollOver = function() {

       

      captionFN(true, "D901 Diamond Ring \r 3/4 ct. t.w. $1,650", this);
      this.onRollOut = function() {

       

      captionFN(false);

       

      };

       

      };
      captionFN = function (showCaption, captionText, bName) {

       

      if (showCaption) {

       

      _root.createEmptyMovieClip("hoverCaption", this.getNextHighestDepth());
      cap.desc.text = captionText;
      cap._width = 4*cap.desc.text.length;
      cap._alpha = 90;
      //
      if ((bName._width+bName._x+cap._width)>Stage.width) {

       

      xo = -2-cap._width;
      yo = -17;

       

      } else {

       

      xo = 2;
      yo = -17;

       

      }
      hoverCaption.onEnterFrame = function() {

       

      cap._x = _root._xmouse+xo;
      cap._y = _root._ymouse+yo;
      cap._visible = true;

       

      };

       

      } else {

       

      delete hoverCaption.onEnterFrame;
      cap._visible = false;

       

      }

       

      };


        • 1. Re: ActionScript 2.0 and Page Flip Program.
          Ned Murphy Adobe Community Professional & MVP

          If you want your loaded swf files to be able to retain their root references, then you will need to incorporate _lockroot  = true into them so that any _root references in them poiont to the swf _root and not the flip page _root.  Before you bother with that though, you didn't describe what wasn't working, so that should be considered before the _root issue...  If the failure had to do with the inf=dividual swf's not playing correctly within themselves, then the _lockroot route may be the way to go.  But if the failure has to do with the flip book not working, then it is less likely anything to do with your loaded swf's internal coding.

          1 person found this helpful
          • 2. Re: ActionScript 2.0 and Page Flip Program.
            RyanAckley Level 1

            Thank you for the help here.  I'm sorry but I am so new to this and trying to run when I should be taking baby steps.  I am under a deadline to get this done and have not outside help except you nice people.

             

            Your are correct, the proplem is in the script and not the flip page.

             

            So if I am understanding you correctly,

             

            This is what it was:

             

            cap._x = _root._xmouse+xo;
            cap._y = _root._ymouse+yo;
            cap._visible = true;

             

            And this is what it should be?

             

            cap._x = _lockroot  = true._xmouse+xo;
            cap._y = _lockroot  = true._ymouse+yo;
            cap._visible = true;

             

            Is this correct?

            • 3. Re: ActionScript 2.0 and Page Flip Program.
              Ned Murphy Adobe Community Professional & MVP

              Not at all, you just have to use the line

               

              this._lockroot = true;

               

              before any of your code.... one time, by itself.  What led you to imagine using it the way you did?

               

              If you look up the _lockroot property in the Flash help documents it will be explained what it is for and how to use it.  The help documents do that for just about any bit of the language you need to use, so you should learn how to use them and turn to them first.

               

              Regardless of how fast you want to get where you're going, you'll trip every time and get nowhere unless you slow down and do things the right way--and that's not limited to working with Flash.  You cannot be relying on others to solve your problems, especially when you are the one being paid to solve them.  I know that most often when anyone posts here indicating they are on a tight schedule, regardless of how much honey they lay down about how great the folks here are, they are less likely to get help because it's a quick notification to everyone that they'll be doing someone's work for them, and no one is here to do that... quite a few, like myself are freelancers who design things for a living... most are here to help those that show an effort and a desire to learn.

              • 4. Re: ActionScript 2.0 and Page Flip Program.
                RyanAckley Level 1

                I can appreciate where you are coming from and I guess in a sense I was looking  for someone to do the work for me to some  degree.  I am here to learn though and  have a long way to go.  I have only  been at it for a little more than two weeks and I think I have come very far in  a short period of time.  I was asked to do something that I have never done  before by my employer so I am getting paid for  this and I was stuck so that is why  I came here to get some help or an  answer.  I did most of the work on my own and just needed that boost up and over  from the experts.  I guess if like you say people are more inclined not help someone  in a hurry to achieve something quickly I will look else where when in need.  I do very much appreciate all  the help given but if it comes at a price I would rather pay for it.  I just thought that the forums where here to help each  other.  I am considered a Photoshop expert and participate in many of those  forums but have never felt as you do about giving help when needed regardless of  the need.  Thank you again and I do mean  thank you even if my reply sounds differently.

                • 5. Re: ActionScript 2.0 and Page Flip Program.
                  Ned Murphy Adobe Community Professional & MVP

                  Feel free to come back... just try to avoid using your schedule needs as a means of leveraging help--it's not a selling point.  I wouldn't have said anything had you not brought it up in your response.

                  • 6. Re: ActionScript 2.0 and Page Flip Program.
                    RyanAckley Level 1

                    No problem.  Truly, thank you for the help.

                    • 7. Re: ActionScript 2.0 and Page Flip Program.
                      Sreelash Level 1

                      Hi if you could able to implement Page Flip program, can you help me to implement it. I am in search for implementing it.

                       

                      Thank and Regards,

                                              Sreelash