Solved

Pull and Strech a Shape

Posted on 2006-06-13
6
204 Views
Last Modified: 2008-03-06
Hi there - I want to make a simple Flash Movie with a shape on it (say a square) that would allow the cursor to pull and strech and deform the square.  I could have designated strech points (say the corners) that someone could pull to make a corner bigger, slanted, etc. Or however would be the best way to deform the shape :-).  In the furture that shape could become something more complex, but for now a simple shape might be easier to start with.

Thank you :-)  Liz
0
Comment
Question by:maeve100
  • 2
  • 2
6 Comments
 
LVL 19

Expert Comment

by:Montoya
ID: 16896458
are you looking to pull and stretch from the corners and sides, or are you expecting to stretch by the point by which it's pulling?

0
 

Author Comment

by:maeve100
ID: 16898733
By the point its pulling :-)
0
 
LVL 12

Accepted Solution

by:
SamuelRostol earned 500 total points
ID: 17478625
Shouldn't be too difficult in principle

If it's a square;

1. Create four small circles, place them in a square.
2. Name them p1-p4.
3. Read about the moveTo and lineTo function in Flash, and create lines from p1 to p2, p2 to p3, p3 to p4 and p4 to p1 - you now got a square.

4. Then, do something like this:

p1.onClick = function() {
  this.startDrag();

  _root.onEnterFrame = function() {
      redrawSquare();
  }
}
p1.onRelease = function() {
  stopDrag();
  delete _root.onEnterFrame
}

5. Copy these for the other three buttons.

6. Then you create a function,

function redrawSquare() {
    // remove the four lines
    // draw them again with the new coordinates from p1-p4
}

That is the basics, I believe. I'll not give you the whole deal, because then you will not learn something yourself :)

Hope that's allright.

Btw - this will also work with more complex shapes, and if you really get into it, you should be able to do it with curved lines as well :)
0
 
LVL 12

Expert Comment

by:SamuelRostol
ID: 17754631
The answer given by myself is sufficient as an answer to this topics question.

I hope I will get credit for my participations :)

Kindly,
Samuel
0
 

Author Comment

by:maeve100
ID: 17758334
I apoligize, I have been caught up in other things and totally forgot about it.  Thank you for your help :-).
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Adobe Flash Player ActionScript error 6 66
Trying to contour a nose in a face portrait in After Effects 5 103
Adobe Indesign CS6 4 131
HTML 5 video and audio or Flash 1 60
I know the transition can be hard. We got used to the ease of use ActionScript 2 had, but honestly, it became problematic later on, especially if designers were involved in the project and found it easy to add code as they saw fit. So, this artic…
Recently, I was asked to recommend a tracking system to be implemented on a clients website. As the entire site was built on flash, my first thought was to suggest custom built tracking system. However, our company at that point of time didn't h…
In this tutorial viewers will learn how to create a basic shape tween animation in Flash including shape hints for smooth animation Open a new document in Flash: Draw a shape: Select another frame (how long you want the tween to be): Right click and…
The goal of the tutorial is to teach the user how to live broadcast using Flash Media Live Encoder and connecting it to YouTube to broadcast. Log into your Youtube account, choose live stream settings, start live stream from Flash Media Live Enc…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question