4 Replies Latest reply on Sep 21, 2006 2:34 AM by routhu

    Dynamic Images Animation problem

    routhu
      Hi All,

      I am new to work on an Action Script wherein I need to display the Images dynamically through XML.

      I am able to display all the Images but we require an Animation same the effect for the images like this link ( http://laco.wz.cz/tween/swf/showswf....ne&w=500&h=500.)

      The animation of the Images should start from center of the Stage something like above link.

      Any help in how to achieve this task will be highly appreciable.

      Thanks & Regards

      Krish
        • 1. Re: Dynamic Images Animation problem
          DazFaz Level 1
          Broken link. Cannot see the example you have given.
          • 2. Re: Dynamic Images Animation problem
            routhu Level 1
            Dear DazFaz,

            Thank you very much for the posting.

            Here is the link of the animation what we have done. http://ourwebstudio.com/flash/test.htm

            The problem with this animation is, the image is starting from a corner of the stage. WE WANT THE IMAGE ANIMATION TO BE STARTED FROM THE CENTER OF THE STAGE AND IMAGE SHOULD ZOOM-Out AS IT IS DOING NOW.

            Also please can you help us in making the animation to be reverse when the mouse cursor is on top of the page. I.e, when you place the cursor on the top of the stage, the animation should be in reverse i.e., Zoom-In animation.

            Please help us how to achieve these tasks.

            Thanks for your time.
            • 3. Re: Dynamic Images Animation problem
              DazFaz Level 1
              //copy and paste the following to the very first frame

              MovieClip.prototype.Opening = function (qBoxLocation) {
              this.onRollOver = function () {
              this.locked = true;
              if (this.hitTest (_root._xmouse, _root._ymouse, true) && this.locked) {
              this.locked = false;
              this.xscale = 400;
              this.yscale = 400;
              this.friction = .65;// if you dont want any bounce then make this 0
              this.ratio = .4;
              //this.speed = 1.25;
              this.speedXscale = 0;
              this.speedYscale = 0;
              this.onEnterFrame = function () {
              this.markerX = _xscale;
              this.markerY = this._y;
              this.speedXscale = Number (this.speedXscale * this.friction) + Number ((this.xscale - this._xscale) * this.ratio);
              this.speedYscale = Number (this.speedYscale * this.friction) + Number ((this.yscale - this._yscale) * this.ratio);
              this._xscale = Number (this._xscale) + Number (this.speedXscale);
              this._yscale = Number (this._yscale) + Number (this.speedYscale);
              this._x = (this._x == Stage.width / 2) ? Stage.width / 2 : this._x + (Math.floor ((Stage.width / 2) - this._x) / this.speed);
              this._y = (this._y == Math.floor ((Stage.height / 2) + this.qBoxLocation)) ? Math.floor ((Stage.height / 2) - this.qBoxLocation) : Math.floor (this._y + (Math.floor ((Math.floor (Stage.height / 2) + qBoxLocation) - this._y) / speed));
              if (Math.round (this._xscale) == Math.round (this.markerX)) {
              if (Math.round (this._xscale) == Math.round (this.markerX)) {
              this.onEnterFrame = Void;
              }
              }
              updateAfterEvent ();
              };
              }
              };
              this.onRollOut = function () {
              this.locked = true
              if (this.locked) {
              this.locked = false;
              this.xscale = 100;// Finishing scale size when you roll out
              this.yscale = 100;
              this.friction = .65;// if you dont want any bounce then make this 0
              this.ratio = .4;
              //this.speed = 1.25;
              this.speedXscale = 1;
              this.speedYscale = 1;
              this.onEnterFrame = function () {
              this.markerX = _xscale;
              this.speedXscale = Number (this.speedXscale * this.friction) - Number ((this.xscale - this._xscale) * this.ratio);
              this.speedYscale = Number (this.speedYscale * this.friction) - Number ((this.yscale - this._yscale) * this.ratio);
              this._xscale = Number (this._xscale) - Number (this.speedXscale);
              this._yscale = Number (this._yscale) - Number (this.speedYscale);
              this._x = (this._x == Stage.width / 2) ? Stage.width / 2 : this._x + (Math.floor ((Stage.width / 2) - this._x) / this.speed);
              this._y = (this._y == Math.floor ((Stage.height / 2) + this.qBoxLocation)) ? Math.floor ((Stage.height / 2) - this.qBoxLocation) : Math.floor (this._y + (Math.floor ((Math.floor (Stage.height / 2) + qBoxLocation) - this._y) / speed));
              if (Math.round (this._xscale) == Math.round (this.xscale)) {
              if (Math.round (this._xscale) == Math.round (this.xscale)) {
              this.onEnterFrame = Void;
              }
              }
              updateAfterEvent ();
              };
              }
              };
              };
              myMovieClipNameThatIWantToTiggerTheZoomOnHere.Opening ();

              //Because we are using prototypes here every moveclip that you create will have this function automaticaly built into it.

              //I hope this helps.

              //Cheers
              • 4. Re: Dynamic Images Animation problem
                routhu Level 1
                DazFaz,

                Thanks for the code. It is working. But the animation should strart while loading and should starting from center of the movie clip.

                Your code is working but the animation is starting from a corner.

                Is it possible to have the image zooming start from center of the image? ( Like fade in and fade out effects?).

                Thanks

                routhu