views:

18

answers:

1

Hi guys I am trying to export the button symbol from Flash and publish swc file for Flex. I have successfully export 3 buttons which are playBtn, stopBtn, pauseBtn from flash and add swc file to my flex actionscript files. my code is:

private var stopBt:stopBtn;
  private var playBt:playBtn;
  private var pauseBt:pauseBtn;

private var mutebt:muteBtn // no such datatype.....



error message....
//an internal build error has occurred, right click for more information

Since I add swc from flash in flex, I don't have to import these button...However, when I tried to create 1 more button (muteBtn) in flash and did the same thing again in flex, it gave me "an internal build error has occurred, right click for more information" error.

When I created a var and tried to type :, there are no muteBtn datatype pop up.... I have spent 2 hours on this crazy crap and don't know WTF is going on. Forgive my language...but I am really frustrated....I really appreciate if someone can help me here...Thanks a lot!!!

+1  A: 

The usual way to use SWF files as sources for button skins is to embed them in the stylesheet, like so:

.muteButton {
  up-skin: Embed(source="muteButton.swf",symbol="muteButton_up");
  down-skin: Embed(source="muteButton.swf",symbol="muteButton_down");  
  over-skin: Embed(source="muteButton.swf",symbol="muteButton_over");  
  disabled-skin: Embed(source="muteButton.swf",symbol="muteButton_disabled");  
  /* etc. */
}

The SWF file has to have all the symbols referenced and instances of them must be on the stage (i.e., so that when you double-click muteButton.swf you see all the symbols). Make sure they are all named correctly as well.

Robusto
I am using flex actionscript 3 only to build my projects and according to the O'Relly book, it said add SWC file to the flex project is a good way to do it. I am not saying your way is wrong, but does embed swf increase project size? +1 though
Jerry
When you build your project, all the embedded resources are stored in the SWC. *Any* resources increase the project size, but the kind of things you're talking about – buttons and the like – have a very, very small footprint.
Robusto
IC...Thanks for the tips....:D
Jerry