[flexcoders] Stage listeners not hearing key_down events.
Does anyone have an example of getting the stage or any display object to listen to all Key_Down events, even with items on the displayList. Here is my code, which works for the mouse_down event, but keydown is going unnoticed. Any clues as to why that this is? Application.application.stage.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDownEvent); Application.application.stage.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownEvent); also the mouse_down works in this version as well, but not the key_down. firstdisplayobject.visual.addEventListener(KeyboardEvent.KEY_DOWN, onKeyDownEvent); firstdisplayobject.visual.addEventListener(MouseEvent.MOUSE_DOWN, onMouseDownEvent); TIA thanks, CompletelyFrustrated
[flexcoders] Can you put a UIComponent in a Sprite
Is it possible to put a UIComponent in a Sprite? I assume not since Sprite is lower on the chain and since it doesn't contain the timeline. Yes? No?
[flexcoders] Re: Can you put a UIComponent in a Sprite
I am working with library that is all AS3 and is Sprite based to keep the overhead down. I would like to put more expressive items (flex components) in the application without hand coding them all. J --- In flexcoders@yahoogroups.com, Ryan Graham ryan.gra...@... wrote: Sure it's possible... Sprite.addChild() takes a DisplayObject as a parameter, and both Sprite and UIComponent are DisplayObjects: UIComponent FlexSprite http://livedocs.adobe.com/flex/3/langref/mx/core/FlexSprite.html Sprite http://livedocs.adobe.com/flex/3/langref/flash/display/Sprite.html DisplayObjectContainer http://livedocs.adobe.com/flex/3/langref/flash/display/DisplayObjectCon tainer.html InteractiveObject http://livedocs.adobe.com/flex/3/langref/flash/display/InteractiveObjec t.html DisplayObject http://livedocs.adobe.com/flex/3/langref/flash/display/DisplayObject.ht ml EventDispatcher http://livedocs.adobe.com/flex/3/langref/flash/events/EventDispatcher.h tml Object http://livedocs.adobe.com/flex/3/langref/Object.html Can't say flex will like it so much though. What are you trying to do? HTH, Ryan From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf Of Jason Ervin Sent: Tuesday, February 03, 2009 4:26 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Can you put a UIComponent in a Sprite Is it possible to put a UIComponent in a Sprite? I assume not since Sprite is lower on the chain and since it doesn't contain the timeline. Yes? No? This message is private and confidential. If you have received it in error, please notify the sender and remove it from your system.
[flexcoders] Flash Player 10: FileReference.save Security User event
Does anyone know if there is a way around the security feature of FileReference that requires a user event in order to execute FileReference.save? I have method that is called via a buttons click event, but this original eventhandler function calls three more functions via callLater (passing in the original event as an argument to callLater), but I still get the error telling me that when calling FileReference.save it has to be called because of a user event (gesture). I am I wrong to think that passing the initial click event along with callLater should be enough to pass the security requirement? Thanks, Jason
[flexcoders] Access a swf's properties.
So I have this function which calls another function and returns an object of type class (which is actually a .swf). Then I return the found object as Class to something else that called the geticon function. private function geticon(item:Object):Class { var image:Class = Images.resource([EMAIL PROTECTED]); return image; } But what I need to do is once I get the image:Class (which is a swf) I need to alter the size of the found object. Something like this. private function geticon(item:Object):Class { var image:Class = Images.resource([EMAIL PROTECTED]); image.width = 10; image.height = 10; return image; } The problem is image:Class doesn't have w or h properties. I tried this DisplayObject(image).width =10; but I get a runtime error saying can't convert swf to type DisplayObject. Thanks in advance for your help.
[flexcoders] Re: Access a swf's properties.
I ran getQualifiedClassName and it came back with: custom__embed_css_assets_images_bigthing_swf_893847107 which is the directory path to the .swf object (image composed in flash and exported to swf). In this case the bigthing.swf file. The issue isn't what image is it is how can I cast it or put it in another container so I can scale the container thus the image. --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: A SWF isn't a Class so something is already off-track. Call getQualifiedClassName on image to see what it really is. Or use ObjectUtil.getClassInfo From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jason Ervin Sent: Friday, August 01, 2008 9:37 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Access a swf's properties. So I have this function which calls another function and returns an object of type class (which is actually a .swf). Then I return the found object as Class to something else that called the geticon function. private function geticon(item:Object):Class { var image:Class = Images.resource([EMAIL PROTECTED]); return image; } But what I need to do is once I get the image:Class (which is a swf) I need to alter the size of the found object. Something like this. private function geticon(item:Object):Class { var image:Class = Images.resource([EMAIL PROTECTED]); image.width = 10; image.height = 10; return image; } The problem is image:Class doesn't have w or h properties. I tried this DisplayObject(image).width =10; but I get a runtime error saying can't convert swf to type DisplayObject. Thanks in advance for your help.
[flexcoders] Re: Access a swf's properties.
I am following this tutorial http://kanuwadhwa.wordpress.com/2007/09/21/customize-combobox/#comment-1366 The only thing I have changed is i removed his function and am calling my own (mentioned before and again here), which brings back a class. private function geticon(item:Object):Class { var image:Class = Images.resource([EMAIL PROTECTED]); return image; } The other issue besides the size issue is I get a cannot access an null value on this code. Remember I haven't changed any of his code besides the function mentioned above. override public function set measuredWidth(value:Number):void { if (DisplayObject(displayIconObject)){ super.measuredWidth = value + (DisplayObject(displayIconObject).width+getStyle(cornerRadius)); }else{ return; } } I don't know if it mattes but my data provider is dynamic. The other issue is the one above where the selected icon shows up the correct size, but the icons in the drop List are huge (original size 100x100).
[flexcoders] Itemrenderer not showing up in combobox
Does anyone know how to get an itemrenderer in a combobox to show up when it is the selectedItem? I have an itemrenderer in a combobox that only shows up when the list is dropped down, but when you selected something nothing shows up in the labelField, the combobox just closes and the labelField is blank. What I want is instead of labelField = data.title I want something like labelField = myitemrenderer. Kind of silly on Adobe's part to just allow text. If it lets you put in an itemrenderer for the list shouldn't it show you the itemrenderer you select from the dropdown list not just a string?
[flexcoders] Re: ArrayCollection not working? Pulling out my HAIR!!!
If I can just get my xml into an array that would be great. I guess I am going to have to skip ArrayUtil and hand code this as before with proxyObject. Sure wish Adobe would update the arrayutil in Flex 3, or better yet make importing data a drag and drop operation. Would make this much simpiliar. Dragging in certain nodes from XML into an array would ease the pain. J --- In flexcoders@yahoogroups.com, Alex Harui [EMAIL PROTECTED] wrote: I don't think ArrayUtil is as smart as you wish it was. You may have to write your own conversion. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Jason Ervin Sent: Wednesday, June 06, 2007 6:50 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: ArrayCollection not working? Pulling out my HAIR!!! Well I am using one data source via the singleton pattern as I have approx. 20 screen feeding of the xml data. I am sure xml will work with that. I wanted to use an Array or Arraycollection because I am going to be using several hsliders to splice the data in arrays. I think it would be easier with an array than xml. Do you have an example of how to splice up the data with xml rather than an array? Thanks in advance for any help. J --- In flexcoders@yahoogroups.com mailto:flexcoders%40yahoogroups.com , Brendan Meutzner bmeutzner@ wrote: Any reason you're going through the trouble of converting to an ArrayCollection? The following will work with your XML data just fine... mx:ColumnChart id=mybarchart dataProvider={billData.bill} showDataTips=true paddingLeft=5 paddingRight=5 width=100% height=100% mx:horizontalAxis mx:CategoryAxis categoryField=@account/ /mx:horizontalAxis mx:series mx:ColumnSeries displayName=Electric Bill xField=@account yField=electricitybillamount / mx:ColumnSeries displayName=Gas Bill xField=@account yField=gasbillamount / mx:ColumnSeries displayName=Water Bill xField=@account yField=waterbillamount / /mx:series /mx:ColumnChart Brendan On 6/6/07, Jason Ervin jason_newport@ wrote: Hey everyone I am having issues with using an arraycollection as a dataprovider. I start with an xml variable (see below) then I convert it to an ArrayCollection using ArrayUtil.toArray and I use the result as a dataprovider. If I trace the dataprovider it prints out the xml data, but my chart is empty. Can you use ArrayUtil on xml data with this many nodes? I have spent way to much time on this. Here is what I have starting with my XML file. XML CODE START public var billData:XML = data bill account=100-1234567 monthMay-05/month activetrue/active electricitybillamount60.00/electricitybillamount gasbillamount45.00/gasbillamount waterbillamount15.00/waterbillamount totalbill120.00/totalbill electricityusage500/electricityusage gasusage71.4/gasusage waterusage200/waterusage electricityservicecharge18.00/electricityservicecharge gasservicecharge9.00/gasservicecharge waterservicecharge2.00/waterservicecharge totalserviccharge29.00/totalserviccharge electricitytax4.00/electricitytax gastax2.00/gastax watertax1.00/watertax totaltax7.00/totaltax elecperdaycost2.00/elecperdaycost gasperdaycost1.00/gasperdaycost waterperdaycost.50/waterperdaycost totalperdaycost3.50/totalperdaycost pastdueamount0.00/pastdueamount billingdays33/billingdays billdate5/01/2007/billdate budgetbillamount155.00/budgetbillamount readtypemanual/readtype elecmeterreadend152868/elecmeterreadend /bill bill account=123-2345678 monthApr-05/month activetrue/active electricitybillamount88.88/electricitybillamount gasbillamount50.00/gasbillamount waterbillamount15.00/waterbillamount totalbill115.00/totalbill electricityusage300/electricityusage gasusage62.9/gasusage waterusage189/waterusage electricityservicecharge15.00/electricityservicecharge gasservicecharge6.00/gasservicecharge waterservicecharge3.00/waterservicecharge totalserviccharge24.00/totalserviccharge electricitytax4.50/electricitytax gastax2.50/gastax watertax1.25/watertax totaltax8.25/totaltax elecperdaycost2.10/elecperdaycost gasperdaycost1.90/gasperdaycost waterperdaycost.50/waterperdaycost totalperdaycost4.50/totalperdaycost pastdueamount0.00/pastdueamount billingdays28/billingdays billdate3/29/2007/billdate budgetbillamount155.00/budgetbillamount readtypeamr/readtype elecmeterreadend150008/elecmeterreadend /bill bill account=145-3456789 monthMar-05/month activetrue/active electricitybillamount62.00/electricitybillamount gasbillamount45.10/gasbillamount waterbillamount10.00/waterbillamount totalbill118.10/totalbill electricityusage300/electricityusage gasusage50.4/gasusage waterusage210/waterusage electricityservicecharge13.00
[flexcoders] ArrayCollection not working? Pulling out my HAIR!!!
Hey everyone I am having issues with using an arraycollection as a dataprovider. I start with an xml variable (see below) then I convert it to an ArrayCollection using ArrayUtil.toArray and I use the result as a dataprovider. If I trace the dataprovider it prints out the xml data, but my chart is empty. Can you use ArrayUtil on xml data with this many nodes? I have spent way to much time on this. Here is what I have starting with my XML file. XML CODE START public var billData:XML = data bill account=100-1234567 monthMay-05/month activetrue/active electricitybillamount60.00/electricitybillamount gasbillamount45.00/gasbillamount waterbillamount15.00/waterbillamount totalbill120.00/totalbill electricityusage500/electricityusage gasusage71.4/gasusage waterusage200/waterusage electricityservicecharge18.00/electricityservicecharge gasservicecharge9.00/gasservicecharge waterservicecharge2.00/waterservicecharge totalserviccharge29.00/totalserviccharge electricitytax4.00/electricitytax gastax2.00/gastax watertax1.00/watertax totaltax7.00/totaltax elecperdaycost2.00/elecperdaycost gasperdaycost1.00/gasperdaycost waterperdaycost.50/waterperdaycost totalperdaycost3.50/totalperdaycost pastdueamount0.00/pastdueamount billingdays33/billingdays billdate5/01/2007/billdate budgetbillamount155.00/budgetbillamount readtypemanual/readtype elecmeterreadend152868/elecmeterreadend /bill bill account=123-2345678 monthApr-05/month activetrue/active electricitybillamount88.88/electricitybillamount gasbillamount50.00/gasbillamount waterbillamount15.00/waterbillamount totalbill115.00/totalbill electricityusage300/electricityusage gasusage62.9/gasusage waterusage189/waterusage electricityservicecharge15.00/electricityservicecharge gasservicecharge6.00/gasservicecharge waterservicecharge3.00/waterservicecharge totalserviccharge24.00/totalserviccharge electricitytax4.50/electricitytax gastax2.50/gastax watertax1.25/watertax totaltax8.25/totaltax elecperdaycost2.10/elecperdaycost gasperdaycost1.90/gasperdaycost waterperdaycost.50/waterperdaycost totalperdaycost4.50/totalperdaycost pastdueamount0.00/pastdueamount billingdays28/billingdays billdate3/29/2007/billdate budgetbillamount155.00/budgetbillamount readtypeamr/readtype elecmeterreadend150008/elecmeterreadend /bill bill account=145-3456789 monthMar-05/month activetrue/active electricitybillamount62.00/electricitybillamount gasbillamount45.10/gasbillamount waterbillamount10.00/waterbillamount totalbill118.10/totalbill electricityusage300/electricityusage gasusage50.4/gasusage waterusage210/waterusage electricityservicecharge13.00/electricityservicecharge gasservicecharge7.00/gasservicecharge waterservicecharge1.00/waterservicecharge totalserviccharge21.00/totalserviccharge electricitytax5.00/electricitytax gastax2.20/gastax watertax1.10/watertax totaltax8.30/totaltax elecperdaycost2.20/elecperdaycost gasperdaycost1.70/gasperdaycost waterperdaycost.50/waterperdaycost totalperdaycost4.40/totalperdaycost email[EMAIL PROTECTED]/email pastdueamount0.00/pastdueamount billingdays30/billingdays billdate3/01/2007/billdate budgetbillamount155.00/budgetbillamount readtypemanual/readtype elecmeterreadend146968/elecmeterreadend /bill
[flexcoders] Re: ArrayCollection not working? Pulling out my HAIR!!!
Well I am using one data source via the singleton pattern as I have approx. 20 screen feeding of the xml data. I am sure xml will work with that. I wanted to use an Array or Arraycollection because I am going to be using several hsliders to splice the data in arrays. I think it would be easier with an array than xml. Do you have an example of how to splice up the data with xml rather than an array? Thanks in advance for any help. J --- In flexcoders@yahoogroups.com, Brendan Meutzner [EMAIL PROTECTED] wrote: Any reason you're going through the trouble of converting to an ArrayCollection? The following will work with your XML data just fine... mx:ColumnChart id=mybarchart dataProvider={billData.bill} showDataTips=true paddingLeft=5 paddingRight=5 width=100% height=100% mx:horizontalAxis mx:CategoryAxis categoryField=@account/ /mx:horizontalAxis mx:series mx:ColumnSeries displayName=Electric Bill xField=@account yField=electricitybillamount / mx:ColumnSeries displayName=Gas Bill xField=@account yField=gasbillamount / mx:ColumnSeries displayName=Water Bill xField=@account yField=waterbillamount / /mx:series /mx:ColumnChart Brendan On 6/6/07, Jason Ervin [EMAIL PROTECTED] wrote: Hey everyone I am having issues with using an arraycollection as a dataprovider. I start with an xml variable (see below) then I convert it to an ArrayCollection using ArrayUtil.toArray and I use the result as a dataprovider. If I trace the dataprovider it prints out the xml data, but my chart is empty. Can you use ArrayUtil on xml data with this many nodes? I have spent way to much time on this. Here is what I have starting with my XML file. XML CODE START public var billData:XML = data bill account=100-1234567 monthMay-05/month activetrue/active electricitybillamount60.00/electricitybillamount gasbillamount45.00/gasbillamount waterbillamount15.00/waterbillamount totalbill120.00/totalbill electricityusage500/electricityusage gasusage71.4/gasusage waterusage200/waterusage electricityservicecharge18.00/electricityservicecharge gasservicecharge9.00/gasservicecharge waterservicecharge2.00/waterservicecharge totalserviccharge29.00/totalserviccharge electricitytax4.00/electricitytax gastax2.00/gastax watertax1.00/watertax totaltax7.00/totaltax elecperdaycost2.00/elecperdaycost gasperdaycost1.00/gasperdaycost waterperdaycost.50/waterperdaycost totalperdaycost3.50/totalperdaycost pastdueamount0.00/pastdueamount billingdays33/billingdays billdate5/01/2007/billdate budgetbillamount155.00/budgetbillamount readtypemanual/readtype elecmeterreadend152868/elecmeterreadend /bill bill account=123-2345678 monthApr-05/month activetrue/active electricitybillamount88.88/electricitybillamount gasbillamount50.00/gasbillamount waterbillamount15.00/waterbillamount totalbill115.00/totalbill electricityusage300/electricityusage gasusage62.9/gasusage waterusage189/waterusage electricityservicecharge15.00/electricityservicecharge gasservicecharge6.00/gasservicecharge waterservicecharge3.00/waterservicecharge totalserviccharge24.00/totalserviccharge electricitytax4.50/electricitytax gastax2.50/gastax watertax1.25/watertax totaltax8.25/totaltax elecperdaycost2.10/elecperdaycost gasperdaycost1.90/gasperdaycost waterperdaycost.50/waterperdaycost totalperdaycost4.50/totalperdaycost pastdueamount0.00/pastdueamount billingdays28/billingdays billdate3/29/2007/billdate budgetbillamount155.00/budgetbillamount readtypeamr/readtype elecmeterreadend150008/elecmeterreadend /bill bill account=145-3456789 monthMar-05/month activetrue/active electricitybillamount62.00/electricitybillamount gasbillamount45.10/gasbillamount waterbillamount10.00/waterbillamount totalbill118.10/totalbill electricityusage300/electricityusage gasusage50.4/gasusage waterusage210/waterusage electricityservicecharge13.00/electricityservicecharge gasservicecharge7.00/gasservicecharge waterservicecharge1.00/waterservicecharge totalserviccharge21.00/totalserviccharge electricitytax5.00/electricitytax gastax2.20/gastax watertax1.10/watertax totaltax8.30/totaltax elecperdaycost2.20/elecperdaycost gasperdaycost1.70/gasperdaycost waterperdaycost.50/waterperdaycost totalperdaycost4.40/totalperdaycost email[EMAIL PROTECTED] ccoenraets%40fictitious.com/email pastdueamount0.00/pastdueamount billingdays30/billingdays billdate3/01/2007/billdate budgetbillamount155.00/budgetbillamount readtypemanual/readtype elecmeterreadend146968/elecmeterreadend /bill /data /* starting another xml document */ /* public var billData2:XML = root account id=1234567 month date=May-05 activetrue/active electricitybillamount60.00/electricitybillamount gasbillamount45.00/gasbillamount