Join Paul Trani for an in-depth discussion in this video Simplifying code, part of Creating a Portfolio Web Site Using Flash CS4 Professional.
Now that you have seen the basics of ActionScript, I am going to show you how…you can simplify your code, which is going to cut down on errors and make…your code more flexible.…So I am going to go to this AS layer, select that first frame, and go to…Window, and Actions.…And the first thing I am going to do is pin my code by pressing that…little Push-Pin icon.…As you can see, as I scroll down, I am repeating many, many lines of code,…this all looks the same. This looks the same, and it's pretty lengthy, and…all that really changes from one function to the next is this parameter, ok, and…this one, and then this one.…
So what I want to do is create one major function that's going to accept these…parameters and then move the content movie clip accordingly.…So I am going to create that function right up here, above of…the EventListeners.…I am just going to go ahead and type in 'function,' and this function is going to…be called moveContent, because the goal of this function is to move content.…This function is going to accept these parameters: the x position, the y…
- Optimizing and publishing a Flash web site
- Designing a professional photo or video portfolio
- Adding button interactivity
- Adding functionality to portfolio thumbnails
- Displaying content with XML
- Adding audio to portfolio presentations
Skill Level Intermediate
Q: While following along with the course, I encountered the following error in Flash CS4:
1120: Access of undefined property content_mc.
What is causing this error?
A: Flash is looking for something (the content movieclip) with the instance name “content_mc” but it is not finding it. Select the content movieclip on the stage. In the Properties panel give it an instance name of “content_mc”. Make sure there are no spaces before or after. That should resolve the error.
Q: What is the best strategy for integrating 720/60P HD video into a website? Would creating a blank page that opens in full HD resolution be the best way to view the full quality of the HD video file?
A: A video file that large would just be unreasonable for most users to open. These settings are a good place to start: 600x400is
Bitrate level: 1,000kbps
Bitrate Encoding: VBR These are just recommendations, and can be modified to preference. Also keep in mind that in Flash, one of the buttons that can be added is a full screen button, which is part of the skins.