Friday, May 07, 2004

Updated
There isn't a lot of help on the usage of UIObject.destroyObject which led me to believe it would be as simple as creating an object. The component dictionary has the following usage:

componentInstance.destroyObject(instanceName)


Simple...except I couldn't seem to get this working. So here was my problem, I had created a ComboBox inside a movieClip using the following AS:

step3.createClassObject(ComboBox, "products_cb", 5);


In order to remove the ComboBox you have to target the component as you would normally but make sure you put the instanceName in quotes otherwise it will not work:

step3.destroyObject("products_cb");


Maybe this is glaringly obvious to most people but it had me scratching my head for a while.

UPDATE: Yes just realised I originally wrote 'parenthesis' instead of 'quotes' I have now rectified the mistake...well I did say destroyObject for dummies!

Jon 9:24 AM Permalink

Comments:

Post a Comment