I'm wondering if there are any significant differences between using
`attachMovie()` and `createClassObject()` for creating components (I'm
targeting for Flash 7).  I just ran into a weird issue creating a
ComboBox where I was using `createClassObject()` to instantiate it,
but saw that elsewhere in the code it was using `attachMovie()` to
create one, and both were working.

Specifically, both this:
mc.attachMovie("ComboBox", "myComboBox", mc.getNextHighestDepth());
and this:
mc.createClassObject(ComboBox, "myComboBox", mc.getNextHighestDepth());

seems to give the same results in most cases.  Is there any benefit to
using `createClassObject()` over `attachMovie()` for components?

The one situation I ran into where it gives different results is when
using multiple SWFs from different places.  I have a main movie which
loads another movie that contains all the UI resources (makes branding
easier).  The UI resources movie contains the ComboBox in its library.
If both the movies are on the local filesystem then it works fine,
but if the resources SWF is on a remote web server the
`createClassObject()` call fails.  However, if I change it to use
`attachMovie()` it works fine.  So I'm leaning towards using
`attachMovie()`, just to make my life easier for testing (don't have
to upload the main movie every time I want to test it), but I'm
wondering if that will cause issues later.

  -Andy
_______________________________________________
Flashcoders@chattyfig.figleaf.com
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to