Re: [Flashcoders] Detecting mouse events over non-white parts of a movieClip

2007-02-07 Thread Jason Boyd
If I were looking for the super-ideal "correct" algorithm and hade infinite coding monkeys, I would at init time create bitmaps of every library item, and use flood-fill combined with trig math to generate vector "trace" shapes of the non-white areas, which I would draw as zero alpha shapes into a

Re: [Flashcoders] Detecting mouse events over non-white parts of a movieClip

2007-02-07 Thread Dave Wood
cant you just use hitArea and make a transparent vector shape "hit state" for each visual element? As I think I indicated, that is indeed an option, but one we're looking for a way to avoid. Cheers David ___ Flashcoders@chattyfig.figleaf.com To

Re: [Flashcoders] Detecting mouse events over non-white parts of a movieClip

2007-02-07 Thread John VanHorn
oki just realized you said that would be a pain in your original message. sorry...i am tired. how many elements do you have? a hitArea for each one does seem like a simpler way to goor maybe i'm just tired. On 2/7/07, John VanHorn <[EMAIL PROTECTED]> wrote: cant you just use hitArea an

Re: [Flashcoders] Detecting mouse events over non-white parts of a movieClip

2007-02-07 Thread Jason Boyd
My understanding is that it's the default behaviour of a clip with any mouse events handled at all, that the cursor changes when it enters the clip. Oh right, sorry. So I wonder if it is possible to override this by definining an onMouseOver and changing the cursor to the default one?

Re: [Flashcoders] Detecting mouse events over non-white parts of a movieClip

2007-02-07 Thread John VanHorn
cant you just use hitArea and make a transparent vector shape "hit state" for each visual element? On 2/7/07, Dave Wood <[EMAIL PROTECTED]> wrote: Hi I need to detect mouse events on a movieclip's non-white content rather than it's bounding rectangle even where the contents are bitmap based.

Re: [Flashcoders] Detecting mouse events over non-white parts of a movieClip

2007-02-07 Thread Dave Wood
Can't you override the onMouseOver of the clips to prevent the cursor change? Or wait, why would the cursor be changing? There's no onRollover event being specifically handled, but each of the clips has onPress, onRelease and onReleaseOutside events handled. My understanding is that it's th

Re: [Flashcoders] Detecting mouse events over non-white parts of a movieClip

2007-02-07 Thread Jason Boyd
Can't you override the onMouseOver of the clips to prevent the cursor change? Or wait, why would the cursor be changing? On 2/7/07, Dave Wood <[EMAIL PROTECTED]> wrote: Thanks for those suggestions. I didn't think about Birmapdata.hitTest(), but I had thought about using getPixel() Sure, I c

Re: [Flashcoders] Detecting mouse events over non-white parts of a movieClip

2007-02-07 Thread Dave Wood
Thanks for those suggestions. I didn't think about Birmapdata.hitTest(), but I had thought about using getPixel() Sure, I can use that to decide whether or not the user has clicked on a non-white area, but that doesn't resolve user confusion. It doesn't help the user to know which item th

Re: [Flashcoders] Detecting mouse events over non-white parts of a movieClip

2007-02-07 Thread Jason Boyd
Also, just looking this up made me notice that as of Flash 8, you can do pixel-level hit detection between not only a bitmap and a point, but 2 bitmaps, with alpha threshold support! BitmapData.hitTest() On 2/7/07, Jason Boyd <[EMAIL PROTECTED]> wrote: Check out the BitmapData class, specifica

Re: [Flashcoders] Detecting mouse events over non-white parts of a movieClip

2007-02-07 Thread Jason Boyd
Check out the BitmapData class, specifically the static loadBitmap(id) method for creating an instance from a library symbol, and getPixel() which allows checking individual pixel values. I would think an algorithm that would work would be to iterate through the display list, do hitTest() on ever

[Flashcoders] Detecting mouse events over non-white parts of a movieClip

2007-02-07 Thread Dave Wood
Hi I need to detect mouse events on a movieclip's non-white content rather than it's bounding rectangle even where the contents are bitmap based. I'm putting together an activity for kids where they create a piece of art by dragging and dropping visual elements onto their canvas, then t