|
| |||||||||
| Tags: image, landscape, photo, picture, portrait, resize image, xml |
![]() |
| | Thread Tools | Search this Thread |
|
#1
| |||
| |||
| Automatically resize images from an XML
I want to display images in an empty clip via loadMovie. Until that no worries. Buttons allow me to scroll through the images that are called via an xml file. Now I want to resize images automatically (which are all different sizes), either with a width of 70% of the scene if the image is Landscape or with a height of 70% of the scene if the image is portrait. And this, keeping the ratio H/L of origin! Here is my view function: Code: function display (variable) (
unload (myClipContainer);
loadMovie (myURLImages [variable] myClipContainer);
charger.onEnterFrame = function () (
if ((myClipContainer.getBytesLoaded () == myClipContainer.getBytesTotal ()) & & (myClipContainer.getBytesTotal ()> 0)) (
delete this.onEnterFrame;
width = myClipContainer._width;
height = myClipContainer._height;
ratio = width / height;
if (width> height) (
myClipContainer._width = Stage.width *. 7;
myClipContainer._height = myClipContainer._width / report;
Else ()
myClipContainer._height = Stage.height *. 7;
myClipContainer._width = myClipContainer._height / report;
};
};
};
}; |
|
#2
| ||||
| ||||
| Re: Automatically resize images from an XML
This is normal, you have beautiful "unloader" myClipContainer, it does not remove the property provided it therefore retains its size. Rather than "unload", you can try "delete". |
|
#3
| |||
| |||
| Re: Automatically resize images from an XML
Actually, I think you have clearly identified my concern! but: the result is the same with delete trace (myClipContainer._width) returns me the size of the old myClipContainer, even if put 1 line in the delete, the delete does not seem to remove either the properties What I do not understand is that even trace placed 1st in line if that verifies the completion of loading refers me also the size of the old myClipContainer. Oh I found! In fact myClipContainer must be established "dynamically via createEmptyMovieClip AS (" myClipContainer ", 0); (I had created in the flash library) So, no need to delete or even to unload the holderClip takes the dimensions of the image loaded each time and I have done my resizing operations. |
|
#4
| ||||
| ||||
| Re: Automatically resize images from an XML
Yes, that's what I could tell you, but I thought that delete would solve the thing. Shame on AS2 which by its on-tolerance does not help to understand the problem. The AS3 has a very different philosophy ... You could just out of curiosity try this script: in addition to unload, crush myClipContainer redefining a new MovieClip ... Code: function view(Variable) {
myClipContainer = new MovieClip();
myClipContainer.loadMovie(myURLImages[Variable]);
charger.onEnterFrame = function() {
if ((myClipContainer.getBytesLoaded() == myClipContainer.getBytesTotal()) && (myClipContainer.getBytesTotal()>0)) {
delete this.onEnterFrame;
width = myClipContainer._width;
height = myClipContainer._height;
ratio = width / height;
if (width> height) {
myClipContainer._width = Stage.width*.7;
myClipContainer._height = myClipContainer._width/ report;
} else {
myClipContainer._height = Stage.height*.7;
myClipContainer._width = myClipContainer._height/ report;
};
};
};
}; |
|
#5
| |||
| |||
| Re: Automatically resize images from an XML
(important info: I'm not a big shot in AS, I opened Flash for the first time in my life 15 days ago) Basically what you are asking me to try do not work. There is no image loaded. I have this error: Target not found: Target = "undefined" Base = "_level0" In fact, in my old AS (which works) I "createEmptyMovieClip ("myClipContainer", 0);" which is IN the function then recreated each time. |
![]() |
|
| Thread Tools | Search this Thread |
| |
Similar Threads for: "Automatically resize images from an XML" | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Auto resize images while importing in Microsoft Excel | SirName | Windows Software | 3 | 3 Weeks Ago 01:01 PM |
| How to automatically resize the embedded vlc player | FunnyBHUSAN | Windows Software | 4 | 19-04-2011 11:46 AM |
| resize images with outlook express | Abshir | Windows Software | 3 | 16-06-2009 12:08 AM |
| How to rename/resize images in Linux ? | Eleazar | Operating Systems | 3 | 17-03-2009 03:28 PM |
| Resize images using Powertoy in Windows XP | AmdUser | Windows Software | 3 | 07-02-2009 07:09 PM |