Banner

Sponsor

Login


Welcome Back!
Guest
Guest

Register

Lost your password?

64 users online



AS: always staying a certain distance away?

AS: always staying a certain distance away?

Currently viewing this thread: 1 (0 members and 1 guests)


Page 1 out of 2
jadedchron

jadedchron

Neverside Newbie
Status: Offline!

AS: always staying a certain distance away?

Simply put, I have three rectangle movieclips on a stage. When I click the middle movieclip (2nd) it expands/enlarges. Because of this the left and right (1st and 3rd) movieclips would have to maintain an equal distance/space, so when the middle movieclip expands they slide to the left or right with it.

Granted you can understand that, my question is: how would I do this via actionscript? I've spent about 8 hours trying to figure it out (well, including a few other things), but I've had no luck. I assume it is a condition/loop using the _x, but it doesn't come out right for me. Wink

___________________

Nick
Pixel-Infinity

nykoelle

nykoelle

Crazy Pants
Status: Offline!

http://ericlin2.tripod.com/skew/skewt.html

that may help. Instead of skewing it, just make it get wider.

Hope it helps some

___________________

:: pop ::

jadedchron

jadedchron

Neverside Newbie
Status: Offline!

Thanks for the effort, Meg.

A fellow over at Kirupa has got me started in the right direction.

My only problem now is everything I resize dynamically resizes from the center out. I need it to transform from one corner (if you hold alt + transform a box you'll see what I mean).

Back to work Wink

___________________

Nick
Pixel-Infinity

jadedchron

jadedchron

Neverside Newbie
Status: Offline!

Just in case any one in the future is wondering, I simply need to change the registration point. Roll Eyes

The only thing is I can't do that dynamically - supposedly there is a hack, but I guess I'll just have to do it w/out AS for now.

___________________

Nick
Pixel-Infinity

devonair

devonair

Neverside Newbie
Status: Offline!

hey, jadedchron,

check out the attached..

little trick I learned from Branden Hall in some book.. forgot which.. lol. Oh well, it works..

d.

Attachments:

boxes.zip 4.88 Kb, 27 views

___________________

obod | weapons of mass dysfunction

jadedchron

jadedchron

Neverside Newbie
Status: Offline!

Devon,

Thanks for your response. I couldn't open it for some reason. Is it Flash 5?

Thanks

___________________

Nick
Pixel-Infinity

devonair

devonair

Neverside Newbie
Status: Offline!

MX 2004. Didn't notice if you had specified or not..

___________________

obod | weapons of mass dysfunction

jadedchron

jadedchron

Neverside Newbie
Status: Offline!

Oh, okay. I'll see what I can do to get around that. Thanks

___________________

Nick
Pixel-Infinity

Fofo

Fofo

Status: Offline!

How are you expanding the middle box? And are the boxes put at any specific location or just right next to the middle box?
If you're adding to the value of the middle box's _width, move the left box to the left each time with the value you expanded with, divided by 2. Similarly, move the right box to the right with the value you expanded with divided by 2.

Or more dynamically you could do every frame if you for example wanted to have a space of 20 pixels :
leftbox._x = middlebox._x - (middlebox._width/2) - 20 - (leftbox._width/2)
and
rightbox._x = middlebox._x + (middlebox._width/2) + 20 + (rightbox._width/2)

--

Is that what you were looking for?

___________________

mWòÓh
MSN :aastalker@hotmail.com

jadedchron

jadedchron

Neverside Newbie
Status: Offline!

devonair,

That's almost exactly what I am looking for. PM me your PayPal, if you have one, and I'll try and send you a lil something in the next week or so.

Fofo,

The boxes are expanding and shrinking dynamically (originally they were mc tweens). The boxes are a set width, like 10 or so, from the boxes beside it.

I'll give that code you've provided a try. Thanks a lot!

-----

EDIT:

devonair,

Is this the book you were referring to?

___________________

Nick
Pixel-Infinity

Last edited by jadedchron, November 4th, 2004 04:21 AM (Edited 1 times)

Page 1 out of 2
Quick Jump:

Main Navigation


Site & Graphic Design by Aeon Tan
Developed by Jeremie Pelletier & Scott Roach


NeverAPI generated this page in 0.0078 seconds.