8 Replies Latest reply on Jul 7, 2008 4:23 PM by kglad

    How do you force instances with the same name on the same layer to update?

    Cine-Med Level 1
      Maybe someone can tell me why flash doesn’t redraw components’ x,y positions if they have the same instance name and are on adjacent frames? (movieclips work fine, just not components) If I have a button on frame 1 and a button on frame 2 both with the same instance name but different locations on the stage, frame 2’s button doesn’t show up in the position I placed it, it stays at the position of frame 1 but still has the properties of frame 2’s button. The label changes and everything. If I stick a button on a frame in between and give it a different instance name there is no problem. I thought it might be the style manager bug http://www.gskinner.com/blog/archives/2007/12/cs3_component_b.html but it didn’t seem to affect. This happens for textareas too and probably all components although I haven’t tried them. I’ve tried using drawNow() and validateNow() with no luck either http://www.adobe.com/devnet/flash/articles/creating_as3_components_pt3_05.html

      Thank you!

      // put this on frame 1 along with a button on the stage with instance name: b
      function doit(event) {
      if (currentFrame == 1)
      b.addEventListener(MouseEvent.CLICK, doit);

      // put another button on frame 2 along with this code and also make it’s instance name: b but move it so it’s not in the same x,y coordinates as the button on frame 1

      Something possibly related. I have a movieclip on a layer, one instance with name “a” on frame 1 and one instance with name “a” on frame 2 and it has event listeners inside it that update something on the movieclip. Unless I put the movieclips on separate layers the event listeners won’t reset each frame. (example: a button with a tooltip onmouseover that you want to change the text of from frame 1 to frame 2) You’d think if they were on separate keyframes at least but no, they need to be on separate layers too.

      I want the movieclip to update each frame. Any ideas?