Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Scaling a flash movie clip on roll over

Posted on 2006-06-18
1
Medium Priority
?
706 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 2000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

I come across a lot of question about how to access things in the document class from a movieclip, or accessing something from a movieclip in the document class. It took me a while to figure this out but once I did it makes life so much easier. …
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 how to record live broadcast.
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.
Suggested Courses

660 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