Posts Tagged ‘scripting’

Scripting Tutorial: duplicateMovieClip()

Monday, July 25th, 2011

For those  interested in improving their scripting, one of the most useful script commands is duplicateMovieClip(). This command can be used to dynamically duplicate any existing movie clip and can be used to great effect.

(more…)

Code: Fade to Volume Level

Monday, July 26th, 2010

If you want to gradually fade out the audio in your .SWF file, it can be done using Actionscript.  It isn’t always necessary to provide an actual volume control bar, and in some cases you might simply want to fade the audio out during some other event (such as fading out the background audio while a video plays).  The code snippet below will help you do just that.

The source .SWI file for the example above can be downloaded, here: fade-to-volume_v1

You will need SWiSH Max3 (build 2009.11.30 or higher) in order to open/edit the sample file.

Note:  The code can also be used in SWiSH Max2 SWI files (you just can’t open the sample file with it).

(more…)

Code: Fade to Alpha Level

Monday, July 26th, 2010

If you are looking for a convenient way to fade the alpha level (transparency) of an object through Actionscript, then this simple code snippet may be what you need.  Without relying on any overhead in the timeline or increasing the file size, this function allows you to animate the alpha level of any object over a specified period of time.

The source .SWI file for the example above can be downloaded, here: fade-to-alpha_v1

You will need SWiSH Max3 (build 2009.11.30 or higher) in order to open/edit the sample file.

Note:  The code can also be used in SWiSH Max2 SWI files (you just can’t open the sample file with it).

(more…)

Tutorial: Disable All Buttons

Monday, July 12th, 2010

In many projects, you might have a need to disable a button or two.  In some projects, you might need to disable all buttons at once.  This process can be tedious if using the most common methods, but we’ll show you how to do it quickly and easily in this short tutorial. One practical example of this might be in something like an image “lightbox” – where you have an image opening on top of your movie and don’t want the buttons beneath it to be clickable.

This first example shows a standard image gallery.  Click on any of the thumbnails to open the larger image.  You can move your mouse around the movie and see that the cursor changes as you mouseover the buttons.  These are all still active and clickable while the image is open. (more…)

Enable/Disable Resizing of Components

Monday, February 23rd, 2009

By dragging the handles of an object you will scale the contents inside it.  When creating components, there are times that you might not want the component itself to be resized but instead allow users to resize only part of the component, or disable resizing completely.  This tutorial will show you methods to either enable or disable resizing of a component when you drag it’s object handles.

resizing-via-component-handles_img1a

You can download the example files for this tutorial here - max2-component-resize-handles

(more…)

Scripting #4 Arrays

Monday, December 22nd, 2008

Lesson 4 … here we look at the concept of the data  ‘array’ and how it is used in scripting. Arrays can be used to simplify the organization, handling and manipulation of large amounts of data.

An array is a group of variables that share the same name. When a large number of variables are required to store data, it is often convenient to use an array. (more…)


Switch to our mobile site