Disable Image Resizing | userstyles.org:: Oct 29, 2006 Although you can disable automatic image resizing in Firefox 2.0, you can't disable the resize toggle. This style breaks Image Zoom* on http://userstyles.org/styles/1224HOME | Hi
I've set a movieClip to resize using ActionScript. But I'm not sure how to stop the resizing once it has met a certain size. In my situation, I want it to stop resizing when both the height and width have met 500px's.
movieClip.onEnterFrame = function(){
movieClip._width = movieClip._width+=2;
movieClip._height = movieClip._height+=2;
}
}
Try this:
var limit:Number = 500; [Animtk-devs] animtk: Added automatic resize on init; add skeleton :: [Animtk-devs] animtk: Added automatic resize on init; add skeleton for button . . label); + osgWidget::Widget* stop = createButton("stop", "stop.png", http://www.mail-archive.com/animtk-devs@gna.org/msg00022.htmlHOME | Re: How do I stop Word from automatically Resizing my other open docum:: Re: How do I stop Word from automatically Resizing my other open docum Re: How do I stop Word from automatically Resizing my other open document http://www.archivum.info/microsoft.public.mac.office.word/2008-03/msg01012.htmlHOME |
movieClip.onEnterFrame = function():Void {
if(this._width >= limit) {
delete this.onEnterFrame;
}
this._width +=2;
this._height +=2;
}
(-:
You could also use the tween class, like this:
Apple - Support - Discussions - iPhoto has been automatically :: iPhoto has been automatically resizing my photos and I want it to stop! Posted: Jun 19, 2008 12:03 AM. Any help would be much appreciated. http://discussions.apple.com/message.jspa?messageID=7406848HOME |
import mx.transitions.Tween;
function tweenIt(target_mc:MovieClip, h:Number, w:Number, time:Number):Void {
var h_tween:Tween = new Tween(target_mc, "_height", mx.transitions.easing.Regular.easeIn, target_mc._height, h, time, true);
var w_tween:Tween = new Tween(target_mc, "_width", mx.transitions.easing.Regular.easeIn, target_mc._width, w, time, true); Disabling Automatic Image Resizing:: 5 posts - Last post: Feb 24, 2008Talk about Disabling Automatic Image Resizing. to disable the automatic resizing so can I somehow do something for my page http://www.velocityreviews.com/forums/t593811-disabling-automatic-image-resizing.htmlHOME |
}
tweenIt(movieClip, 500, 500, 2);
oooo, I'm spoiled for choice now. I quite like the idea of it easing, so I think I may use the tween class one.
Thanks guys for the quick solutions, I'll most likely use them again and again. :beer:
Mark
_global.maxWidth = 500; //px
_global.maxHeight = 500; //px
movieClip.onEnterFrame = function()
{
this._width = ((this._width+2)<_global.maxWidth?this._width+2:_global.maxWidth);
this._height=((this._height+2)<_global.maxHeight?this._height+2:_global.maxHeight );
if ((this._width==_global.maxWidth) && (this._height== _global.maxHeight))
{
delete this.onEnterFrame;
};
}
This would protect the width/height from never exceeding the maximum limits, and the onEnterFrame no longer needs to run when both parameters are met. You might want to put this into its own function so that it gets called when a resize-situation arises (and it will remove itself when the resize is complete).
You could also change the +2 thing so that it uses _global, and could just as well accept a negative number, changing the direction in which the whole thing works (grow, shrink).
Nortel Unveils Vision, Strategy for Israeli High-Performance Net
Busy Friday Leads to Strong Close for Net Stocks
|