Solved

Scaling a flash movie clip on roll over

Posted on 2006-06-18
1
692 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 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Flash builder 4.13 list scroller does not work 1 45
Adobe Products Forum? 3 158
You Tube Videos not playing 9 128
Create animated movies for web page 18 85
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…
I have been doing hardcore actionscripting for some time; and needless to say I have faced a lot of problems in just understanding others' code rather than understanding what the code executes. A programmer's life can become hell when there are a lo…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…
The goal of the tutorial is to teach the user how to set there setting in Adobe Flash Media Live Encoder and YouTube for optimal video and audio quality.

837 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