Home Contact Site map
 
Home Components Support Purchase
Components
Methods
InheritanceMovieClip > UIObject class > ThreeDimensionalChanger class

Methods inherited from the UIObject class

The following table lists the methods the ThreeDimensionalChanger class inherits from the UIObject class.

Method Description
UIObject.getStyle() Gets the style property from the style declaration or object.
UIObject.move() Moves the object to the requested position.
UIObject.setSize() Resizes the object to the requested size.
UIObject.setStyle() Sets the style property on the style declaration or object.

Methods unique to the ThreeDimensionalChanger class

The following table lists methods of the ThreeDimensionalChanger class.

Method Description
ThreeDimensionalChanger.addImage() Adds a new image to the end of the "Images Collection" or inserts it after the specified index in the array.
ThreeDimensionalChanger.applyVisualEffect() Applies a specified visual effect to images in 3DImageChanger.
ThreeDimensionalChanger.clear() Removes all images from the "Images Collection".
ThreeDimensionalChanger.getImageAt() Returns an image within the "Images Collection" by using its index.
ThreeDimensionalChanger.getImageIndex() Finds an image within the "Images Collection" and returns its index.
ThreeDimensionalChanger.gotoFirstImage() Navigates to the first image in the "Images Collection".
ThreeDimensionalChanger.gotoImageAt() Navigates to the image in the "Images Collection" with the specified index.
ThreeDimensionalChanger.gotoLastImage() Navigates to the last image in the "Images Collection".
ThreeDimensionalChanger.gotoNextImage() Navigates to the next image in the "Images Collection".
ThreeDimensionalChanger.gotoPreviousImage() Navigates to the previous image in the "Images Collection".
ThreeDimensionalChanger.removeImageAt() Removes a single image from the "Images Collection" by using its index.
ThreeDimensionalChanger.reset() Resets a 3DImageChanger instance to its initial state.
ThreeDimensionalChanger.reverse() Reverses the direction of rotation while rotating images.
ThreeDimensionalChanger.toggleDisplayMode() Toggles the displayMode property from "manual" to "auto-forward" / "auto-backward" and vice versa.
ThreeDimensionalChanger.togglePlayMode() Toggles the play mode of a 3DImageChanger instance from "play" to "stop" and vice versa.

ThreeDimensionalChanger.addImage()

Usage

myChanger.addImage(imageLinkage, imageType[, startIndex])

Parameters

imageLinkage   A string that indicates either (a) the linkage identifier for an asset in the library (bitmap or symbol); or (b) the absolute or relative URL of the JPEG, GIF, PNG, or SWF file to be loaded. A relative path must be relative to the SWF file at level 0. Absolute URLs must include the protocol reference, such as http://.

imageType   A string that specifies the type and location of the image you want to add to your collection. This parameter can be one of three values (the default value is "bitmap"):

  • bitmapbitmap from library;
  • symbolsymbol from library;
  • fileexternal file.

index   An integer that specifies the index of the image in the "Images Collection" where the insertion begins. You can specify a negative integer to specify a position relative to the end of the collection (for example, -1 is the last image of the "Images Collection"). This parameter is optional.

Returns

A Boolean value of "true" if the collection was changed as a result of the operation.

Description

Method; adds a new image to the end of the "Images Collection" or inserts it after the specified index in the array. The "Images Collection" must contain at least one image for this method to take effect at runtime.

Example

The following example adds a new external image (flower08.jpg) to the end of the "Images Collection":

myChanger.addImage("flower08.jpg", "file");


ThreeDimensionalChanger.applyVisualEffect()

Usage

myChanger.applyVisualEffect(name, direction, quality, speed)

Parameters

name   A string that specifies the type of a visual effect. The following values are acceptable for this parameter:

  • blursoftens the details of an image;
  • grayscaleconverts the RGB image to grayscale image and vice versa;
  • brightnesschanges the image brightness.

direction   A string that specifies the direction of a visual effect. This parameter can be one of two values:

  • in     increasing the strength of the effect;
  • out   decreasing the strength of the effect.

quality   A string that defines the depth or intensity of a visual effect. This parameter can be one of three values:

  • low
  • medium
  • high

speed   A string that defines the speed of increasing and decreasing of a visual effect. This parameter can be one of five values:

  • minimum
  • low
  • medium
  • high
  • maximum

Returns

Nothing.

Description

Method; applies a specified visual effect to images in a 3DImageChanger component instance. The Visual Effect parameter must be set to "none" for this method to take effect.

Example

The following example applies a grayscale effect to the changer depending on mouse interaction:

myChanger.onRollOver = function() {
myChanger.applyVisualEffect("grayscale", "in", "medium", "low");
}
myChanger.onRollOut = function() {
myChanger.applyVisualEffect("grayscale", "out", "medium", "low");
}


ThreeDimensionalChanger.clear()

Usage

myChanger.clear()

Returns

Nothing.

Description

Method; removes all of the images from the "Images Collection".

Example

The following example calls clear():

on (click) {
myChanger.clear();
}


ThreeDimensionalChanger.getImageAt()

Usage

myChanger.getImageAt(index)

Parameters

