I am creat开发者_如何学运维ing a iOS App in Flash CS5. The initial screen will have a selection of buttons. Once a button is selected, the app should clear the screen of all buttons and text then draw a number of rectangles using some code that pulls data from an XML document.
I guess my overall question is how to use buttons to switch frames and how do I create completely seperate frames to show different context.
Make sure to give you buttons instance names. Then you can use this code to move to any frame on the timeline:
// button is the instance name
button.addEventListener(MouseEvent.CLICK, onButtonClick);
function onButtonClick(evt:MouseEvent):void{
gotoAndStop(10);
}
This would go to frame 10. I recommend you use framelables so that you can say things like :
gotoAndStop("page2");
精彩评论