Welcome to Dream.In.Code
Getting Help is Easy!

Join 132,676 Programmers for FREE! Get instant access to thousands of experts, tutorials, code snippets, and more! There are 1,196 people online right now. Registration is fast and FREE... Join Now!




Flash Design Studio

 
Reply to this topicStart new topic

Flash Design Studio, Flash dynamic Design Studio

zenthil
post 19 Sep, 2008 - 10:49 PM
Post #1


New D.I.C Head

*
Joined: 19 Sep, 2008
Posts: 1

Hi All,
I am working on developing a design studio which is fully dynamic. The purpose of the design studio is to load the images dynamically from the server, also the user can browse the image from his local hard drive and the enlarged image should be displayed in the stage.

I am stuck up in the resizing area. I need to resize the dynamic loaded images proportionately, where the handlers should be shown.

it need to be like the design studio like. www.lupalook.com, www.scrapblog.com.

I dont want to you to sit and write a code for me. Just i need a general idea how to do that, and any examples or tutorials. That would be very very helpful for me.

Thanks in advance....
User is offlineProfile CardPM

Go to the top of the page

pemcconnell
post 23 Sep, 2008 - 08:30 AM
Post #2


D.I.C Regular

Group Icon
Joined: 5 Aug, 2008
Posts: 394



Thanked 35 times

Dream Kudos: 75
My Contributions


when the image is loaded into your movieclip initially the correct proportions are there for you to grab.

w = movieclipname._width;
h = movieclipname._height;

p = w / h;

then on an onenterframe just multiply the height by p as you're resizing to get the width in accordance to the height, and set the movieclips width to it.

hope that helps smile.gif

This post has been edited by pemcconnell: 23 Sep, 2008 - 08:31 AM
User is offlineProfile CardPM

Go to the top of the page

DilutedImage
post 24 Sep, 2008 - 07:31 PM
Post #3


D.I.C Addict

Group Icon
Joined: 20 Nov, 2006
Posts: 642



Thanked 6 times

Dream Kudos: 25
My Contributions


The above code will set your width based on height. If you're looking to contain the image within a given area though, then you'll need to ensure that both the width and height are within limits. Here's how:

CODE
var sizeMultiplier = MAX_WIDTH / newImage._width;
if((newImage._height * sizeMultiplier) > MAX_HEIGHT) { sizeMultiplier = TH_HEIGHT / newImage._height };
newImage._width *= sizeMultiplier;
newImage._height *= sizeMultiplier;


This is AS2. If you're building this in AS3, then you'll need to delete the underscores from the width and height properties.

Optionally, you could just use a Loader (AS2) or UILoader (AS3) component, and set the scaleContent property to true.

User is offlineProfile CardPM

Go to the top of the page

Fast ReplyReply to this topicStart new topic
Time is now: 11/23/08 06:29AM

Live Help!

Tutorials

Programming

Web Development

Reference Sheets

Code Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month