Bax1
12-18-2004, 03:16 PM
Im using MX2002 and Im trying to have a component's preview change the size of its component on the stage.
Im writing a flash component where you can enter an image's filename in the parameters box and then the component loads and displays that image. Works fine.
So I made a preview for the component. And now the image shows up in the flash editor! However I cant seem to change the bounds that are displayed in the editor to match the image Ive loaded. So the bounds remain at the default 20x20 even if the image is much larger.
The problem with this is then the flash editor has all sorts of cosmetic issues. Ill drag the component around - but it will leave bits of the image behind and not update correctly.
Ive tried updating the Stage.width - but its read-only. Ive tried updating xch._width but that doesnt seem to work.
I would think its impossible to do - except something like the scrollbar component seems to do it. When you drop the scrollbar on a textfield it resizes itself to the same height as the textfield - so I *think* its possible to do what I want.
I know there are examples of how to go the other way - that is the user types in a new width and the preview redraws itself to the new size. But I dont think that helps me - I want the reverse.
thanks for any help on this,
Bax
Im writing a flash component where you can enter an image's filename in the parameters box and then the component loads and displays that image. Works fine.
So I made a preview for the component. And now the image shows up in the flash editor! However I cant seem to change the bounds that are displayed in the editor to match the image Ive loaded. So the bounds remain at the default 20x20 even if the image is much larger.
The problem with this is then the flash editor has all sorts of cosmetic issues. Ill drag the component around - but it will leave bits of the image behind and not update correctly.
Ive tried updating the Stage.width - but its read-only. Ive tried updating xch._width but that doesnt seem to work.
I would think its impossible to do - except something like the scrollbar component seems to do it. When you drop the scrollbar on a textfield it resizes itself to the same height as the textfield - so I *think* its possible to do what I want.
I know there are examples of how to go the other way - that is the user types in a new width and the preview redraws itself to the new size. But I dont think that helps me - I want the reverse.
thanks for any help on this,
Bax