Thanks Alex for the stage vs. local hint. However my component being
at (0,0) on the stage it doesn't change much switching to stage
coordinates ;-(
Ok, I'm gonna try the workaround that Bart provided... But still I
think I'm encountering some problem here...
--- In flexcomponents@yahoogroups.com,
"Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> I didn't run it, but I saw that you are using local coordinates instead
> of stage coordinates. getObjectsUnderPoint says it needs stage
> coordinates
>
>
>
> ________________________________
>
> From: flexcomponents@yahoogroups.com
> [mailto:flexcomponents@yahoogroups.com]
On Behalf Of cjo_group
> Sent: Thursday, September 21, 2006 1:20 AM
> To: flexcomponents@yahoogroups.com
> Subject: [flexcomponents] Re: getObjectsUnderPoint wrt MovieClipAsset
>
>
>
>
> > It's not a bug. Loaded SWFs may be under security restrictions
> > and may not show up in the list of objects returned by
> > getObjects under point. From the docs:
>
> > "Any child objects that are inaccessible for security reasons
are
> > omitted from the returned array. To determine whether this security
> > restriction affects the returned array, call the
> > areInaccessibleObjectsUnderPoint() method."
>
> Sure but areInacessibleObjectsUnderPoint returns false for me so it
> should not be the cause of my problem? See below, by clicking on the
> circle you have an object that is found, by clicking on the symbol,
> you have no object found and areInnacessibleObjects returns false!
> (well, at least for me ;) ).
>
> package test
> {
> import mx.core.UIComponent;
> import mx.core.FlexShape;
> import mx.core.MovieClipAsset;
> import flash.geom.Point;
> import flash.events.MouseEvent;
> import mx.core.IFlexDisplayObject;
> import mx.controls.Alert;
>
> public class UITest extends UIComponent
> {
> [Bindable]
> [Embed(source="/assets/symbol.swf")]
> private var symbolClass:Class;
>
> public function UITest():void
> {
> addEventListener(MouseEvent.CLICK, mouseHandler);
> }
>
> protected function mouseHandler(event:MouseEvent):void
> {
> var p:Point = new Point(event.localX, event.localY);
> var a:Array = getObjectsUnderPoint(p);
> if (a.length == 0) {
> var b:Boolean = areInaccessibleObjectsUnderPoint(p);
> Alert.show("no object under mouse and are inacessible objects
> returns: "+b, "", Alert.OK);
> } else
> Alert.show("object under mouse");
> }
>
> protected override function createChildren():void
> {
> super.createChildren();
> var s1:FlexShape = new FlexShape();
> s1.graphics.beginFill(0xFF0000);
> s1.graphics.drawCircle(30,30,5);
> s1.graphics.endFill();
> addChild(s1);
> var s2:MovieClipAsset =
> MovieClipAsset(new symbolClass());
> s2.move(50, 50);
> s2.setActualSize(30,30);
> addChild(s2);
> }
>
> }
> }
>