Presentation is loading. Please wait.

Presentation is loading. Please wait.

MovieCLip Instances & ActionScript

Similar presentations


Presentation on theme: "MovieCLip Instances & ActionScript"— Presentation transcript:

1 MovieCLip Instances & ActionScript
Draggable MovieClips

2 LIFE – the off-brand version of Lifesavers
Draw Something Create your object using the drawing tools LIFE – the off-brand version of Lifesavers They come in different colors, so I’m designing it in grayscale and will tint it later so I can have multiple varieties without having to redraw it

3 Convert it to a Graphic Symbol
Select it Right-Click Convert to Symbol Name it

4 MovieClip

5 Create a MovieClip Can contain animations
Can be assigned instance names Instance names can be used to apply ActionScript ActionScript is code that allows for interactions

6 Create a Movieclip Insert..New Symbol… Name it Make type: Movie Clip
Naming this inner-life because I’m going to use some trickery to only have to code once by nesting inside another movie clip

7 See here that I’m inside the movie clip
Drag in Graphic See here that I’m inside the movie clip Drag graphic life to stage from library

8 Make a second MovieClip
Insert a new symbol Name it outer-life (this is outer movie clip for my trickery) Drag copy (an instance) of inner- move to the stage from the library

9 Name the instance Click once on the lifesaver
Access the Properties Panel Assign it an instance name – mine in this example is “dragger” It must be one word, but that word is up to you Once it has a name we can control it with code

10 Open the Actions Panel Right-click on the first frame in the timeline (you should still be inside the outer movie clip Selection Actions Your code will go here

11 The Script //dragger=instance name //onPress = when mouse pressed
//starts dragging the item that was pressed dragger.onPress = function () { startDrag(this); } //onRelease = when mouse released //stops dragging dragger.onRelease = function () { stopDrag();

12 Return to root (main) timeline
Drag some instances of outer movieclip onto the stage Each instance automatically contains an already coded version of the inner movieclip When the move is tested, each individual movie clip will respond to dragging

13 Tinting the movie clips
Select a movie clip Open the Properties Panel From Color Effect section, select Tint

14 How strongly to apply the color
Tint Adjust sliders until desired color achieved preview How strongly to apply the color Amounts of RGB


Download ppt "MovieCLip Instances & ActionScript"

Similar presentations


Ads by Google