32488

Movieclip color is not working properly? [duplicate]

Question:

This question is an exact duplicate of:

<ul><li> <a href="/questions/8242838/how-to-maintain-a-movieclips-color-between-frames" dir="ltr" rel="nofollow">How to maintain a movieclip's color between frames?</a> <span class="question-originals-answer-count"> 2 answers </span> </li> </ul>

I have 2 frames and in frame 1 the target MC color is being changed to RED. After that i go to frame 2. If i came back to frame 1 the MC doesn't retain the RED color. What i do wrong. Please see the pictures. <a href="http://www.picz.ro/index.php?id=ec122060763b0fd744d2499882d4ae1f" rel="nofollow">http://www.picz.ro/index.php?id=ec122060763b0fd744d2499882d4ae1f</a> and <a href="http://www.picz.ro/index.php?id=00e207dfad35e7e414ed3236a1f79448" rel="nofollow">http://www.picz.ro/index.php?id=00e207dfad35e7e414ed3236a1f79448</a>

Answer1:

eliminating frames, you can do it with code like this:

import flash.geom.ColorTransform; import flash.events.MouseEvent; var newColorTransform:ColorTransform; var myMCTable:Array = [myMC1,myMC2,myMC3,myMC4,myMC5]; for (var i:int = 0; i < myMCTable.length; i++) { myMCTable[i].doubleClickEnabled = true; myMCTable[i].addEventListener(MouseEvent.DOUBLE_CLICK, changeColor); } function changeColor(e:MouseEvent):void { newColorTransform = (e.target).transform.colorTransform; newColorTransform.color = 0xFF0000; (e.target).transform.colorTransform = newColorTransform; } prevNextBtn.txt.mouseEnabled = false; prevNextBtn.addEventListener(MouseEvent.CLICK, prevNext); function prevNext(e:MouseEvent):void { var i:int; if (e.target.txt.text == "next") { e.target.txt.text = "prev"; for (i = 0; i < myMCTable.length; i++) { myMCTable[i].visible = false; } } else { e.target.txt.text = "next"; for (i = 0; i < myMCTable.length; i++) { myMCTable[i].visible = true; } } }

all that you need to change besides the code, is now you have just one button with a text field in it called "txt" and the label just changes

Recommend

  • Zend Framework bassed projects
  • Generic/Unknown HTTP Error with response code 0 using UnityWebRequest
  • Cannot page through all results using nextPageToken on YouTube search API v3
  • what is the purpose of “export as namespace foo”?
  • Ionic Slide Up Slide Down Animation for only one view in sidebar
  • removing last 3 characters on a file (file extension)
  • Separate ID and Class for JS and CSS
  • back button function for phonegap windows phone 7
  • Feature detection of foreignObject in SVG
  • XSD with multi occurrences unordered
  • Varnish/Apache Random 503 Errors
  • node.js POST request fails
  • matlab crashes without dump file when using fopen for file
  • c++ regex_replace not doing intended substitution
  • HttpURLConnection.getOutputStream() takes 20 seconds. Why?
  • How to convert SOAP response with xsi values to json in WSO2esb
  • jwtBearer bearer token with rc-1 update to ASP.Net 5
  • Apache RewriteRule redirection with url encoded
  • Jetty 9 HashLoginService
  • Python urlparse: small issue
  • PostgreSQL Query without WHERE only ORDER BY and LIMIT doesn't use index
  • Read a local file using javascript
  • Get data from AJAX - How to
  • ImageMagick, replace semi-transparent white with opaque white
  • Syntax for setting draggablecursor property in google maps api
  • Seeking advice on Jetty HttpClient Hang
  • does jqgrid support a multiple checkbox list for editing
  • FB SDK and cURL: Unknown SSL protocol error in connection to graph.facebook.com:443
  • Optimizing database types to compact database (SQLite)
  • Cross-Platform Protobuf Serialization
  • Can I have the cursor start on a particular column by default in jqgrid's edit mode?
  • Upload files with Ajax and Jquery
  • jquery mobile loadPage not working
  • Do I've to free mysql result after storing it?
  • A cron job substitute?
  • How to delete a row from a dynamic generate table using jquery?
  • json Serialization in asp
  • Rails 2: use form_for to build a form covering multiple objects of the same class
  • How to stop GridView from loading again when I press back button?
  • Turn off referential integrity in Derby? is it possible?