Changing coordinates

  • eoran
  • Novice
  • Novice
  • No Avatar
  • Joined: Jun 27, 2006
  • Posts: 25
  • Loc: Mexico City
  • Status: Offline

Post June 27th, 2006, 4:56 pm

I have a movieclip with instance name 'consola'. When I click on a button with instance name 'nosotros', 'consola' moves to the left and lets another window open in the place it was before.

This is how I do it:

Code: [ Select ]
_root.consola.nosotros_btn.onRelease = function() {
    _root.consola.onEnterFrame = function() {
        if (this._x > 165) {
            this._x -= 20;
            } else {
                delete this.onEnterFrame;
            }
    };
}
  1. _root.consola.nosotros_btn.onRelease = function() {
  2.     _root.consola.onEnterFrame = function() {
  3.         if (this._x > 165) {
  4.             this._x -= 20;
  5.             } else {
  6.                 delete this.onEnterFrame;
  7.             }
  8.     };
  9. }


I would like to make 'consola' return to its original place when clicking on another button (instance name 'cerrar'), but I can't manage to do it changing this script.

I'd appreciate any help you can give me. Thanks!

this is the site: http://www.ilustra.com.mx/indexalterno.html Click on 'Quiénes somos' to see what I'm talking about
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 27th, 2006, 4:56 pm

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Joined: Nov 05, 2004
  • Posts: 1254
  • Loc: Ro
  • Status: Offline

Post June 28th, 2006, 1:05 am

Code: [ Select ]
function RepositionConsola() {
  _root.consola.onEnterFrame = function() {
   if (this._x < 365) {
     this._x += 20;
     } else {
      delete this.onEnterFrame;
     }
  };
}

// not sure if the button is inside 'consola' movie
_root.consola.cerrar_btn.onRelease = function()
{
  RepositionConsola();
}
  1. function RepositionConsola() {
  2.   _root.consola.onEnterFrame = function() {
  3.    if (this._x < 365) {
  4.      this._x += 20;
  5.      } else {
  6.       delete this.onEnterFrame;
  7.      }
  8.   };
  9. }
  10. // not sure if the button is inside 'consola' movie
  11. _root.consola.cerrar_btn.onRelease = function()
  12. {
  13.   RepositionConsola();
  14. }
“True mastery transcede any particular art. It stems from mastery of oneself - the ability, developed throgh self-discipline, to be calm, fully aware, and complety in tune with oneself and the surroundings. Then, and only then, can a person know himself. ”
  • eoran
  • Novice
  • Novice
  • No Avatar
  • Joined: Jun 27, 2006
  • Posts: 25
  • Loc: Mexico City
  • Status: Offline

Post June 28th, 2006, 2:05 pm

It worked! Thanks a lot!

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 34 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.