pdu
pdu

Reputation: 10413

Solution to skew bitmaps in flash

I'm looking for a solution to skew images. Flash only allows skewing of vector-based objects. I tried to use matrices but could not get a propriate solution. The goal is to do something like a threefold-brochure which folds out in two steps.

Does someone have a hint or example code for this?


UPDATE!

Maybe my message was a little bit wrong verbalised. Flash allows to skew, for example, a rectangle to a rhomboid.

 -------         -------
|       |        \      \
|       |   =>    \      \
|       |          \      \
 -------            -------

That's not the restriction i meant. I'm able to do WYSIWYG skewing like this for vectors and bitmaps. I need to do something like this:

 -------         |`
|       |        |  `|
|       |   =>   |   |
|       |        |  ´
 -------         |´

Based on Bryan Grezeszak answer, i played with transformation movieclips on the linked page. Am i right when i say that there is no possibility to do this with matrices? If yes, are there other possibilities to achieve this?

Thanks =)

Upvotes: 4

Views: 7958

Answers (4)

starpause
starpause

Reputation: 761

fp9 solution: http://www.rubenswieringa.com/blog/distortimage

Upvotes: 1

nobull
nobull

Reputation:

pity the year doesnt appear on the date... hope it 2009

an answer is here http://evolve.reintroducing.com/2007/11/18/as3/as3-distortiontweener/

;-) nobull

Upvotes: 2

Iain
Iain

Reputation: 9442

You can skew any movieclip on the timeline of the Flash IDE, even one containing bitmap images, but there is no skew property. For something more dynamic you can create a movieclip with 200(e.g.) frames of animation going from one extreme of skew to the other, then dynamically add content to this movieclip. Hacky, but it will work. If you can get to grips with the math you can use matrix transformations in Flash Player 10 to achieve the effect.

Upvotes: -1

Bryan Grezeszak
Bryan Grezeszak

Reputation: 959

EDIT BASED ON YOUR UPDATE: The transformation you specified that you want is exactly what is accomplished with Matrix3D in flash 10. They changed it from a 3x3 matrix to a 4x4 matrix to allow the skewing you are trying to do. If you are using flash 10, Matrix3D is your answer. If not, try out AS3 3D engines such as Papervision or Away3D.

If you are using Flash 10, then look up it's Matrix3D object (ONLY in Flash 10), because it allows even more skewing of the object, actual 3D perspective, etc, prolly exactly what you are looking for :)

Other than that the object's transformation matrix is what does it. It is a flash.geom.Matrix object that can be accessed on any DisplayObject (including Bitmaps) using your_object.transform.matrix;

It can be tricky to get used to, but this is the most comprehensive source I know of for dealing with it: Senocular Matrix Article

That article is for Flash 8, but the functionality has changed almost none into AS3, so it is still a valuable resource.

Upvotes: 6

Related Questions