1
votes

Not sure if this is possible but going to ask: is there a way of being able to resize a symbol (in this case, a movie clip) in an swf file by clicking and dragging it with your cursor?

One of the things I need to do is have a rectangle within my published swf file that can be resized in height and width by clicking and dragging the sides or corner of the rectangle. Not sure at all how to do this, though. Any tutorials I could look at or maybe something that's somewhat easy to do/explain here? Right now from what little I've found on the subject, it seems like a complex thing to do.

Thanks.

2
What exactly have you tried so far?null
why don't you paste some code?harilalkm
null - I've tried Googling solutions, but most of what I've found deals with resizing the entire swf file. I did find a few that seemed to be dealing with what I'm asking about specifically, but the responses were few and they tended to go into some complex code talk and examples that basically left me staring blankly at my screen. harilalkm - I don't have any code to paste because I didn't know where to start (other than looking up solutions on Google like above). @Lodewijck - that actually makes sense to me (which says a lot). I'll give it a try, thanks.dzinermachine

2 Answers

0
votes

There is no standard option for that, so you have to code it yourself. My suggestion:

You could add a small MovieClip, looking like an arrow, right next to your scalable item. Make this arrow horizontally draggable and whenever you drag this arrow, update the width of the scalable item according to the new position of the arrow. In this case you can scale your item horizontally, but you can use the same approach to make it vertically or diagonally scalable.

0
votes

@Lodewijck - Your suggestion worked, thank you!!

This may not be the best way to write the code but it worked:

stop();

import flash.events.MouseEvent;

stage.addEventListener(MouseEvent.MOUSE_MOVE,resize1);
this.addEventListener(MouseEvent.MOUSE_DOWN, startDragging, true);
this.addEventListener(MouseEvent.MOUSE_UP, stopDragging, true);

function startDragging(e:MouseEvent) {

dragsquare.startDrag();

}

function stopDragging(e:MouseEvent) {

dragsquare.stopDrag();

}

function resize1(E:MouseEvent){
square1.width=dragsquare.x - square1.x;
square1.height=dragsquare.y - square1.y;
}