Movie Clip Color Generator

I want to be able to change the colors for the movie clips.

Page 1 of 1

0 Replies - 1287 Views - Last Post: 09 April 2009 - 06:19 PM

#1 DynamoAthletic  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 9
  • Joined: 09-April 09

Movie Clip Color Generator

Posted 09 April 2009 - 06:19 PM

stop();

body_btn.onRelease = function(){
	gotoAndStop("topcolor");
}

panels_btn.onRelease =function(){
	gotoAndStop("middlecolor");
}

innerTrim_btn.onRelease = function(){
	gotoAndStop("innerTrimColor");
}

centerTrim_btn.onRelease = function(){
	gotoAndStop("middleTrimColor");
}

outerTrim_btn.onRelease = function(){
	gotoAndStop("outerTrimColor");
}

import flash.geom.ColorTransform;
var coCT:ColorTransform = new ColorTransform();
columbia_btn.onRelease = function() {
	coCT.rgb = 0x4491ce;
	bodyOsloo_mc.transform.colorTransform =coCT;
	centerTrimOsloo_mc.transform.colorTransform =coCT;
	bodyColor_txt.text = "Columbia";
	centerStripe_txt.text = "Columbia";
};
var blCT:ColorTransform = new ColorTransform();
black_btn.onRelease = function() {
	blCT.rgb = 0x000000;
	bodyOsloo_mc.transform.colorTransform =blCT;
	centerTrimOsloo_mc.transform.colorTransform =blCT;
	bodyColor_txt.text = "Black";
	centerStripe_txt.text = "Black";
};
var naCT:ColorTransform = new ColorTransform();
navy_btn.onRelease = function() {
	naCT.rgb = 0x000066;
	bodyOsloo_mc.transform.colorTransform =naCT;
	centerTrimOsloo_mc.transform.colorTransform =naCT;
	bodyColor_txt.text = "Navy";
	centerStripe_txt.text = "Navy";
};
var roCT:ColorTransform = new ColorTransform();
royal_btn.onRelease = function() {
	roCT.rgb = 0x000099;
	bodyOsloo_mc.transform.colorTransform =roCT;
	centerTrimOsloo_mc.transform.colorTransform =roCT;
	bodyColor_txt.text = "Royal";
	centerStripe_txt.text = "Royal";
};
var dbCT:ColorTransform = new ColorTransform();
brown_btn.onRelease = function() {
	dbCT.rgb = 0x663300;
	bodyOsloo_mc.transform.colorTransform =dbCT;
	centerTrimOsloo_mc.transform.colorTransform =dbCT;
	bodyColor_txt.text = "Brown";
	centerStripe_txt.text = "Brown";
};
var caCT:ColorTransform = new ColorTransform();
cardinal_btn.onRelease = function() {
	caCT.rgb = 0xBA0101;
	bodyOsloo_mc.transform.colorTransform =caCT;
	centerTrimOsloo_mc.transform.colorTransform =caCT;
	bodyColor_txt.text = "Cardinal";
	centerStripe_txt.text = "Cardinal";
};
var goCT:ColorTransform = new ColorTransform();
gold_btn.onRelease = function() {
	goCT.rgb = 0xFFCC00;
	bodyOsloo_mc.transform.colorTransform =goCT;
	centerTrimOsloo_mc.transform.colorTransform =goCT;
	bodyColor_txt.text = "Gold";
	centerStripe_txt.text = "Gold";
};
var vgCT:ColorTransform = new ColorTransform();
vegasGold_btn.onRelease = function() {
	vgCT.rgb = 0xC6C553;
	bodyOsloo_mc.transform.colorTransform =vgCT;
	centerTrimOsloo_mc.transform.colorTransform =vgCT;
	bodyColor_txt.text = "Vegas Gold";
	centerStripe_txt.text = "Vegas Gold";
};
var dgCT:ColorTransform = new ColorTransform();
darkGreen_btn.onRelease = function() {
	dgCT.rgb = 0x255225;
	bodyOsloo_mc.transform.colorTransform =dgCT;
	centerTrimOsloo_mc.transform.colorTransform =dgCT;
	bodyColor_txt.text = "Dark Green";
	centerStripe_txt.text = "Dark Green";
};
var keCT:ColorTransform = new ColorTransform();
kelly_btn.onRelease = function() {
	keCT.rgb = 0x006600;
	bodyOsloo_mc.transform.colorTransform =keCT;
	centerTrimOsloo_mc.transform.colorTransform =keCT;
	bodyColor_txt.text = "Kelly Green";
	centerStripe_txt.text = "Kelly Green";
};
var grCT:ColorTransform = new ColorTransform();
grey_btn.onRelease = function() {
	grCT.rgb = 0xCBCCCC;
	bodyOsloo_mc.transform.colorTransform =grCT;
	centerTrimOsloo_mc.transform.colorTransform =grCT;
	bodyColor_txt.text = "Grey";
	centerStripe_txt.text = "Grey";
};
var maCT:ColorTransform = new ColorTransform();
maroon_btn.onRelease = function() {
	maCT.rgb = 0x760101;
	bodyOsloo_mc.transform.colorTransform =maCT;
	centerTrimOsloo_mc.transform.colorTransform =maCT;
	bodyColor_txt.text = "Maroon";
	centerStripe_txt.text = "Maroon";
};
var boCT:ColorTransform = new ColorTransform();
burntOrange_btn.onRelease = function() {
	boCT.rgb = 0xE44923;
	bodyOsloo_mc.transform.colorTransform =boCT;
	centerTrimOsloo_mc.transform.colorTransform =boCT;
	bodyColor_txt.text = "Burnt Orange";
	centerStripe_txt.text = "Burnt Orange";
};
var toCT:ColorTransform = new ColorTransform();
tennesseeOrange_btn.onRelease = function() {
	toCT.rgb = 0xFF9900;
	bodyOsloo_mc.transform.colorTransform =toCT;
	centerTrimOsloo_mc.transform.colorTransform =toCT;
	bodyColor_txt.text = "Tenn. Orange";
	centerStripe_txt.text = "Tenn. Orange";
};
var puCT:ColorTransform = new ColorTransform();
purple_btn.onRelease = function() {
	puCT.rgb = 0x563192;
	bodyOsloo_mc.transform.colorTransform =puCT;
	centerTrimOsloo_mc.transform.colorTransform =puCT;
	bodyColor_txt.text = "Purple";
	centerStripe_txt.text = "Purple";
};
var scCT:ColorTransform = new ColorTransform();
scarlet_btn.onRelease = function() {
	scCT.rgb = 0xEC0202;
	bodyOsloo_mc.transform.colorTransform =scCT;
	centerTrimOsloo_mc.transform.colorTransform =scCT;
	bodyColor_txt.text = "Scarlet";
	centerStripe_txt.text = "Scarlet";
};
var teCT:ColorTransform = new ColorTransform();
teal_btn.onRelease = function() {
	teCT.rgb = 0x009999;
	bodyOsloo_mc.transform.colorTransform =teCT;
	centerTrimOsloo_mc.transform.colorTransform =teCT;
	bodyColor_txt.text = "Teal";
	centerStripe_txt.text = "Teal";
};
var whCT:ColorTransform = new ColorTransform();
white_btn.onRelease = function() {
	whCT.rgb = 0xFFFFFF;
	bodyOsloo_mc.transform.colorTransform =whCT;
	centerTrimOsloo_mc.transform.colorTransform =whCT;
	bodyColor_txt.text = "White";
	centerStripe_txt.text = "White";
};


Here is my code for one of the frames. The other frames have similar code except it is for a different movie clip. For example, I have one movie clip for the body. One movie clip for the side panels. On two separate frames. Another movie clip for the neck and sleeve trim color on a third frame. I am trying to do a uniform color generator where customers can click on various color buttons and have the colors change for the uniforms with vector flash graphics showing the uniform. It works O.K., as long as I am going forward on the frames time line. Whenever I go back to a previous frame, however, the previous colors that I have clicked are disregarded by the Flash Program and it reverts back to the original colors of the uniform. This is not right and I need to correct this flaw.

Any suggestions from one of the more experienced and more knowledgeable Flash programmers? I am using ActionScript 2.

Thinking (dreaming) about this again last night. I am using the same color buttons for each of the movie clips. The only difference is that the different movie clips are on different frames and the coding for the same color buttons is repeated on all the frames. That might be a problem and looks like it might be why the coding is confused.

This post has been edited by DynamoAthletic: 10 April 2009 - 01:09 PM


Is This A Good Question/Topic? 0
  • +

Page 1 of 1