Skip to main content
Participating Frequently
July 9, 2006
Question

conversion from v5 to v8 ?? any help ?? very simple

  • July 9, 2006
  • 3 replies
  • 283 views
hi everyone

I have found I code that I need to use it on my website. Unfortunately this script is version 5 and if I export the movie as v5 then every thing is ok. if I export ti as flash v8 the script dosen't work. can anyone tell me how should be changed to work ??

/// the flash can contain one frame only with this code

Movieclip.prototype.elasticScale = function(target, accel, convert) {
xScale = xScale * accel + (target - this._xscale) * convert
yScale = yScale * accel + (target - this._yscale) * convert
this._xscale += xScale
this._yscale += yScale
}

// end --->

// this code is atached to an movieclip named as you whant

onClipEvent (enterFrame) {
if (this.hitTest(_root._xmouse,_root._ymouse,true)) {
elasticScale(150, 0.9, 0.1)
} else {
elasticScale(100, 0.9, 0.1)
}
}

//


thank you very much !
This topic has been closed for replies.

3 replies

Craig Grummitt
Inspiring
July 10, 2006
sorry i've read and reread your last response and i'm struggling to understand what you are saying/asking...

to begin with, are you having problems with your original code still, or are you commenting on a problem you've encountered with the Tween class?
costinAuthor
Participating Frequently
July 10, 2006
is an problem there. is animate the whole movieclips.
if you have more than one movieclips the code animate them all. even there are separate names.
Craig Grummitt
Inspiring
July 10, 2006
interesting code there.
Two small things you'll need to do to convert it - Flash is now much more case sensitive so referring to Movieclip won't work - capitalise the c to make MovieClip.
Flash is less forgiving if you do something like refer to a variable before initialising it. Initialise the variables xScale and yScale:
xScale=0;
yScale=0;
and your code should work...

By the way if you are using Flash 8, you can do what you've tried to achieve here using inbuilt Flash classes. Take a look at the Tween class, with Elastic easing on scale.