Game Development Reference
mouse events, so it will function in the same manner when being
run on a desktop machine.
public class Title extends Sprite
public var btnPlay:SimpleButton;
public var btnRules:SimpleButton;
public function Title()
onAddedToStage, false, 0, true);
private function onAddedToStage( _evt:Event ):void
onPlayClick, false, 0, true);
onRulesClick, false, 0, true);
private function onPlayClick( _evt:MouseEvent ):void
private function onRulesClick( _evt:MouseEvent ):void
This class is a little more involved. If you refer to the XFL docu-
ment and open the Rules clip from the library, you
ll see that there
are two screens of instructions, but only one is visible on stage.
The other is off to the right, but they are both contained in a single
display object called clipRulesText .We
ll use a combination of ges-
tures and TweenNano (the superlight version of TweenLite) to
simulate the popular swiping effect used in many iOS and Android
applications. There are other ways to have organized this content,
but for the sake of this example, this was the most straightforward.