all groups > flash actionscript > april 2005 >
You're in the

flash actionscript

group:

Adding a item from the library to the screen.


Adding a item from the library to the screen. davidprovost
4/27/2005 12:00:00 AM
flash actionscript: Im trying to get it so that when you push the mouse down it starts adding an mc
called "circle" to the screen, and it keeps adding the item to the screen
wherever the mouse is at until you release the mouse. So that you can draw
stuff. Whats the actioinscript for that?
Re: Adding a item from the library to the screen. davidprovost
4/27/2005 12:00:00 AM
Re: Adding a item from the library to the screen. davidprovost
4/27/2005 12:00:00 AM
Re: Adding a item from the library to the screen. David Stiller
4/27/2005 4:59:06 PM
davidprovost,

[quoted text, click to view]

You can find methods for listening for mouse events in the Mouse class
and the MovieClip class, at least. If you go the first route, you'll use
the addListener() method to listen across the board for all clicks, no
matter where they occur. If you go the latter route (which I would do),
you'll use the onMouseUp (or other) event handler(s) of a given movie clip
class, such as the movie clip that represents your drawing surface.


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

Re: Adding a item from the library to the screen. David Stiller
4/27/2005 5:01:41 PM
[quoted text, click to view]

Ah, forgot about that. Yes, in addition ... you'll find examples for
how to use the attachMovie() method under MovieClip class in the
documentation. Give it a shot; it's all spelled out. ;) You use use the
attachMovie() as illustrated to "pull" a Library asset at runtime (just make
sure the asset has a linkage id ... right click on your assets to set this).
Once your clip is attached, you can immediately set its _x and _y properties
to the _root's _xmouse and _ymouse properties.


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

Re: Adding a item from the library to the screen. David Stiller
4/28/2005 12:00:00 AM
[quoted text, click to view]

You want me to spell it out more than I have? ;) I told you which
classes to look up -- in fact, which methods of which classes to look up.
If you don't have Flash in front of out, check out the documentation online.

http://livedocs.macromedia.com/


David
stiller (at) quip (dot) net
"Luck is the residue of good design."

Re: Adding a item from the library to the screen. davidprovost
4/29/2005 12:00:00 AM
AddThis Social Bookmark Button