Skip to main content
July 3, 2008
Question

resize handler for components

  • July 3, 2008
  • 4 replies
  • 613 views
can anybody tell me if there is any resize handler component in flash9. i want to resize button component. if no such handler are available. can you help me to make my own resize handler.
This topic has been closed for replies.

4 replies

July 6, 2008
i would rather prefer the secon way, to pass the object to a resizer class that would resize it and return the resized object.
my project is for a company who would change the interface for their customers as and when required. i have already designedother designing tasks and they are switched by a button ie switching between edit and normal mode. i just now want is to pass my objects as arguments and get the resized using handelers. thanks for showing interest. hope you will guide me out.
July 4, 2008
i m sorry if i was not clear. all i want to do is to resize my button and label component on the stage. i can do it by adding a dialog box and reading the width and height from the user . but i want it in a drag n drop fashion. the number of components may increase upto 20. now can you guide me.
Inspiring
July 4, 2008
I see two way to resize. I don't know how your are going to handle buttons label text though.

Here is one more question: what is the purpose of this? Is it some sort of a content publishing system? Why do they need to resize the buttons? I am not questioning the idea - I need to understand the use case. Also, after they resize - will these parameters persist throughout the session only (the life of swf) of they are going to be published and applied in the future use of the application (in new sessions)?

One way would be for your buttons to extend the button component class and in this extended class to enable handles. In other words, with this model each button will have an inherent ability to display handles. I am not sure if this is the best approach but, again, I don't know what is the end result.

The other way could be to make a special class, say, Resizer. An object that has to be resized will be passed to this class and Resizer will create the handles around target object. Now all the manipulations of handles will be passed through Resizer into the target object through it's native interfaces.

No matter the approach, the first thing to decide is how and when Flash must apply the handles. Is it going to happen every time they click on the objects or the application will have some sort of an editing mode in which the handles will be applied - otherwise (in a normal mode) - no handles? Again, it depends on what you are trying to accomplish as the end result.

Perhaps, you need a button that will toggle the modes - edit vs normal.

As for the handles themselves - obviously there are at least two common elements there - corner/midline handles (squares or circles) and lines connecting them.

I would make squares a separate class/component that draws these squares and make them interactive - meaning they will react on mouse click and drag. The lines connecting them will be drawn dynamically (and redrawn as user interacts with the handles). All drawings will utilize Flash drawing API.

So, how do you need to approach it?
July 3, 2008
yes i mean some thing like photoshop.
can you help me how to start it. i dontHave idea at all
Inspiring
July 3, 2008
I can see at least three ways how to approach it off the top of my head.

I hope you understand that 80% of the success is planning. I am not going to give a lecture on that but I cannot do much unless you, at least, outline your vision. If you look closer into the resize box of photoshop it does much more than an eye can catch at the first glance.

Also a lot depends on the context of the application. For instance, how many objects are potentially going to be resized? Are there few of them of unlimited number? What are these objects? Are they drawings that user does or they are images, or preexisting objects?

The list may go on an on.

It will be helpful for you and anyone who is willing to chip in to elaborate your tasks.
Inspiring
July 3, 2008
I don't think there is such a component. You need to draw it yourself (say, on mouse click) and then write a code that accomplishes what you need to do.

Are you talking about resize handler similar to one in photoshop, illustrator, etc.?