Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Scaling a flash movie clip on roll over

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

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
The goal of the tutorial is to teach the user how to select the video input device. Make sure you have an input device that in connected and work and recognized by Adobe Flash Media Live Encoder and select it in the “video input” menu.
This Micro Tutorial will teach to how to utilize bit rate in Adobe Flash Media Live Encoder.
Suggested Courses
Course of the Month11 days, 18 hours left to enroll

916 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