473,748 Members | 2,540 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Change image size at runtime in flash

2 New Member
I am developing photo gallery in Macromedia Flash 8 and XML to retrive the Image. Image Size is all in different size. my question is How to Change image size at runtime in flash? so that image display one by one automatically with correct resized image please help thanks in advances
Feb 27 '08 #1
7 19315
nomad
664 Recognized Expert Contributor
I am developing photo gallery in Macromedia Flash 8 and XML to retrive the Image. Image Size is all in different size. my question is How to Change image size at runtime in flash? so that image display one by one automatically with correct resized image please help thanks in advances

Just a word of advice:
Always bring your images into Flash at the actual size (pixel dimensions) you intend to use them at. Anytime you scale an image on the Flash Stage, it will be resampled and interpolated. Photoshop if you have it does a much better job than Flash when it comes to resampling. The only exception to this rule is when you are animating the scale of an image. Of course, in that scenario, it is always best to bring the image in from Photoshop at its largest size in the desired animation.

nomad
Feb 27 '08 #2
Rabboni
3 New Member
to change the image size

first u convert that images into movieclip and then set the height and width of that movieclip
at runtime
Feb 29 '08 #3
kadarkarai
2 New Member
to change the image size

first u convert that images into movieclip and then set the height and width of that movieclip
at runtime

Thanks Robboni
thats my question how to resize at runtime? i dont know the logic of that one
Mar 20 '08 #4
rupihj
1 New Member
if(canvas._widt h/canvas._height> target_mc._widt h/target_mc._heig ht)

i stole this code from "photoreel. fla" i can remember where in the Web it is





here is the full code for the image resize

if(canvas._widt h/canvas._height> target_mc._widt h/target_mc._heig ht)
{
//set the image height to the canvas' height
target_mc._heig ht=canvas._heig ht;
//scale the width according to the height, to fit into the canvas dimensions
target_mc._xsca le=target_mc._y scale;
//move the image to the center of the canvas
target_mc._x=(c anvas._width-target_mc._widt h)/2;
}else{
//canvas is higher or equal to the proportions of the image
//set the width to the canvas' width
target_mc._widt h=canvas._width ;
//fit the height into the canvas
target_mc._ysca le=target_mc._x scale;
//move the image into the center vertically
target_mc._y=(c anvas._height-target_mc._heig ht)/2;
}
Jun 25 '08 #5
geek4geek
2 New Member
My problem is different. I have the fixed size movie clip and images are of different size. I want the image to be auto fix in that movie clip size. Support my movie clip is 200x200 and the image is 300x300, then I want this image to be completely visible but in 200x200 only. Currently the image is getting cut and cant see the complete image if its large. Please help
Oct 26 '08 #6
joedeene
583 Contributor
My problem is different. I have the fixed size movie clip and images are of different size. I want the image to be auto fix in that movie clip size. Support my movie clip is 200x200 and the image is 300x300, then I want this image to be completely visible but in 200x200 only. Currently the image is getting cut and cant see the complete image if its large. Please help
The only way a flash file size(the whole thing) is if you change the size under the properties, so why not edit the image size while editing the flash file size at the same time, to see what it looks like before publishing. And I don't think you can resize just plain bitmaps(images) . I think it needs to be converted to a MovieClip

joedeene
Oct 26 '08 #7
geek4geek
2 New Member
The only way a flash file size(the whole thing) is if you change the size under the properties, so why not edit the image size while editing the flash file size at the same time, to see what it looks like before publishing. And I don't think you can resize just plain bitmaps(images) . I think it needs to be converted to a MovieClip

joedeene
Thanks joedeene. But I have been googling the whole day and got frustrated with the fact that everybody is talking on forums about resizing the MovieClip and that is what I am able to do. But nobody is talking about -- "Making the image itself to fit in the moviw clip". I have tried all possible combinations (like resizing he loader.content, creating BitmapData and resizing it etc). I am able to resize the movie clip but not the image to fit completely with in the movie clip size.
I am sure this may be too trivial but being a newbie in flash/AS3, its looks impossible to be at this point and I urgently need it to finish my college project. Any sample code will be great!

TIA
Oct 27 '08 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

7
4474
by: Haines Brown | last post by:
I'm in the practice of specifying img width and height in my style definitions, although I usually use the actual size of the image. I'm reworking the style and it would be convenient to leave image size unspecified unless I need to change its dispayed size. What, if any, are the reasons why an image size should be specified in a stylesheet if it will be displayed in its actual size? -- Haines Brown
0
2928
by: EarthlingZ | last post by:
Anyone with any good ide or simpel script? How to chance size on a pic that is uploaded? I would be happy if its pretty easy so I understand what kind of code I am using :$
2
8535
by: Sanjeeva Reddy | last post by:
hai Anti Keskinen, i have used the following code MyListView->LargeImageList->ImageSize = gcnew System::Drawing::Size(100, 100); // Sets large image size to 100, 100 here i am getting error like "gcnew is undeclared error",how to deeclare 'gcnew" and when i am using in runtime to change the size of images in imagelist in listview control in .net(forms application) by chnging one trckbar(like tb1->Value),
11
2024
by: KarimL | last post by:
Thanks for your advices... but i need to get the Image height because i dynamically resize the height of my webcontrol based on the image height. More i just have the url (relative parth) to the the image but in design time mode all variables concerning Server or Context ar not set ! ...so I can't use MapPath function to obtain the physical parth of the picture ... So my second question is how to retrieve the physical root path of the...
0
1800
by: Gavin | last post by:
Can anybody give me a code example of how to change an image size and resolution. I can upload a image file to a PostedFile. But what I need to do is change the size of that image and save it to my web server in a jpg format. I also would like to save the jpg format in different resolutions. I have looked on the internet and haven't been able to find any code examples can you help.
2
1676
by: miladhatam | last post by:
i've made a dynamic website that upload an image file in image directory with fileuploader control and it's name was renamed and get ready to show with image control but i have a problem i want to change the size of image and decrease it's size and i have another question how can i show an image file in an image control with maintaining the aspect ratio of that i don't wanna the image control stretch the image
8
2345
by: miladhatam | last post by:
can i change the size of a file dynamically ? for example have 100 Kb and i want to decrease it to 20 Kb thanks
5
3761
by: johnric | last post by:
I can't seem to get firefox to read the image size in my javascript. It will work in IE and firefox but firefox will not read the image size. Can anyone see the problem in my code? I am new to programming and not very good at it yet.: <HTML> <HEAD> <script language="JavaScript"> //-- Generate a random number between 0 and max. function randomNum(max) { var rNum=NaN while (isNaN(rNum)) { rNum=Math.floor(Math.random()*(max))
2
7666
by: Tark Siala | last post by:
hi i'm wprking with C# 2005 + SP1, and i want load image from image file, and then resize it (like from 800X600 Pixel to 640X480 Pixel), and then save it in another image file, i want do that for resize many images to publish it on the internet, the picture box can load image and resize it on the screen, but can't save it with new dimension. can you help me? ----------- Tarek M. Siala
0
9381
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9332
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8252
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6799
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4608
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4879
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3316
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2791
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2217
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.