duncant
07-13-2005, 03:43 PM
I have been writing a few functions, and can not seem to get it working correctly.
var rotationSpeed = 3.8;
var ScaleLarge = 101;
var ScaleSmall = 25;
var HoverSize = 35;
var Speed = 5;
with(mc1)
{
_xscale = 25;
_yscale = 25;
_rotation = random(90);
}
/************************************************** ************************
FUNCTION OpenWindow
************************************************** ************************/
MovieClip.prototype.OpenWindow = function()
{
this.onEnterFrame = function()
{
this._xscale += Math.floor((ScaleLarge - this._xscale))/Speed;
this._yscale += Math.floor((ScaleLarge - this._yscale))/Speed;
trace(this._xscale);
this._rotation += Math.floor((0 - this._rotation))/rotationSpeed;
if(this._xscale >= ScaleLarge - 1)
{
trace("HITTTTTT");
delete this.onEnterFrame;
this.mcHit.enabled = false;
}
}
}
/************************************************** **********************
FUNCTION CloseWindow
************************************************** **********************/
MovieClip.prototype.CloseWindow = function()
{
this.onEnterFrame = function()
{
this._xscale += Math.floor((ScaleSmall - this._xscale))/Speed;
this._yscale += Math.floor((ScaleSmall - this._yscale))/Speed;
trace(this._xscale);
this._rotation += Math.floor((random(90) - this._rotation))/rotationSpeed;
if(this._xscale <= ScaleSmall)
{
delete this.onEnterFrame;
this.mcHit.enabled = true;
}
}
}
/************************************************** ************************/
mc1.onPress = function()
{
this.OpenWindow();
trace("Movieclip " +this+ " has been pressed");
}
mc1.mcClose.onPress = function()
{
mc1.CloseWindow();
}
I can't seem to get this mcHit enabled function to go to false.
I have attached a dummy file, if anyone would like to have a crack at it?
Thanks
var rotationSpeed = 3.8;
var ScaleLarge = 101;
var ScaleSmall = 25;
var HoverSize = 35;
var Speed = 5;
with(mc1)
{
_xscale = 25;
_yscale = 25;
_rotation = random(90);
}
/************************************************** ************************
FUNCTION OpenWindow
************************************************** ************************/
MovieClip.prototype.OpenWindow = function()
{
this.onEnterFrame = function()
{
this._xscale += Math.floor((ScaleLarge - this._xscale))/Speed;
this._yscale += Math.floor((ScaleLarge - this._yscale))/Speed;
trace(this._xscale);
this._rotation += Math.floor((0 - this._rotation))/rotationSpeed;
if(this._xscale >= ScaleLarge - 1)
{
trace("HITTTTTT");
delete this.onEnterFrame;
this.mcHit.enabled = false;
}
}
}
/************************************************** **********************
FUNCTION CloseWindow
************************************************** **********************/
MovieClip.prototype.CloseWindow = function()
{
this.onEnterFrame = function()
{
this._xscale += Math.floor((ScaleSmall - this._xscale))/Speed;
this._yscale += Math.floor((ScaleSmall - this._yscale))/Speed;
trace(this._xscale);
this._rotation += Math.floor((random(90) - this._rotation))/rotationSpeed;
if(this._xscale <= ScaleSmall)
{
delete this.onEnterFrame;
this.mcHit.enabled = true;
}
}
}
/************************************************** ************************/
mc1.onPress = function()
{
this.OpenWindow();
trace("Movieclip " +this+ " has been pressed");
}
mc1.mcClose.onPress = function()
{
mc1.CloseWindow();
}
I can't seem to get this mcHit enabled function to go to false.
I have attached a dummy file, if anyone would like to have a crack at it?
Thanks