Flasher Archive
[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]
Subject: | Re: FLASH: Help: dynamically using xscale |
From: | Sergio Santos |
Date: | Sun, 17 Sep 2000 19:17:46 +0100 |
I don't know if anyone will post some tested code, but i'll shoot this ideia
anyway. :-)
You can use a while statement, like:
---
xpos=256;
ypos=256;
act_y=GetProperty("/mc",_y) + 1;
act_x=GetProperty("/mc",_x) + 1;
while (act_x != xpos) { // Just an example
SetProperty("/mc",_x)=act_x;
SetProperty("/mc",_y)=act_y;
act_x++;
act_y++;
}
---
For this to work flawlessly you'd need first another routine to check if
final x and y are greater than the inicial, so that you increase the value
or decrease it.
An if statement could be used to check if either act_y and act_x have
reached their final value, so that they stop being incremented.
You can increment them one at a time, but then you wouldn't have diagonal
movement.
Another thing... This could be so fast that it wouldn't be noticed... Maybe
a time delay function is needed.
The theory is the same for x_scale, y_scale, etc...
If you use this a lot, the best is to create a function (Flash5).
I wrote this from memory in a few seconds, I have not previously done code
to do this. Anyway I think that I managed to pass the "idea". :-)
If you need, contact me that i'll do a more "foul proof" code.
Sergio
----- Original Message -----
From: "Swain Troy" <redmiasmahotmail [dot] com>
To: <flasherchinwag [dot] com>
Sent: Saturday, September 16, 2000 3:11 AM
Subject: FLASH: Help: dynamically using xscale
> I have several boxes saved as movie clips.
>
> Each has a seperate instance name.
>
> When the user clicks certain buttons, all of the MCs are supposed to
> reorganize themselves (dynamically setting the x and y position) and
change
> scale (using xscale and yscale).
>
> What I can't figure out is how to have it grow from, say, 100 x 100 to 256
x
> 34 in a smooth manner.
>
> The MC could start out from any of five different sizes. I want it to grow
> from whatever it's current size is until it is, for example, 256 x 34
> pixels.
>
> I want smooth movement - similar to Praystation/Kioken's Barney's site
> (which moves the MC "section" to a new x position; it starts out moving
fast
> and then slows down until it reaches the x position of "marker" and
stops).
> Here's their code (it's public domain):
>
> Set Variable: "marker" = GetProperty ( "/marker", _x )
> Set Variable: "sections" = GetProperty("/sections",_x)
> Set Variable: "difference" = marker - sections
> Set Variable: "move" = difference / 5
> Set Property ("/sections", X Position) = sections + move
>
> Argh... I wish I paid attention in my math classes.
>
> troyswainfunkyafro [dot] com
> www.funkyafro.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NudeGuru.com is proud to sponsor the Flasher list
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
IT'S THE ART OF MONEY, HONEY!
Tips and Advice from some of the most popular Flash
artists + industry power-brokers on how to hold onto
your rights, negotiate contracts and get full value
for your work.http://www.nudeguru.com from Franke James
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpchinwag [dot] com
Replies
FLASH: Help: dynamically using xscale, Swain Troy
[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]