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: [email protected] [mailto:[email protected]] On Behalf Of cjo_group
Sent: Thursday, September 21, 2006 1:20 AM
To: [email protected]
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);
}

}
}

__._,_.___


SPONSORED LINKS
Software development tool Application development software Development software
Development outsourcing software Embedded software development

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___

Reply via email to