The Enchanted Cave 2
Delve into a strange cave with a seemingly endless supply of treasure, strategically choos
4.36 / 5.00 33,851 ViewsGhostbusters B.I.P.
COMPLETE edition of the interactive "choose next panel" comic
4.09 / 5.00 12,195 Viewsim working on a project that i will require to switch between two colors to do it within the time i am given. is there a key or some method that i can use to switch between two colors?
It's not clear what you are trying to do. Explain the situation better please.
You can solve pretty much any problem you may have with AS3 by consulting the AS3 Language reference.
You could add a new layer and put two shapes filled with the colors you need on it (just off the stage). Then use keyboard shortcuts to switch between tools... like the bucket and the eyedropper. When you're done, delete the layer with the swatches.
Or you can select one color for the stroke and the other for the fill ...then click 'swap colors' to toggle between them ...as far as I know there's not a shortcut for that.
"Why do you hide, stupid aliens? Mr. Zurkon only wishes for to kill you."
If you're talking about tinting objects on runtime, you gotta look into color transform. Imma help you kick start with a portion of my color manipulating library. Other than this you got to know how to use timer event since you want it to be something that gets executed by time, or maybe u can just use a variable to substitute as a timer.
yourObj.transform.colorTransform = interpolateColor(new ColorTransform(), 0xFF0000, 0.5);
// tints your object to red by 50%
function interpolateColor(start:ColorTransform, col:uint, perc:Number):ColorTransform
{
var end:ColorTransform = new ColorTransform();
end.color = col;
var result:ColorTransform = new ColorTransform();
result.redMultiplier = start.redMultiplier + (end.redMultiplier - start.redMultiplier) * perc;
result.greenMultiplier = start.greenMultiplier + (end.greenMultiplier - start.greenMultiplier) * perc;
result.blueMultiplier = start.blueMultiplier + (end.blueMultiplier - start.blueMultiplier) * perc;
result.alphaMultiplier = start.alphaMultiplier + (end.alphaMultiplier - start.alphaMultiplier) * perc;
result.redOffset = start.redOffset + (end.redOffset - start.redOffset) * perc;
result.greenOffset = start.greenOffset + (end.greenOffset - start.greenOffset) * perc;
result.blueOffset = start.blueOffset + (end.blueOffset - start.blueOffset) * perc;
result.alphaOffset = start.alphaOffset + (end.alphaOffset - start.alphaOffset) * perc;
return result;
} sorry about not explaining the situation well enough, though i got the answer i needed. thanks guys!
At 11/8/11 08:14 AM, keeth33 wrote: sorry about not explaining the situation well enough, though i got the answer i needed. thanks guys!
Glad you got it sorted! Care to share the answer? ...in case someone else has a similar situation. Thanks :)
"Why do you hide, stupid aliens? Mr. Zurkon only wishes for to kill you."