Re: [flexcoders] AIR: Detecting when window resize is complete (mouse up)

2009-01-15 Thread Lushen Wu
I use mouseup in my application.. it seems to work for me. you coudl 
also play around with MOUSE_LEAVE and ROLL_OVER for the stage
(activate the rollover listener for resize whenever you get a RESIZE 
event, then remove the listener when you have satisfactorily resized)


Cheers,
Lushen


On 1/15/2009 3:56 PM, Aaron Hardy wrote:


Hey folks,

In my project I have a component that is a percentage width of its
containing window. When the user resizes the window, it triggers the
component to update its display list WHILE the user is dragging the
window resize handle. Rather than updating the component's display
while the user is dragging, I'd like to wait until the user lets go of
the drag to update the component's display. Is there an event I can
capture that will tell me when the user releases the mouse button after
a window resize? NativeWindow.resize seems to be dispatched while the
user is resizing. While that's not what I'm looking for, I tried
watching that event and then adding a mouse up event listener to both
the stage and native window to detect when the user then lets go of the
mouse button, but a mouse up event never seems to be dispatched when the
user releases the mouse button after resizing.

Does anyone know of a good way to detect this or know of a creative
workaround? Thanks!

Aaron

 




Re: [flexcoders] Drag-n-dropping images from Mac OS to AIR app

2009-01-08 Thread Lushen Wu
Jeff,

File.nativePath is really funky on unix machines. I would try
img1.source = tempImg.url

of course, you didn't mention exactly what the breakdown was or what 
behavior did happen, but that might help..

Lushen


Jeff Hindman wrote:

 AIR gurus,

 The following code in my AIR app works fine on a PC, but not on a
 Mac:

 protected function handleDragEnter(event:NativeDragEvent):void {
 if (event.clipboard.hasFormat
 (ClipboardFormats.FILE_LIST_FORMAT)) {
 NativeDragManager.acceptDragDrop(event.currentTarget as
 InteractiveObject);}
 }

 protected function handleDrop(event:NativeDragEvent):void {
 var temp:Object = event.clipboard.getData
 (ClipboardFormats.FILE_LIST_FORMAT);
 var tempImg:File = temp[0] as File;
 if (tempImg.extension == jpg || tempImg.extension == JPG ||
 tempImg.extension == gif || tempImg.extension == GIF ||
 tempImg.extension == png || tempImg.extension == 'PNG') {
 img1.source = tempImg.nativePath;
 img1.maintainAspectRatio = true;
 } else {
 Alert.show(File is not an image., Oops!);
 }

 Any clues (or directionts to further research) would be greatly
 appreciated.

 Thanks!

 --jake
 }

  



Re: [flexcoders] Re: Embedding HTML page into Flex using Adobe AIR

2008-12-28 Thread Lushen Wu

Hi Siva,

If you know the link you are trying to download you can just parse the 
straight html text, get the link, then submit a URLRequest for it.
If the user is browsing to arbitrary pages and clicking arbitrary 
things, you can do a hack solution by parsing every page he lands on 
then when you detect a mouseclick (not sure if this is possible within 
the HTMLRenderer, but if it's not you can render an invisible Sprite 
over it and detect mouseClick), then presenting a little dialog with all 
the possible a href's that you parsed out for the user to select...


Also, If it's a straight a href tag and not some server side script 
that's serving up the file, I think the HTMLRenderer's location property 
changes to the file URL (blah.zip) when user clicks, so when you detect 
non-web extensions in the HTMLRenderer just initiate a URLRequest for it...



hope that helps,
Lushen


On 12/23/2008 11:04 PM, shiv_indian wrote:


Hi Alex,

This is one of requirement from our customer. Is there any
alternative for ExternalInterface or is there any feature in
mx:HTML tag to download files / attachments.

Thanks  Regards,
Siva Kumar

--- In flexcoders@yahoogroups.com 
mailto:flexcoders%40yahoogroups.com, Alex Harui aha...@... wrote:


 If the embedded HTML contains Javascript that is trying to use
ExternalInterface, that won't work, but I don't understand why you
would need that to download a file.

 From: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
