It has been a couple of months since the last tutorial, but
hopefully your holidays were great, the year 2002 will be prosperous
and you will be able to use Flash to create some wonderful web sites
with lots of interactive features!
This month we're going to take a look at the
creation of a custom cursor, and how to import text files into
a Flash file. We'll also talk about using some basic HTML
commands with these text files, to allow for links and various
text features, such as bold and italic, to be created.
First, we'll create a custom cursor that will allow for a different look
to the cursor when it moves into a Flash file! This is great for
different online educational learning tools, games created with Flash
or simply to change the look of your web site. This uses something that
is new in Flash 5 – a function called 'Hiding the Cursor' - which
basically explains what this function is capable of doing! Obviously
the very first thing that we are going to want to do is create a new
cursor that we'll use inside of the file. You can choose to create one
using the tools included with the application or if you would like,
simply import one from another source. For this example I simply
imported an image from another Flash file to be used and created buttons
to show how the cursor in fact works. Once we have the new cursor,
select it and turn it into a Movie Clip (Insert – Movie Clip from
the menu or F8 on the keyboard), giving it a name like
‘cursor’ in the instance preferences for reference purposes.
Next, as you are in the main stage of the movie, you'll want
to give the
movie clip an instance name, so that it can be referred to easily.
Once again here I simply called it cursor to keep things orderly and
easy to reference.
Now we want to go in and edit this movie clip slightly so that the new
mouse cursor will react correctly when it mouses over a button and the
correct part of the arrow will be the starting point for the cursor.
To do this, select the movie clip and edit it by pressing CTRL+E on the
keyboard. Here you will see the center of the arrow is located
directly center of the stage. We want to adjust this slightly so that
the tip of the arrow is right on the cross that you see. Now Once you
have done this, go back to the main stage of the movie using CTRL+E
and you will see the cursor movie clip selected.
Next, go to the timeline and click on the first frame with the right
mouse button, and select actions from the menu. We want to add some
scripting to the ActionScript window by clicking on
the plus sign. Go to Actions and select ‘Start Drag’. In the text
field that is shown type in the name of the instance, ('cursor' for
this example), of the movie clip that is going to be used and also
be sure to select the 'Lock Mouse to Center' option
or the mouse cursor will not move. The only thing left to do is get
rid of the original mouse, which is a quick and easy process – if
you don’t do it the mouse default arrow will show above our newly
created graphic. Once again in frame one of the movie we want to add
some more ActionScript to turn this mouse pointer off. In the
ActionScript window, select the plus sign, but this time go
to the ‘Objects’ option where you will see ‘Mouse’ and then are able
to choose ‘Hide’ from here ! It is that easy, the mouse will now
show as our newly created one and the default one will be seen no
longer!
The next part of the tutorial will discuss how Flash can
use text files to update information inside of a pre-defined text field,
thereby allowing even users with no Flash experience to update a
section of the file!
The text file that we create is going to store the information displayed
in the Flash file. Once this is sent to the server and overwrites an
existing copy (if there is one) the Flash file is automatically updated
on the web page.