Question

I exported a SWC from Flash CS3 and the assets works, except the Buttons, they look like another library items.

The code:

package {
    // ...
    import flash.display.Sprite;
    import flash.display.SimpleButton;
    import res.botoes.Pause;
    // ...

    public class Cena extends Sprite {
        // ...
        private var botao:SimpleButton;
        // ...

        public function Cena() {
            // ...
            botao = new Pause() as SimpleButton;
            addChild(botao);
            // ...
        }
        // ...
    }
}
Was it helpful?

Solution 2

Solved.

My new solution: Make a MovieClip for each state of the buttons, then construct the buttons this way:

var pause:SimpleButton = new SimpleButton(
        new PauseU().
        new PauseO(),
        new PauseD(),
        new Mascara()
    );

OTHER TIPS

try this;
first create SimpleButton and Pause instance, Then cast Pause to SimpleButton,sure about the syntax, otherwise check your custom classes

// ...
         private var _pause:Pause();
         private var botao:SimpleButton;
// ...
         public function Cena() {
            // ...
            _pause = new Pause();
            _botao = new SimpleButton();
            botao = _pause as SimpleButton;
            addChild(botao);
            // ...
         }
// ...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top