Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

make a button change the color of another object 3

Status
Not open for further replies.

gdevo

ISP
Mar 12, 2001
10
US
It's been years since I worked with Flash 3, so please forgive me. Flash 5 seems less intuitive.
I have poured over books and online help and forums for an answer to this simple problem.
Let me tell you what I have done. I have a button symbol saved as a button, and a simple box symbol saved as a movie. I have given the box an instance name of "box". The box is on it's own layer for 15 frames it does not change at all. The button is also on its own layer and I have used the following action script in an effort to modify the box.
I've tried placing the symbols on the same layer and on different layers with keyframes in the same frame. I've altered the code, but this seems to make most sense to me

on (release) {
color = new Color(box);
color.setRGB( 0xff0000);
}

here is a URL that demonstrates what I'll want to do when I figure this out.


except I'll want to have each color activate a sub menu, and the sub menu will change the colors of my diagram.

Any help would be greatly appreciated.

thanks, Gary
 
Thanks for your input but I still haven't figured out what I'm doing wrong. The tutorial didn't cover a couple of things I'd like to know. Should the background box and the buttons be on the same layer? dose that matter at all? Also should the button have keyframes in all or any of the 4 states? I'm very frustrated now. Are there reserved words for action scripting that should'nt be used as variables?

I have found that after I ad the script I must click somewhere wrong 'cuz it disapears and then the action script menus become inactive. Then the only way I can reinsert the script is to have all of the objects on the layer selected. What's up with that? Is there a bug or some (hopfully common) error I'm making?

Thanks again Gary
 
If you download my .fla and look at it, a lot of your questions will be answered. That's exactly why I made it available!

As for editing actions, right-top side arrow on the actions window >... Select Expert mode, you'll be able to edit to your heart's content!

;-)
 
Thank you, Thank you, Thank you!!!
after cuting and pasting your code into my file I realized the normal mode of action script editor placed quotes around my code

on (release) {
boxcolor = "new Color(colorshift)";
boxcolor.setRGB( 0xff0000 );
}
I must've hade somthing else wrong yesterday.

Thanks again, Gary
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top