Reputation: 133
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);
// ...
}
// ...
}
}
Upvotes: 0
Views: 1001
Reputation: 133
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()
);
Upvotes: 0
Reputation: 124
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);
// ...
}
// ...
Upvotes: 0