Groups | Blog | Home
all groups > flash actionscript > august 2007 >

flash actionscript : Make objects appear wherever learner clicks


FrogSlug
8/12/2007 4:36:41 AM
Hi Flash gurus.

I am currently working on a movie in which I want an object to appear wherever
the learner clicks. Basically, I have a static MC that I want to appear
centered on the spot where the the learner clicks. I would like the learner to
be able to click in multiple places and have multiple versions of the MC
appear. (It is part of an exercise where the learner must identify errors in a
document. The MC is an error stamp that I want to appear wherever the learner
clicks.)

Any suggestions on the best way to do this? I currently have a large invisible
button that covers the entire document they will be clicking on. I assume I
will be putting some actionscript on there.

Thanks!
kglad
8/12/2007 5:42:47 AM
if you're using as2, assign your mc a linkage id and use attachMovie() in an
onMouseDown handler to bring your mc to the stage and then assign its _x and _y
properties to be the same as the _xmouse and _ymouse properties.

if you're using as3, assign your mc to a class and use a stage listener to
create class member and assign its _x and _y properties to be the same as the
stageX and stageY properties of the mouseEvent class.
FrogSlug
8/12/2007 6:52:45 PM
kglad
8/13/2007 2:29:53 PM
AddThis Social Bookmark Button