AS3 - Play mc if Scaling of Loader reaches set point

Hi

I have a scale up and down function that increases or decreases the size of an external loaded image inside a loader. What i am now trying to do and having trouble with is playing certain messages when the scaling reaches a certain point.

For instance when the user uses the ‘increaseScale’ function and scales ‘image_Content’ up by 40% its original size then ‘warning_msg.visible = true;’

When they increase it by 65% then ‘stop_msg.visible = true;’

This will then respond the same way if the user decreases the scale back to 40% and so on.

Is this possible to do? I cannot work this one out, i have posted the code below and have attached the fla file…

Many thanks in advance for any help on this

John


//------------------------------------------------------------------------------------
// Messages
//----------------------------------------------------------------------------------- 

warning_msg.visible = false;
stop_msg.visible = false;
//

//------------------------------------------------------------------------------------
// Loader
//------------------------------------------------------------------------------------

var image_Content:Loader = new Loader();
var request:URLRequest = new URLRequest('http://www.tiltworld.co.uk/TH785RFD/image.jpg');
image_Content.load(request);
addChild(image_Content);

image_Content.x=200;
image_Content.y=200;
//

//------------------------------------------------------------------------------------
// Scale
//------------------------------------------------------------------------------------

scaleUp_btn.addEventListener(MouseEvent.MOUSE_DOWN, increaseScale);
scaleDown_btn.addEventListener(MouseEvent.MOUSE_DOWN, decreaseScale);

function increaseScale(event:Event):void {
	image_Content.scaleX=image_Content.scaleX+0.01;
	image_Content.scaleY=image_Content.scaleY+0.01;
}
function decreaseScale(event:Event):void {
	image_Content.scaleX=image_Content.scaleX-0.01;
	image_Content.scaleY=image_Content.scaleY-0.01;
}
//

Got it working now - was me being an idiot really!

Just needed to add the below within the IncreaseScale function:


if(image_Content.scaleX > 1.40)
{
warning_msg.visible = true;
}

I tried this outside of the function originally hence why it never worked but all sorted now