Forum Topic: Changing Things with Buttons

(206 views • 9 replies)

This topic is 1 page long.

<< < > >>
Questioning

Toxic-AKA-Bob-Barker

Reply To Post Reply & Quote

Posted at: 11/30/05 10:12 PM

Toxic-AKA-Bob-Barker LIGHT LEVEL 03

Sign-Up: 09/17/01

Posts: 8

I'm trying to make it so that I can have a bunch of objects moving around of the same thing, and when you click one of them the rest will all change as well. For example, let's say the screen had a bunch of moving squares, and when you click on one all the squares turn into traingles.

My problem though is that I can make an object change and I can make any other copies of the object that have not apeared on the screen to change as well, but the images that are already on the screen won't change.

For a better understanding here is a flash of what is happenning:
Flash example

And here is the .FLA file as well (Using Flash 6):
Shapes.fla File

Hopefully someone can help me out.


None

Blaze

Reply To Post Reply & Quote

Posted at: 11/30/05 10:15 PM

Blaze LIGHT LEVEL 22

Sign-Up: 08/04/05

Posts: 6,957

well, you can easily make it like this.

Make an MC. Inside it, have the first frame be a square. in say.. .frame 20, or something, change it to a triangle. And shape tween it. Then, in the first frame, and the last, add these code. stop();

Then, go back to the main timeline. And add this code to the MC.

on(press){
_root.instancename.play();
}


None

Neashir

Reply To Post Reply & Quote

Posted at: 11/30/05 10:15 PM

Neashir NEUTRAL LEVEL 18

Sign-Up: 08/08/05

Posts: 1,405

you might make them all buttons, and put a different shape on each keyframe in the button's timeline, and add this AS on each button...

on(release){
this.nextFrame();
}

hope that helps ya :D


None

Blaze

Reply To Post Reply & Quote

Posted at: 11/30/05 10:18 PM

Blaze LIGHT LEVEL 22

Sign-Up: 08/04/05

Posts: 6,957

At 11/30/05 10:15 PM, Neashir wrote: hope that helps ya :D

That would make them change to drastically. Id rather use MC's for this.


None

Neashir

Reply To Post Reply & Quote

Posted at: 11/30/05 10:22 PM

Neashir NEUTRAL LEVEL 18

Sign-Up: 08/08/05

Posts: 1,405

At 11/30/05 10:18 PM, Darkfire_Blaze wrote:
At 11/30/05 10:15 PM, Neashir wrote: hope that helps ya :D
That would make them change to drastically. Id rather use MC's for this.

to drastically? whuteva, maybe he wants it to change right away, and shape tweens get to messy sometimes :P


None

Blaze

Reply To Post Reply & Quote

Posted at: 11/30/05 10:24 PM

Blaze LIGHT LEVEL 22

Sign-Up: 08/04/05

Posts: 6,957

At 11/30/05 10:22 PM, Neashir wrote: to drastically? whuteva, maybe he wants it to change right away, and shape tweens get to messy sometimes :P

True... but... oh screw it.

Shape tween would be the way to go, otherwise it would change to drastically, but meh, i dont know.


None

Neashir

Reply To Post Reply & Quote

Posted at: 11/30/05 10:26 PM

Neashir NEUTRAL LEVEL 18

Sign-Up: 08/08/05

Posts: 1,405

At 11/30/05 10:24 PM, Darkfire_Blaze wrote: True... but... oh screw it.

Shape tween would be the way to go, otherwise it would change to drastically, but meh, i dont know.

but what about the example? it changes drastically :D

i'm just going to stop posting, this is getting nowhere :P

None

Toxic-AKA-Bob-Barker

Reply To Post Reply & Quote

Posted at: 11/30/05 10:31 PM

Toxic-AKA-Bob-Barker LIGHT LEVEL 03

Sign-Up: 09/17/01

Posts: 8

I just want an instant change, I don't care right now about any transitions. Anways I tried both methods and neither of them seemed to work. The objects wouldn't change at all, but I may have done this incorrectly. I can make objects change, but my problem is making sure that they all change regardless of which one is hit.


None

Blaze

Reply To Post Reply & Quote

Posted at: 11/30/05 10:33 PM

Blaze LIGHT LEVEL 22

Sign-Up: 08/04/05

Posts: 6,957

At 11/30/05 10:31 PM, Toxic_AKA_Bob_Barker wrote: I just want an instant change, I don't care right now about any transitions. Anways I tried both methods and neither of them seemed to work. The objects wouldn't change at all, but I may have done this incorrectly. I can make objects change, but my problem is making sure that they all change regardless of which one is hit.

Use the code you already have. But, it seems that those are all different symbols... or ... can you show me the code?

even though i think i just reached post limit. add me on MSN or AIM.

None

Toxic-AKA-Bob-Barker

Reply To Post Reply & Quote

Posted at: 11/30/05 10:40 PM

Toxic-AKA-Bob-Barker LIGHT LEVEL 03

Sign-Up: 09/17/01

Posts: 8

Okay. In the main time line there is a code that says _root.lefthead=1, this refers to the frame at which the movie clip is going to be at and gives it an inital value (it's called lefthead because this orginally was going to involve heads). Right now the shapes are in a movie clip. Each frame of the clip has a different shape. Each shape is button. In the very first frame of the movie clip there is the code:

gotoAndStop(_root.lefthead);

Then in each button on the frame there is the code:

on (release) {
_root.lefthead = 2; (or whatever the next frame number will be)
gotoAndStop(_root.lefthead);
}

But as you can see, this chaneg only affects the shape that you clciked on and any news shapes that pop up.


All times are Eastern Standard Time (GMT -5) | Current Time: 12:09 PM

<< Back

This topic is 1 page long.

<< < > >>
You need a Grounds Gold Account to post on the NG BBS! If you don't have one, click here to sign up now! It's fast, free, and easy — and opens up tons of great NG features!