[mailto:flexcoders@yahoogroups.com 
mailto:flexcoders%40yahoogroups.com] On Behalf Of shiv_indian

 Sent: Tuesday, December 23, 2008 2:35 AM
 To: flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com
 Subject: [flexcoders] Embedding HTML page into Flex using Adobe AIR


 Hi,

 This is Siva Kumar. Need help in embedding an HTML in Flex . We
 are using Adobe Air using Flex. To embed an HTML in Flex we used
 mx:HTML tag. Its working fine but whts the problem is its not
 allowing to download files / attachements. To download attachments
 do I need to change any files in flex. I tried to use google flex
 iframes to resolve this issue. I am able to download
 files/attachments if I open application as web / standalone. If I
 try to open same application using adobe air its giving error like

  ExternalInterface is not available in this container. Internet
 Explorer ActiveX, Firefox, Mozilla 1.7.5 and greater, or other
 browsers that support NPRuntime are required. .

 Later wht I found is at present ExternalInterface is not supporting
 adobe air.

 Could anybody help me to resolve this issue. If anybody has any
 idea on how to overcome this issue. Please suggest me to resolve
 this issue. Thanks in Advance.


 




Re: [flexcoders] Re: How to know which DisplayObjects are underneath another?

2008-12-28 Thread Lushen Wu
you can check for overlapping circles (naively) with hitTest for each 
circle to all the otherones.


whenever there's overlap, call var rect:Rectangle = getRect() for both 
objects. if one of them has a lower X and lower Y AND its rect.right and 
rect.bottom are greater than the other one, hide the other one...




On 12/24/2008 2:07 PM, huhgawz wrote:


Thanks for you fast response. Your suggestion works but it is not what
I'm looking for. I'm sorry I guess I didn't explain well.

So here I come again:

Taking into account my previous example (the one with a Canvas and
multiple Circles positioned randomly)...I need to hide all those
Circles that are totally overlapped by other Circles.

Could someone help me with this?

--- In flexcoders@yahoogroups.com 
mailto:flexcoders%40yahoogroups.com, Lushen Wu l...@... wrote:


 huhgawz,

 I think most UIComponents subclass DisplayObjectContainer, which has a
 method

 getChildIndex #getChildIndex%28%29(child:DisplayObject
 ../../flash/display/DisplayObject.html):int ../../int.html

 so call this to find the child index (basically z-order) of the
 lowest-ordered circle you want to have visible,

 then iterate all the Children underneath that index using the property
 numChildren and method getChildAt #getChildAt%28%29(index:int
 ../../int.html):DisplayObject ../../flash/display/DisplayObject.html
 and set them visible=false

 ref:

http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectContainer.html 
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectContainer.html



 Hope that helps..

 Lushen


 On 12/24/2008 12:50 PM, huhgawz wrote:
 
  Let's say you have a /Canvas/ in which you create multiple instances
  of a /Circle/ randomly positioned. Then you want to know which
  /Circles/ are underneath the top most /Circle/ (talking in /z-order/
  terms) in order to hide them all.
 
  Could you share an example of this?
 
  I would really appreciate any guidance
 
 


 




Re: [flexcoders] How to know which DisplayObjects are underneath another?

2008-12-24 Thread Lushen Wu

huhgawz,

I think most UIComponents subclass DisplayObjectContainer, which has a 
method


getChildIndex #getChildIndex%28%29(child:DisplayObject 
../../flash/display/DisplayObject.html):int ../../int.html


so call this to find the child index (basically z-order) of the 
lowest-ordered circle you want to have visible,


then iterate all the Children underneath that index using the property 
numChildren and method  getChildAt #getChildAt%28%29(index:int 
../../int.html):DisplayObject ../../flash/display/DisplayObject.html

and set them visible=false

ref:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/flash/display/DisplayObjectContainer.html


Hope that helps..

Lushen


On 12/24/2008 12:50 PM, huhgawz wrote:


Let's say you have a /Canvas/ in which you create multiple instances 
of a /Circle/ randomly positioned. Then you want to know which 
/Circles/ are underneath the top most /Circle/ (talking in /z-order/ 
terms) in order to hide them all.


Could you share an example of this?

I would really appreciate any guidance

 




[flexcoders] Media startup is hiring ..

2008-12-23 Thread Lushen Wu
Hi all,

I just recently joined the group and am wondering what [flexcoders] 
policy is for job postings on-list.
If anybody has hiring-success stories please share...

I'm running a boston-based media startup with a near-alpha AIR client.
Please contact me if that sounds the least bit exciting  : )

Happy Holidays!

Lushen Wu
m: 701 330 5589