|
|
|||||||||
|
|||||||||
|
|||||||||
| |
|||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I am badly struggling with onClipEvent(data). I am using flash to load an image into it. Because all the images are diferent sizes i have used the code below to resize the image. /* onClipEvent (data) { if(this._width > 410){ w = this._width; setProperty("", _width, 410); setProperty("", _height, this._height - (w - this._width)); } if(this._height > 300){ h = this._height; setProperty("", _height, 300); setProperty('', _width, this._width - (h - this._height)); } } */ onClipEvent (data) { setProperty("", _width, 410); setProperty("", _height, 300); } onClipEvent (enterFrame) { _root.refresh(); } The trouble is, some work and some do not depending on the original prportions of the image. What i would like to do is to be able to set the width of the image but keep the proportions of the original image, without manually setting all the image sizes to these dimensions. Any help out there is greatly appreciated many thanks |
|
#2
|
|||
|
|||
|
Try something like this:
onClipEvent(enterFrame){ while(_root.yourimage._width > theSizeYouWant){ _root.yourimage._xscale -= 1 _root.yourimage._yscale -= 1 } } This will keep your image proportional, and it will be a lot faster with the "while" instead of the "if". |
![]() |
| Viewing: Dev Articles Community Forums > Web Design > Flash Development > onClipEvent (data) image resizing |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|