Adobe Flash Resources
From Eduwiki
Adobe Flash CS4 is now installed in the lab. Here are some sites that will help you get started and beyond:
Contents |
General Help and Tutorial Sites:
- List of video tutorials
- Adobe TV on Flash
- ProQuest Flash online - need csun ip to access
- Flashenthusiast - tutorials and discussion
Simple Tween Animation Steps
- Create or import an image
- Convert image to a symbol
- Right click on the symbol and select "Create Motion Tween" - notice the timeline for the symbol expands 25 frames
- Use the move tool (top) Place the symbol where you would like it to start in frame 1 (and set the color, rotation, effect)
- Click on the timeline to a later frame within the 25 (e.g. frame 10)
- Now drag (move tool) the symbol to the place you would like it at the selected frame - notice that a tween line appears with dots to show the position at each frame. The computer has calculated the in-between positions.
- Change the rotation, color, size etc for the new frame.
- You can click on the tween-line and modify the path if you want.
- Repeat steps 5-8 for as many frames as you would like to specify
Simple Button Script
- Create a button
- Specify the three stages of the button (normal, hover and down - add keyframe for each - ignore the 4th one)
- Create an instance of your button with a name (e.g. "mycoolbtn") at the appropriate point in the timeline
- Add a layer and call it action
- Right-click on the layer to ope the ActionScript window - enter the following:
stop();
mycoolbtn_btn.addEventListener(MouseEvent.MOUSE_DOWN, myMDfunction);
function myMDfunction(event:MouseEvent):void {
gotoAndPlay(142);
}
What this does is to first stop the movie from playing. Then the script make sur the button "listens" for someone clicking on it - and when that happens it runs "myMDfunction" which runs gotoAndPlay(142). This makes the movie skip to frame 142. It would be slightly more friendly to wait for mouse up (when someone releases the mouse on a button) by listening for MOUSE_UP events. Often you will want to start some action with this button (e.g. Start Button), so you would want to goto the beginning of your motion (e.g. gotoAndPlay(1) or gotoAndPlay(2) if your button stops action on frame 1).
Other functions you could use:
- gotoAndStop(142); - goes to a frame but stops the movie
- navigateToURL(new URLRequest("http://ebay.com")); - open up a URL
- snd.play(); - to do this you need to set the snd variable prior to the function with: var snd:mysound= new mysound(); (the sound needs to be in your library and the properties set for linkage with the name here (e.g. mysound)
Posting Shockwave to a Website
You can export your Flash (.fla) file to create a shockwave (.swf) files in flash. This process compresses the file so it is easier to download. Once you have this go to File menu - Publish. Flash will generate html with the appropriate <object>, <param>, and <embed> tags for you. It will also create the classid and pluginspage attributes. Move the html file and the swf to your web sever. Be sure to keep both files in the same folder (or change the relative URL in the html).
Alternatively you can move your swf to the web somewhere and use this code to embed the movie in your web page:
<object width="550" height="400"> <param name="movie" value="http://myserver.com/mypath/somefilename.swf"> <embed src="http://myserver.com/mypath/somefilename.swf" width="550" height="400"> </embed> </object>
Posting on Google Sites
To post your flash on google sites it is actually pretty easy. Go to your sites page where you want the flash. Just upload your swf as an attachment. Then put your embed code into the html for the page. Most of the time google will change your code to their embed code. Then you get a large rectangle on your page labled "Google Gadget" and "Embed gadget". When you click on this box, links show at the bottom of the box. Select "Properties" to see the source code that the gadget has installed. When I did this the flash did not work because it did not have the correct URL for the swf file (which is now an attachement). It is likely you will need to fix the URL in the source code.
To get the correct URL do a right-click, at the bottom of the page, on the link to "View" the swf attachement. Select "Copy Link". My link was "http://sites.google.com/site/514wedpages/flash-tea/brianbuttondemo.swf?attredirects=0" - this is the correct URL, but you should remove the "?attredirects=0" at the end. So the good URL is "http://sites.google.com/site/514wedpages/flash-tea/brianbuttondemo.swf"
To see the object code, click the Properties of the embed. It probably looks like this:
<object xmlns="http://www.w3.org/1999/xhtml" align="middle" classid="clsid:d27cdb6e-ae6d-11cf- 96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash /swflash.cab#version=10,0,0,0" height="400" id="brian button demo" width="550"> <param name="allowScriptAccess" value="sameDomain" /> <param name="allowFullScreen" value="false" /> <param name="movie" value="brian button demo.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" /> <embed align="middle" allowFullScreen="false" allowScriptAccess="sameDomain" bgcolor="#ffffff" height="400" name="brian button demo" pluginspage="http://www.adobe.com/go/getflashplayer" quality="high" src="brian button demo.swf" type="application/x-shockwave-flash" width="550" /> </object>
To make the flash work properly you will need to get the correct path (URL) to your swf. There are two places for the URL in the code above. First in line 6 - the value needs to be the whole path ("http://sites.google.com/site/514wedpages/flash-tea/brianbuttondemo.swf"). Also in line 10 the src should have the whole path.
Paste the URL as the src and as the movie value above (paste in the code in two places). Save the changes to the code and save the page to see your movie.
