Note: Position is defined by the center of the display object (i.e. In the following example, when you click on the interactive object (a symbol instance that is called "black_cat") it will move itself to position x= 200 and y=200. In order to reposition an object, change its x and y properties. To understand what is going on below, you may want to look at:Īctionscript3-simple-object-manipulation.htmlĪctionscript3-simple-object-manipulation.fla Follow up a link to the Flash documentation and see if you can find other properties that are easy to manipulate. If you feel more adventurous, you may have a look at the class hierarchy described in the Flash ActionScript 3 overview and in particular the Display Object and its children. You could imagine dozens of other simple examples, but it's not so easy to understand the technical ActionScript documentation which is made for programmers and not designers. Symbol instances you want to manipulate must be named
The kind of tricks will we show act on named instances movie clips. These are a kind of interactive object and react to mouse and keyboard events. black_cat) are instances of movie clip symbols. With mouse events (see the ActionScript 3 event handling tutorial for more details).
operations you could do on grouped objects and symbol instances with the transform tool or the parameters panel.īelow, we show a few little examples that demonstrate how to manipulate objects
It's easy to change size and position of a display object, i.e. Typically, most objects are non-editable (its component objects maybe are). Some changes are easy to make, others are really hard. The tricky thing is to know what you can change The principle of (simple) object manipulation is fairly simple: change properties of a display object. It can be used as handout in a "hands-on" class. Quality This text should technical people get going and may not be good enough for self-learning beginners. I should at some point decide whether I should remove all type declarations from the examples or consistently leave the ones that might be useful in order to receive compiler warnings.
The goal is to keep code as simple as possible. These don't make sense for a few lines of code written by/for non-programmers. I skipped type declarations on purpose and should even rip off more. Also, some of the code should be rewritten a bit.
Learn about how to use mouse and key-press events.you will learn how to change properties of objects (such as position, size and visibility) and how to play embedded movie clips: The purpose of this tutorial is go a little bit beyond dealing with mouse clicks, buttons and button components as seen in previous tutorials, i.e.