UNID tutorial

1.                Name 4 properties of a MovieClip that can be controlled with ActionScript.

Size, Position, Angle, Visibility

 

2.                What is an event in ActionScript that you could use to have code repeat at the current frame rate?

The ENTER_FRAME event is used in ActionScript 3.0 to have code repeat at the current frame rate. For example to have a MovieClip named logo_mc rotate five degrees on every frame, you could write:


addEventListener(Event.ENTER_FRAME, rotateLogo);

Function rotateLogo(e:Event):void {

logo_mc.rotation += 5;

}

 

3.                What is the keyword that is used to create a new instance of an ActionScript class?

class – Defines a class, which lets you instantiate objects that share methods and properties that you define.

 

4.                What is the syntax in ActionScript 3.0 to indicate what type of data will be stored in a variable?

Case Sensitivity, ActionScript 3.0 is a case-sensitive language. Identifiers that differ only in case are considered different identifiers.

 

5.                When creating an instance of the Tween class, what are the parameters (values between the parentheses that are used to determine how the tween behaves)?

When you create a new instance of a Tween class, you pass several parameters. You must indicate the target movie clip object, what property of the movie clip the tween is to affect, the range over which the object is to be tweened, and an easing method to use to calculate the tweened property.

The constructor for the mx.transitions.Tween class has the following parameter names and types:

Tween( obj:Object, prop:String, func:Function, begin:Number, finish:Number, duration:Number, useSeconds:Boolean )

obj – The movie clip object that the Tween instance targets.

prop – A string name of a property in obj to which the values are to be tweened.

func – The easing method that calculates an easing effect for the tweened object’s property values.

begin – A number indicating the starting value of prop (the target object property to be tweened).

finish – A number indicating the ending value of prop (the target object property to be tweened).

duration – A number indicating the length of time of the tween motion. If omitted, the duration is set to infinity by default.

useSeconds – A Boolean value indicating to use seconds if true or frames if false in relation to the value specified in the duration parameter.

Leave a comment