If
you want to connect this button with an external URL
you can use the getURL() script function. If you're
assigning this function to the button you should use
the on (release) event. So the rollover script with
added link will look like this:
on (rollOver) {
gotoAndPlay(2);
playSound("But.wav");
}
on (rollOut) {
gotoAndPlay(18);
}
on (release) {
getURL("http://www.mywebsite.com","_blank","GET");
}
If you don't use any
rollover effects, you can use the on (release) event
without the previous two events:
on (release) {
getURL("http://www.mywebsite.com","_blank","GET");
}
Let's check the getURL()
function closer. The first attribute is the absolute
or relative URL of the file to load. The second attribute
is the Window. You can specify the target frame name
to which you will load the file. Or you can use some
of the default window options:
_blank - this will open the file in the same frame or
window. Note that you’ll get the same effect if
you just skip the Window option;
_blank - this will open a new browser window;
_parent - this will open the link in the same browser
window regardless of frame settings;
_top - this will open the link in the top level frame.
Let's check some examples of the getURL() function:
getURL("images/myphoto.jpg","_blank")
This will open the
photo.jpg file located in the images folder in the popup
window.
getURL(http://www.myfriendswebsite.com)
This will open the
http://www.myfriendswebsite.com in the same window.
getURL("http://www.mywebsite.com/mail.php","_blank","GET")
This will call the
mail.php script located at the http://www.mywebsite.com/mail.php
and will transfer the variables info using the GET method.
If you want to connect
a button with the JavaScript code, you can use the following
function:
on (release) {
javascript(alert(“this is test”) );
}
Quoted javascript()
function argument should be the javascript code. The
example above will execute the alert() javascript function.
If you want to connect
your button with an e-mail address, you can use the
mailto() function. This function is similar to the mailto
link option in the HTML. The following example will
call the default mail agent and fill the address and
subject fields:
on (release) {
mailTo("support@company.com","","This
is the support question","");
}
Changing
Images
During the customization of your SWiSH animated website
template you may need to substitute some of the images
with your own, for example, to change the company logo
or substitute default image with the photo of your products.
This process is quite easy with SWiSHmax.
First of all, you'll
need to locate and select an appropriate image item.
You can find the image object through the Outline or
Timeline panel. Or you can select it by single clicking
an image with the Select tool on the Layout panel.
Once you've selected
the image object, the Object panel should be opened.
You can open this panel by selecting the Panels/Object
from the top menu. The name of the Object panel depends
on the currently selected object type. In the case of
an image the object panel name will be Shape. |