Knox Grammar School І TAS Department
Knox TAS Department
Flash CS4 – Basic ActionScript 3.0 Codes Contents of Button Functions Go to a Web Page Create a custom mouse cursor Move an object with keyboard arrows Go to a Frame and Stop Go to a Frame and Play Drag and Drop an object Play and Stop a sound Introduction The codes below must only be inserted in the frames for which they are relevant. This can be done by creating a new layer and using keyframes at the beginning and end to indicate the frames between which the code needs to appear. In order to use the code, simply copy and paste the text within the boxes only. Note: Where the term; button_1 appears, the text must be replaced with the instance name of the button to which the code is being applied.
Where numbers appear in brackets, such as; (5), the number must be replaced with the desired frame number.
Click to Go to Web Page Clicking on the specified symbol instance loads the URL in a new browser window. Instructions: 1. Replace http://www.adobe.com with the desired URL address. Keep the quotation marks (""). button_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToWebPage); function fl_ClickToGoToWebPage(event:MouseEvent):void { navigateToURL(new URLRequest("http://www.adobe.com"), "_blank"); }