1 Reply Latest reply on Apr 22, 2006 5:49 PM by alecmce

    Complete Component Confusion

    alecmce Level 1
      Hi, I'm coding in AS2, writing a component (external SWC) in external .as files extending from MovieClip (no, not from UIObject or UIComponent)

      My component works as expected when I run the FLA that I am using to design it. When I compile the SWC it behaves as expected in the design-time in the FLA into which I import it. However, when I run the second FLA it does not work. The component loads in a certain number of other elements at run-time and positions them around the screen. The computer reports that this is going ahead in the third scenario, but no objects appear. I have put a trace at the top of every function. In all three scenarios exactly the same functions are called in exactly the same order.

      Needless to say, I am beginning to wish I'd never started it... I have spent more time trying to solve this problem than I did writing the component in the first place (no exaggeration).
        • 1. Re: Complete Component Confusion
          alecmce Level 1

          I think I've found the problem, which is of course what happens when you post a thread... but the solution is so unsatisfactory that I would still require someone's assistance.

          If I copy the objects that I am attaching into the component into the library of the second FLA then the component works. But this is absurd; the movieclips that I am trying to attach using attachMovie must already be compiled into the component SWC in order for live-preview to work. If I have to duplicate these movieclips into the second FLA, then the compiled SWF will duplicate a host of movieclips unnecessarily? Is there anyway of fooling attachMovie to look into the SWC root rather than the SWF root? I really don't want to muck around with a duplicateMovieClip workaround, though this currently looks like the only viable solution.

          Eh bien, another triumph of wierd Flash behaviour.