Changing coordinates

  • eoran
  • Novice
  • Novice
  • eoran
  • Posts: 25
  • Loc: Mexico City

Post 3+ Months Ago

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
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • IceCold
  • Guru
  • Guru
  • User avatar
  • Posts: 1254
  • Loc: Ro

Post 3+ Months Ago

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. }
  • eoran
  • Novice
  • Novice
  • eoran
  • Posts: 25
  • Loc: Mexico City

Post 3+ Months Ago

It worked! Thanks a lot!

Post Information

  • Total Posts in this topic: 3 posts
  • Users browsing this forum: No registered users and 13 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.