Solved

Scaling a flash movie clip on roll over

Posted on 2006-06-18
1
705 Views
Last Modified: 2008-02-01
Hi, I am using the following code to scale a flash movie clip which is working but I wish to scale the movie clip by only 20%.

myMC.onRollOver = function() {
    this._x -= this._width/2;
    this._y -= this._height/2;
    this._xscale = 200;
    this._yscale = 200;
};
myMC.onRollOut = function() {
    this._xscale = 200;
    this._yscale = 200;
    this._x += this._width/2;
    this._y += this._height/2;
};

If I try changing the numbers as below it dose not work.

myMC.onRollOver = function() {
    this._x -= this._width/1.5;
    this._y -= this._height/1.5;
    this._xscale = 150;
    this._yscale = 150;
};
myMC.onRollOut = function() {
    this._xscale = 150;
    this._yscale = 150;
    this._x += this._width/1.5;
    this._y += this._height/1.5;
};

How do I adjust the figures to change the percentage to enlarge the myMc by 20% and return to its original size and possition on mouse over?

Thanks for any help.
0
Comment
Question by:surfjoe
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 34

Accepted Solution

by:
Aneesh Chopra earned 500 total points
ID: 16929120
Hi,

here is the update code to scale movieClip to 120% on rollOver and scaleBack to 100% on rollOut
------------
myMC.onRollOver = function() {
      currentX = this._x;
      currentY = this._y;
      currentWidth = this._width;
      currentHeight = this._height;
      this._xscale = 120;
      this._yscale = 120;
      this._x -= (this._width-currentWidth)/2;
      this._y -= (this._height-currentHeight)/2;
};
myMC.onRollOut = function() {
      this._xscale = 100;
      this._yscale = 100;
      this._x = currentX;
      this._y = currentY;
};
-------------

Rgds
Aneesh
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
This article describes a solution to a problem of subloading one movie into another when they have different SWF versions. Sometime back, I was working on an ActionScript project while I came across an interesting fact which I would like to share…
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses

635 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question