View Full Version : buttons, motion and properties

12-06-2001, 03:31 AM
hi there,

So I have a simple problem (I think) and need you all to help!

I have a screen with several buttons on it, one in the center and 10 or so on the periphery.

When the center button is clicked, it triggers a quicktime movie, which I already have working.

However, what I want to have happen is when a peripheral button is clicked, it moves to the center, and a number of new buttons are instantiated based on a database call, etc.

I have all these buttons as diff instances of the same symbol, but the key is that I only want the movie to trigger when the center button is pressed and with a periphery button i want it to move into the center and become the focus button. I want this movement to be elegant and dynamic, and I also want when this move happens to make a php call to a MySQL database?

Can anyone help me out? How do I even start to approach this problem? Any sample code out there that can give me an essence?

thanks a lot!

pls let me know

12-07-2001, 12:31 AM
Yikes, not easy. When ppl ask questions like this I assume they're quite capable to begin with...
The simplest method would probably be to keep a variable which names the instance in the center. Then when a periphery button is clicked, get the _x and _y of the button clicked and the button in the center and use AS based tweening (see the ActionScripted Movement tutorial) to swap the two around. At the same time you need to change the variable which marks the center clip to the name of the new button which is moving in.
Now, calling your PHP script which works on the database is pretty basic. See the loadVariables Interaction tute. You can pass back how many new periphery buttons you want depending on the center button chose and use attachMovie and some sort of algorythm (sin? I forget maths) to duplicate them in a circular path around the center point (whose _x and _y you know)...