Escolar Documentos
Profissional Documentos
Cultura Documentos
A
animation – again using ActionScript – by creating a
for anyone in the creative industries, scrolling landscape in which creatures run by. This is
and it’s likely to be what you’re judged used to decorate the front page and give the
by whether your job has anything to otherwise rather sober introductory page of the
do with designing websites or not. It’s important, website a little personality. By creating our animation
therefore, to create a web presence which both entirely in ActionScript, we can control the
displays your work well and has a strong, movements of objects much more finely. We can even
professional-looking interface. It’s also true that introduce randomness to them, something which is
creative work is constantly evolving, so you won’t impossible when animating on the timeline.
want to create a portfolio which is so complex in its
implementation that you can’t easily update it.
Here, we’re going to create a basic Flash website Expertise provided by Christian Darkin. The finished
website created in this tutorial is Darkin’s own online
with a few pages and a simple set of buttons to bring
portfolio and can be viewed at: www.darkin.demon.co.uk.
up four different galleries showcasing different
types of illustration work. We use a simple
If you want to take a closer look at any of the
graphical design made up of solid flat shapes screenshots over the following pages, you’ll find them
in muted colours so that the artwork itself in the DiscContent\Tutorial\Tutorial Files\Flash
really stands out. We then do a little portfolio folder on CD98.
Use Photoshop
For this tutorial,
we’ve created all
our text in
Photoshop and
exported it. Regular
Flash users would
probably prefer to
write and lay out
their text in Flash.
However, if
Photoshop is the
tool you use most of
the time, you’ll
probably be more
comfortable making
all the typographic
decisions there.
In Photoshop, create a document with the dimensions of your website – we’re On separate layers, create the text for the site. By putting the text for each
1 2
using 800x600. The backdrop is clean and the colours neutral, which will allow individual page on a separate layer, you’ll be able to identify and place it later
the images to do all the talking. This will be the backdrop to the whole site. on. A more sophisticated site might include multiple pages of text and images.
ActionScript
ActionScript 2.0
isn’t the newest
version of
ActionScript, but
you can create it in
older versions of
Flash and it offers
several simplified
tools for adding
interactive elements
such as buttons. It’s
a language that is
ideal if you’re not an
expert in object-
orientated
programming.
Buttons are designed separately. Here each button has three layers: one for its Create a new Flash document (using ActionScript 2.0) and use Modify>
3 4
unselected state, one for its mouse-over state and one for its selected state. Document to give it a frame rate of 25 and the same dimensions as the image
Again, we’re keeping things simple and clean by using the same text in three muted you’ve designed in Photoshop. Import your image files to the Library and drag the
colours. All layers need to be saved separately as JPG or PNG files. backdrop onto the stage. If the Library’s not visible, select it from the Windows menu.
Create a new layer in the Flash timeline at the top of the Double-click on the first button and a timeline will open Double-click anywhere on the stage to close your
5 6 7
screen, and with it selected, drag the ‘unselected’ image for it. It has four frames, each representing a button state. button’s timeline and return to your main movie. Once
for each button onto the stage and into place. Then Right-click Select each frame and choose Insert>Timeline>Keyframe (or you’ve done this with all the buttons, you can check out your
or Ctrl-click on each and select Convert To Symbol to turn hit F6), then delete the graphic from the stage, and drag into movie by selecting Control>Test movie. The buttons should
each graphic into a button. its place the appropriate button state from the Library. change when you move the cursor over them or click them.
Just as before, we design the main elements of the gallery Measure the space into which the gallery images need to Back in Flash, import the background along with a solid
1 2 3
in Photoshop. Simple shapes and buttons are the key, but fit, and save them out from Photoshop at exactly those black JPG as a placeholder for the first image. This allows
this time we only need two buttons: one to progress the dimensions (this means placing borders around some images). you to place everything on the stage and you won’t need to
images to the left and one to the right. We keep to the muted Name them sequentially: 0.jpg, 1.jpg, etc. Our site has several worry about setting the positions of objects in ActionScript.
colour scheme of the rest of the site. galleries, so we name the second batch 0a.jpg, 1a.jpg, etc. Place your gallery graphics on a new layer on frame 10.
You should now have a fully working set of galleries. The great advantage of
9
Creating the next gallery is simple. Go to the keyframe you’ve created for the next gallery button, loading images from disk rather than embedding them in your Flash production
8
create a new keyframe in the ActionScript layer, and change every instance of loadMovie(Mypic+". is that you can update your gallery instantly just by uploading new images and
jpg", _root.MyImage); to loadMovie(Mypic+"a.jpg", _root.MyImage). This loads 1a.jpg instead of 1.jpg. changing the NumberofImages variable. You don’t need to re-write your entire site.
Import your graphics into Flash and, The above lines of code – placed in the frame actions on
4 5
on yet another new layer, place two the landscape layer – tell Flash to move the x position of
copies of your landscape graphic. Position the mountains by 0.5 pixels every time the frame is played Place the trees in exactly the same way. The only
6
them so that the left-hand side of the first (25 times per second, if you’ve set it up as we did in Part 1, difference is that they need to move slightly faster in
is against the right-hand side of the Step 4). Each time one of the mountains graphics exits stage- order to create a 3D parallax effect. Instead of making them
second, and change them into movie left (when it’s got an x position of less than -800) move it to move 0.5 of a pixel at a time, they need to move 1 pixel on
symbols, giving them instance names. the right of the screen, where it appears exactly at the end of every frame. When you run the animation, you should have
We name ours Mounts1 and Mounts2. the other mountain range creating a seamless loop. an infinite scrolling landscape along the bottom of the site.
Our final
10
creature
animation is going
to be a little more
sophisticated. Here
we’ve created a
series of eight
frames which
describe a single
pace for our
creature. As flat,
single-colour
graphics they take
up very little
bandwidth when
saved as PNG
files and imported
into Flash.
In Flash, we take the first graphic and create an animation exactly as before,
11
with the creature starting off to the left of the screen, and the ActionScript
dictating its placement and movement across the landscape.
Nesting movies
This idea of nesting
movies inside
other movies is very
powerful. It means
you can put
together complex
animations, and
have events trigger
other events
without making
your main timeline
needlessly
complicated. It’s
even possible to
have movies
communicate with
each other.
Double-click the graphic to open up the movie timeline for your symbol. Right Do the same for the rest of the frames in the animation loop. In this case,
1 2
now, there’s only one keyframe, so click on the second frame and choose we’ve got a fairly straightforward eight-frame looping animation of the creature
Insert>Timeline>Keyframe, then Right-click or Ctrl-click on the graphic and select walking. However, using this method, you could have frames repeat, add extra
Swap Bitmap, choosing the second frame in the creature’s animation. layers or alter the graphic in any other way.
Now the creature will be animated as it walks across the screen. It will play at As a final touch, you’ll want viewers of your website to be able to contact you if they like what they
3 4
the same frame rate as the movie itself – 25fps. If that’s too fast, you’ll need to see. Create a set of contact button states (we’ve only used two – an unselected and a rollover state)
extend the animation (maybe swapping the graphic every two or three frames). and import them. You can now drag the button into place and set up its states as shown in earlier steps.
In the Behaviours palette, click + and choose Web>Go To Check in the File>Publish Settings dialog that Flash and You could also add progress bars to let visitors with slow
5 6 7
Webpage. Then in the dialog type mailto: followed by HTML are selected (so that Flash will generate an HTML connections know that there’s something going on while
your email address. Just like with any HTML site, the mailto page for your movie), then go to File>Publish. You can then pictures and movies load. We also recommend creating high
command opens an email in the user’s chosen email package upload the SWF file, the gallery images and the HTML file visibility, accessible features and testing your site on a range of
and puts your address in the header. (renamed Index.html if it’s your front page) to your website host. monitors, screen resolutions and devices. ca p