3

I converted some images to movieclips in animate cc, images are text exported to .png and they are different in width same in height. Both are in library and stage but in different position and in same Frame, I need to swap/replace each other in different cases with code.

I used blow code for this purpose but nothing happened.

Code:

var mc:MovieClip = new MovieClip();
addChild(MC_TEXT21);
mc.x =642;
mc.x =495;
trace("mc:   "+mc);
trace("MC_TEXT21:   "+MC_TEXT21);
trace(mc.stage);
trace(mc.root);

Console:

mc:   [object MovieClip]
MC_TEXT21:   [object MovieClip]
null
null
A.M
  • 345
  • 4
  • 13
  • This is unclear. Please explain more clearly what you want to achieve. What do you mean by swap/replace. With each other? With new ones from a file? Explain. – Neal Davis Feb 08 '17 at 08:48
  • By the way. Why are you asking the same question again after you already accepted an answer to this question 11 hours ago? What was unsatisfactory about that one? – Neal Davis Feb 08 '17 at 08:50
  • That question was about Bitmaps, Not MovieClips. – A.M Feb 08 '17 at 08:51

1 Answers1

2
  1. Right click on symbols in Library and choose Properties
  2. In Symbol Properties select "Export for ActionScripts" and "Export in frame 1"
  3. Hit OK (if a warning show, again hit OK)

Use blow code for Add/Remove MovieClips:

var mc:MC_TEXT21 = new MC_TEXT21();
mc.x =642;
mc.y =495;

addChild(mc);    // This code add Object to Stage
removeChild(mc); // This code remove Object from Stage
Ali Kazemi
  • 505
  • 7
  • 19