Re: [flexcoders] my SWFLoader wont give me the correct width and height
I don't think that's necessarily correct because as I mentioned the $width and $height protected values are correctly set by the time the COMPLETE event is dispatched. So the values are known, they just aren't being updated until the time of the UPDATE_COMPLETE event. Jamie On Thu, Jun 18, 2009 at 10:25 PM, Alex Haruiaha...@adobe.com wrote: I don’t think there is a way to force SWFLoader to know its width when it dispatches the COMPLETE event. That event means the bytes are downloaded, but they may not be fully consumed yet. However, it should be available on the UPDATE_COMPLETE that follows the COMPLETE event. Alex Harui Flex SDK Developer Adobe Systems Inc. Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Jamie S Sent: Thursday, June 18, 2009 6:05 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] my SWFLoader wont give me the correct width and height That sorta works. It's a way of getting notified when the properties do finally get updated . But i still have to do if( swfLoader.width !=0 swfLoader.height != 0 ){ ... }. And since I really only need to run that piece of code once, I would have to remove the listener after the code successfully gets executed. I still don't understand why calling swfLoader.validateNow() does not work when I try to call it in the 'complete' handler. Jamie On Thu, Jun 18, 2009 at 5:29 PM, Gordon Smithgosm...@adobe.com wrote: Try checking the values in an updateComplete handler. Gordon Smith Adobe Flex SDK Team From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Jamie S Sent: Thursday, June 18, 2009 3:27 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] my SWFLoader wont give me the correct width and height I'm using a SWFLoader to load in an image and i have a handler function for COMPLETE. In this load complete handler, i'm trying to get the size of the SWFLoader instance by using swfLoader.width, swfLoader.height but it always gives me 0. if I set a breakpoint, i can see that the $width and $height protected properties are correct but no matter what I do I can't get the public width and height properties to update. i've tried using validateNow(), invalidateSize(), validateSize() and whatever else I can think of but the width and hight are still always 0. And I noticed that if i check the width and height at some later point in the program, the values are correct. Does anybody know how to force SWFLoader to update its width and height? Jamie -- Flexcoders Mailing List FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt Alternative FAQ location: https://share.acrobat.com/adc/document.do?docid=942dbdc8-e469-446f-b4cf-1e62079f6847 Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.comYahoo! Groups Links * To visit your group on the web, go to: http://groups.yahoo.com/group/flexcoders/ * Your email settings: Individual Email | Traditional * To change settings online go to: http://groups.yahoo.com/group/flexcoders/join (Yahoo! ID required) * To change settings via email: mailto:flexcoders-dig...@yahoogroups.com mailto:flexcoders-fullfeatu...@yahoogroups.com * To unsubscribe from this group, send an email to: flexcoders-unsubscr...@yahoogroups.com * Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
RE: [flexcoders] my SWFLoader wont give me the correct width and height
Try checking the values in an updateComplete handler. Gordon Smith Adobe Flex SDK Team From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Jamie S Sent: Thursday, June 18, 2009 3:27 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] my SWFLoader wont give me the correct width and height I'm using a SWFLoader to load in an image and i have a handler function for COMPLETE. In this load complete handler, i'm trying to get the size of the SWFLoader instance by using swfLoader.width, swfLoader.height but it always gives me 0. if I set a breakpoint, i can see that the $width and $height protected properties are correct but no matter what I do I can't get the public width and height properties to update. i've tried using validateNow(), invalidateSize(), validateSize() and whatever else I can think of but the width and hight are still always 0. And I noticed that if i check the width and height at some later point in the program, the values are correct. Does anybody know how to force SWFLoader to update its width and height? Jamie
Re: [flexcoders] my SWFLoader wont give me the correct width and height
That sorta works. It's a way of getting notified when the properties do finally get updated . But i still have to do if( swfLoader.width !=0 swfLoader.height != 0 ){ ... }. And since I really only need to run that piece of code once, I would have to remove the listener after the code successfully gets executed. I still don't understand why calling swfLoader.validateNow() does not work when I try to call it in the 'complete' handler. Jamie On Thu, Jun 18, 2009 at 5:29 PM, Gordon Smithgosm...@adobe.com wrote: Try checking the values in an updateComplete handler. Gordon Smith Adobe Flex SDK Team From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Jamie S Sent: Thursday, June 18, 2009 3:27 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] my SWFLoader wont give me the correct width and height I'm using a SWFLoader to load in an image and i have a handler function for COMPLETE. In this load complete handler, i'm trying to get the size of the SWFLoader instance by using swfLoader.width, swfLoader.height but it always gives me 0. if I set a breakpoint, i can see that the $width and $height protected properties are correct but no matter what I do I can't get the public width and height properties to update. i've tried using validateNow(), invalidateSize(), validateSize() and whatever else I can think of but the width and hight are still always 0. And I noticed that if i check the width and height at some later point in the program, the values are correct. Does anybody know how to force SWFLoader to update its width and height? Jamie
RE: [flexcoders] my SWFLoader wont give me the correct width and height
I don't think there is a way to force SWFLoader to know its width when it dispatches the COMPLETE event. That event means the bytes are downloaded, but they may not be fully consumed yet. However, it should be available on the UPDATE_COMPLETE that follows the COMPLETE event. Alex Harui Flex SDK Developer Adobe Systems Inc.http://www.adobe.com/ Blog: http://blogs.adobe.com/aharui From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Jamie S Sent: Thursday, June 18, 2009 6:05 PM To: flexcoders@yahoogroups.com Subject: Re: [flexcoders] my SWFLoader wont give me the correct width and height That sorta works. It's a way of getting notified when the properties do finally get updated . But i still have to do if( swfLoader.width !=0 swfLoader.height != 0 ){ ... }. And since I really only need to run that piece of code once, I would have to remove the listener after the code successfully gets executed. I still don't understand why calling swfLoader.validateNow() does not work when I try to call it in the 'complete' handler. Jamie On Thu, Jun 18, 2009 at 5:29 PM, Gordon Smithgosm...@adobe.commailto:gosmith%40adobe.com wrote: Try checking the values in an updateComplete handler. Gordon Smith Adobe Flex SDK Team From: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com [mailto:flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com] On Behalf Of Jamie S Sent: Thursday, June 18, 2009 3:27 PM To: flexcoders@yahoogroups.commailto:flexcoders%40yahoogroups.com Subject: [flexcoders] my SWFLoader wont give me the correct width and height I'm using a SWFLoader to load in an image and i have a handler function for COMPLETE. In this load complete handler, i'm trying to get the size of the SWFLoader instance by using swfLoader.width, swfLoader.height but it always gives me 0. if I set a breakpoint, i can see that the $width and $height protected properties are correct but no matter what I do I can't get the public width and height properties to update. i've tried using validateNow(), invalidateSize(), validateSize() and whatever else I can think of but the width and hight are still always 0. And I noticed that if i check the width and height at some later point in the program, the values are correct. Does anybody know how to force SWFLoader to update its width and height? Jamie