Flash Courses
Resources:
- Adobe Online Forums for Flash – The Flash forum is your best bet to first search for your question and then ask it. No matter how dumb you think it is, you will get help. The Actionscript forums also are good if you plan to learn AS. You might choose the Flash forum for basic Actionscript questions as well but newbie questions are handled in the pure Actionscript forums.
- Adobe TV CS5 Video Tutorials
- Flash Help and Support at Adobe – This is a good place to find articles and help.
Materials:
- Gas.wmv – Sample Windows Media Video (wmv) file for practice encoding into Flash FLV.
- Button_Click_Actionscript_Template.as – Button_Click_Actionscript_Templates.as – Flash file for Flash Actionscript 3 Button Clicks and Basic Actionscript actions such as stop(),play() gotoAndStop(), gotoAndPlay(), prevFrame(), nextFrame() on the timeline containing the button and for a timeline of a MovieClip attached to same timeline as button. Download and copy or see also the code for copy below:
Replicate this Actionscript for each button. The Actionscript and button must reside on the same frame but on different layers.
// Replace buttonInstanceName with instance name of your button - three places buttonInstanceName.addEventListener(MouseEvent.CLICK, buttonInstanceName_onMouseClick); function buttonInstanceName_onMouseClick(e:MouseEvent):void { // Testing // trace ("Hello from buttonInstanceName"); // Actions controlling the timeline that also contains the button: // play(); // stop(); // gotoAndPlay(___); // where ___ = frame number // gotoAndStop(___); // where ___ = frame number // prevFrame(); // nextFrame(); // Actions to open another web page: // var request:URLRequest = new URLRequest("url"); // where url is a link http://www.somedomain.com/ // navigateToURL(request, '_blank'); // second argument is target and is optional to open in same page // Actions controlling a MovieClip on the timeline that also contains the button: // Replace movieClipInstanceName with the instance name of your MovieClip // movieClipInstanceName.play(); // movieClipInstanceName.stop(); // movieClipInstanceName.gotoAndPlay(___); //where ___ = frame number // movieClipInstanceName.gotoAndStop(___); //where ___ = frame number // movieClipInstanceName.prevFrame(); // movieClipInstanceName.nextFrame(); } - SingleMovieMultiLevelNavigation.zip – An example of a single Flash Movie with multiple levels of page navigation where all content and pages are stored in one published movie. There is a legacy CS3 version included.
- gettysburgaddressjohnnycash.mp3.zip – A sound file to use for embedding or playing as external sound. The following code will play and external sound file. It expects button symbols on the same frame as the code. These button symbol instance names are pause_button, play_button and rewind_button.
/*-------------------------------------------------------------------- Create mySound Sound object Initialize the start play position (lastPosition) Load the external mp3 sound ----------------------------------------------------------------------*/ var mySound:Sound = new Sound(); var lastPosition:Number = 0; mySound.load(new URLRequest("gettysburgaddressjohnnycash.mp3")); /*---------------------------------------------------------------------- Create myChannel SoundChannel object ----------------------------------------------------------------------*/ var myChannel:SoundChannel = new SoundChannel(); /*---------------------------------------------------------------------- Optional autoplay ----------------------------------------------------------------------*/ //myChannel = mySound.play(); // /*---------------------------------------------------------------------- MouseEvent.CLICK handling for pause_button ----------------------------------------------------------------------*/ pause_button.addEventListener(MouseEvent.CLICK, pause_button_onClickHandler); /*---------------------------------------------------------------------- Handler for pause_button MouseEvent.CLICK event Set the lastPosition to myChannel play position Stop the myChannel play ----------------------------------------------------------------------*/ function pause_button_onClickHandler(e:MouseEvent):void { lastPosition = myChannel.position; myChannel.stop(); } /*---------------------------------------------------------------------- MouseEvent.CLICK handling for play_button ----------------------------------------------------------------------*/ play_button.addEventListener(MouseEvent.CLICK, play_button_onClickHandler); /*---------------------------------------------------------------------- Handler for play_button MouseEvent.CLICK event Play the mySound Sound at the lastPosition ----------------------------------------------------------------------*/ function play_button_onClickHandler(e:MouseEvent):void { myChannel = mySound.play(lastPosition); } /*---------------------------------------------------------------------- MouseEvent.CLICK handling for rewind_button ----------------------------------------------------------------------*/ rewind_button.addEventListener(MouseEvent.CLICK, rewind_button_onClickHandler); /*---------------------------------------------------------------------- Handler for pause_button MouseEvent.CLICK event Stop the myChannel play Set the lastPosition to 0 ----------------------------------------------------------------------*/ function rewind_button_onClickHandler(e:MouseEvent):void { myChannel.stop(); lastPosition = 0; }
These CS4 Videos Are Compatible with CS5:
View on YouTube
Starter and complete exercise files: Get course files