index   A number that indicates the location of image within the collection. This is a zero-based index, so 0 retrieves the first image, 1 retrieves the second image, and so on.

Returns

An image object.

Description

Method; returns an image within the "Images Collection" by using its index.

Example

The following example compares the image at index 5 with the current image, and if they are equal — toggles the display mode:

if (myChanger.getImageAt(5) == myChanger.currentImage) {
myChanger.toggleDisplayMode();
}


ThreeDimensionalChanger.getImageIndex()

Usage

myChanger.getImageIndex(image)

Parameters

image   An object that represents an image within the "Images Collection".

Returns

The index of a specified image within the "Images Collection".

Description

Method; finds an image within the "Images Collection" and returns its index.

Example

The following example checks whether the index of the current image is less than 10 and, if so, sets the value of group_name to "animals":

if (myChanger.getImageIndex(myChanger.currentImage) < 10) {
group_name = "animals";
}


ThreeDimensionalChanger.gotoFirstImage()

Usage

myChanger.gotoFirstImage()

Returns

Nothing.

Description

Method; navigates to the first image in the "Images Collection".

Example

In the following example the changer navigates to the first image in the collection:

myChanger.gotoFirstImage();


ThreeDimensionalChanger.gotoImageAt()

Usage

myChanger.gotoImageAt(index)

Parameters

index   A number that indicates the location of image within the collection. This is a zero-based index, so 0 retrieves the first image, 1 retrieves the second image, and so on.

Returns

Nothing.

Description

Method; navigates to the image in the "Images Collection" with the specified index.

Example

In the following example the changer navigates to the image with a random index between 0 and 100:

var num:Number = Math.round(Math.random()*100);
myChanger.gotoImageAt(num);


ThreeDimensionalChanger.gotoLastImage()

Usage

myChanger.gotoLastImage()

Returns

Nothing.

Description

Method; navigates to the last image in the "Images Collection".

Example

In the following example the changer navigates to the last image in the collection:

myChanger.gotoLastImage();


ThreeDimensionalChanger.gotoNextImage()

Usage

myChanger.gotoNextImage()

Returns

Nothing.

Description

Method; navigates to the next image in the "Images Collection".

Example

In the following example the changer navigates to the next image in the collection:

myChanger.gotoNextImage();


ThreeDimensionalChanger.gotoPreviousImage()

Usage

myChanger.gotoPreviousImage()

Returns

Nothing.

Description

Method; navigates to the previous image in the "Images Collection".

Example

In the following example the changer navigates to the previous image in the collection:

myChanger.gotoPreviousImage();


ThreeDimensionalChanger.removeImageAt()

Usage

myChanger.removeImageAt(index)

Parameters

index   A number that indicates the location of image within the collection. This is a zero-based index, so 0 retrieves the first image, 1 retrieves the second image, and so on. You can specify a negative integer to specify a position relative to the end of the collection (for example, -1 is the last image of the "Images Collection").

Returns

A Boolean value of "true" if an image was removed successfully; returns "false" if the image is not found.

Description

Method; removes a single image from the "Images Collection" by using its index.

Example

The following example removes the image at index 5 from the collection:

myChanger.removeImageAt(5);


ThreeDimensionalChanger.reset()

Usage

myChanger.reset()

Returns

Nothing.

Description

Method; resets a 3DImageChanger instance to its initial state (to the time of the first image loading) and clears it from the visual effect created by applyVisualEffect() method. It’s desirable to use the reset() method, for example, if you apply a visual effect to a changer multiple times at runtime, to avoid unexpected behavior.

Example

The following example calls reset():

on (click) {
myChanger.reset();
}


ThreeDimensionalChanger.reverse()

Usage

myChanger.reverse()

Returns

Nothing.

Description

Method; reverses the direction of rotation immediately while rotating images. This method has no effect on static image (when no rotation occurs). There are two possible cases of a changer behavior when reverse() is invoked, depending on a component’s settings:

  • If Display Mode parameter is not "manual", and delay is set to 0 — the direction of rotation reverses and the value of displayMode property changes to the opposite direction (for example, from "auto-forward" to "auto-backward").
  • In other cases — the direction of rotation reverses but for the current turn only; the value of displayMode property remains the same.

Example

The following example calls reverse():

on (click) {
myChanger.reverse();
}


ThreeDimensionalChanger.toggleDisplayMode()

Usage

myChanger.toggleDisplayMode()

Returns

Nothing.

Description

Method; toggles the displayMode property from "manual" to "auto-forward" / "auto-backward" and vice versa.

Example

The following example calls toggleDisplayMode():

on (click) {
myChanger.toggleDisplayMode();
}


ThreeDimensionalChanger.togglePlayMode()

Usage

myChanger.togglePlayMode()

Returns

Nothing.

Description

Method; toggles the play mode of a 3DImageChanger instance from "play" to "stop" and vice versa. Calling this method causes the images in changer to stop or resume the rotation from a stopped position instantly.

Example

The following example calls togglePlayMode()::

on (click) {
myChanger.togglePlayMode();
}


© E-MERALD. All rights reserved.
© Designed by Fox.net.ua.
HTML 4.0, CSS.