so just do this: targetObject.dispatchEvent(new MouseEvent(MouseEvent.CLICK));
it's gonna catch it as if the user clicked on it ;) Z. On Thu, Dec 16, 2010 at 4:56 PM, Fabrice3D <[email protected]> wrote: > adding e:MouseEvent3D = null would allow to envoke directly the function, > and you could add a if e != null > but since you envoke it to get the target, It doesn't make much sens to > envoke it no? > > you might probably be better off by making a dedicated function in the case > you know the object... > I imagine you want go to C (some mesh edits) and sometimes you have a A > case (the mesh in scene), B (somemesh you store else where) > > So instead to push all functionality regarding a mesh into one function > make a A(the mouseEvent3D target) and B(some mesh you know of) functions, > both passing the mesh to a C function. > C doesn't care where it comes from as long as its a mesh... > > dunno if this what you ment... dunno if fake enough for your case :)) > > Fabrice > > > On Dec 16, 2010, at 4:34 PM, Darcey Lloyd wrote: > > Not quite an Away3D question but is in relation to MouseEvent3D, I am > wondering about the following: > > > If I have a function which takes MouseEvent3D like so: > > public static function DoSomething(e:MouseEvent3D):void > { > var target:* = e.target; > } > > What would be the best way to fire this function not via a MouseEvent3D > listener? EG: > > var myMouseEvent3D:MouseEvent3D = new MouseEvent3D(); > myMouseEvent3D.target = somePrimitive; > DoSomething(myMouseEvent3D); > > > Error target is read only. > > Any ideas? > > > >
