Flash Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsWeb DesignFlash Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old January 8th, 2005, 04:17 PM
conscious conscious is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2005
Posts: 1 conscious User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Cool onClipEvent (data) image resizing

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

Reply With Quote
  #2  
Old January 1st, 2007, 03:16 PM
Degoncire Degoncire is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jan 2007
Posts: 4 Degoncire User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 41 m 44 sec
Reputation Power: 0
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".

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsWeb DesignFlash Development > onClipEvent (data) image resizing


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT