Quantcast
Channel: Adobe Community: Message List
Viewing all articles
Browse latest Browse all 77806

Re: Changing color of objects based on the color as3

$
0
0

you've abstracted your code so much it's not possible to determine your error.  i can just say that code would cause compiler errors if it were your real code.

 

anyway, use the trace function to debug.

 

and watch out for this:    changeColor.color = e.currentTarget.text;

 

assigning a textfields text property may be problematic even if you use the correct reference to a textfield.  ie, check:

 

trace(e.currentTarget.text);

trace(isNaN(Number(e.currentTarget.text)));

 

 

that aside you might find it easier, if you're dragging and dropping movieclips, to assign a property to each movieclip that indicates its color.  eg:

 

firstRectangle_mc.colorVar=0xff0000;

//etc

 

you can then use the colorVar property of the dropped movieclip to assign a color your droptarget's colorTransform.


Viewing all articles
Browse latest Browse all 77806

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>