I am developing an as3 swc-based component that populates its contents entirely through actionscript in the constructor (e.g. sprite.graphics.lineTo...). When I drag the component onto the stage, it is empty. If I export my movie, everything works perfectly, but I also need the live preview to work. I could get around this with a placeholder graphic, but I would much rather leave it purely as code. Is there any way to get around this? Thanks, David.
A:
I think I known what you're talking about.
In the Library, where you have your component defined, right-click and export that item to a .swf. This will compile all the code and everything into a swf, for that symbol.
Right click again on the item and go to the Components Definition, set the Live Preview file to the .swf that you just exported.
After you do this, you should be able to see what the item will actually look like in the preview mode.
I just did this like 2 days ago, going from memory let me know if it doesn't work.
Kekoa
2009-05-02 18:57:34
That still didn't work. I right-clicked the component and selected Export Flash Movie. I then went to Component Definition, Live Preview, and selected the swf. I tried setting it to Live Preview in External File as well as Live Preview with .swf File Embedded in .fla File. When I exported the swc, neither option worked. I was still left with no preview. Am I maybe missing a step?
David
2009-05-02 20:18:15
Are you using CS3 or CS4? I'm using CS4-- maybe it's different. I noticed that if I had _any_ compiler errors, the .swf wasn't exported properly. I'm not using an swc, but my component is linked to my AS class for that component. I suppose the swc should work just as well, but I don't know.
Kekoa
2009-05-05 22:06:08