[flexcoders] How do you load a page in a tab
How do you open a url in a tab? This is what you use for a page: navigateToURL(new URLRequest(url),'_blank'); dorkie dork from dorktown
Re: [flexcoders] How do you load a page in a tab
As far as I know, this is not a supported action. You cannot choose to open a link in a tab, as it's not standard to have tabs in a browser. Even if this is very common now. It's up to the user to choose the option, for exemple, to force new windows to open in a tab. Maybe I'm wrong.. let's see what will think other people. Good luck On Sat, Nov 15, 2008 at 9:28 AM, dorkie dork from dorktown [EMAIL PROTECTED] wrote: How do you open a url in a tab? This is what you use for a page: navigateToURL(new URLRequest(url),'_blank'); dorkie dork from dorktown -- Rita Rudner - My mother buried three husbands - and two of them were only napping.
[flexcoders] PopUpMenuButton like a combobox
Hello, I have hierarchical data nicely binding to a PopUpMenuButton which I'm using on form. I've managed to create a handler that changes the label when an item is selected but can't seem to figure out how to pre-set the value of the PopUpMenuButton when the user wants to edit an existing record. Try something like this but it didn't work Menu(categoryPopUpMenuButton.popUp).selectedItem = _posting.category; Thanks, Arshak
[flexcoders] Advanced datagrid dataprovider changing error
Hi I am trying to change the dataprovider of a advanced datagrid where I am using HierarchicalData as data provider. My ADG code is this: mx:AdvancedDataGrid width=20% height=50% mx:dataProvider mx:HierarchicalData id=HD source={dpHierarchy}/ /mx:dataProvider mx:columns mx:AdvancedDataGridColumn dataField=Region/ /mx:columns /mx:AdvancedDataGrid I tried to switch the dataprovider as HD.source = anotherArray; But it did not work. Here I am attaching the code if that helps to find the mistake. *** *** *** ?xml version=1.0? !-- dpcontrols/adg/SimpleHierarchicalADG.mxml -- mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:Script ![CDATA[ import mx.collections.ArrayCollection; //include SimpleHierarchicalData.as; [Bindable] private var dpHierarchy:ArrayCollection = new ArrayCollection([ {Region:Southwest, children: [ {Region:Arizona, children: [ {Region:Barbara Jennings, Actual:38865, Estimate:4}, {Region:Dana Binn, Actual:29885, Estimate:3}]}, {Region:Central California, children: [ {Region:Joe Smith, Actual:29134, Estimate:3}]}, {Region:Nevada, children: [ {Region:Bethany Pittman, Actual:52888, Estimate:45000}]}, {Region:Northern California, children: [ {Region:Lauren Ipsum, Actual:38805, Estimate:4}, {Region:T.R. Smith, Actual:55498, Estimate:4}]}, {Region:Southern California, children: [ {Region:Alice Treu, Actual:44985, Estimate:45000}, {Region:Jane Grove, Actual:44913, Estimate:45000}]} ]} ]); [Bindable] private var dpHierarchy1:ArrayCollection = new ArrayCollection([ {Region:Southwest1, children: [ {Region:Arizona, children: [ {Region:Barbara Jennings, Actual:38865, Estimate:4}, {Region:Dana Binn, Actual:29885, Estimate:3}]}, {Region:Central California, children: [ {Region:Joe Smith, Actual:29134, Estimate:3}]}, {Region:Nevada, children: [ {Region:Bethany Pittman, Actual:52888, Estimate:45000}]}, {Region:Northern California, children: [ {Region:Lauren Ipsum, Actual:38805, Estimate:4}, {Region:T.R. Smith, Actual:55498, Estimate:4}]}, {Region:Southern California, children: [ {Region:Alice Treu, Actual:44985, Estimate:45000}, {Region:Jane Grove, Actual:44913, Estimate:45000}]} ]} ]); ]] /mx:Script mx:AdvancedDataGrid width=20% height=50% mx:dataProvider mx:HierarchicalData id=HD source={dpHierarchy}/ /mx:dataProvider mx:columns mx:AdvancedDataGridColumn dataField=Region/ /mx:columns /mx:AdvancedDataGrid mx:Button label=Button click=HD.source = dpHierarchy/ mx:Button label=Button click=HD.source = dpHierarchy/ /mx:Application
Re: [flexcoders] Advanced datagrid dataprovider changing error
Hi, Try calling validateNow on the DG after setting the DP source. Or you might have to actually change the DP to a new HierarchicalData. cheers, hworke wrote: Hi I am trying to change the dataprovider of a advanced datagrid where I am using HierarchicalData as data provider. My ADG code is this: mx:AdvancedDataGrid width=20% height=50% mx:dataProvider mx:HierarchicalData id=HD source={dpHierarchy}/ /mx:dataProvider mx:columns mx:AdvancedDataGridColumn dataField=Region/ /mx:columns /mx:AdvancedDataGrid I tried to switch the dataprovider as HD.source = anotherArray; But it did not work. Here I am attaching the code if that helps to find the mistake. *** *** *** ?xml version=1.0? !-- dpcontrols/adg/SimpleHierarchicalADG.mxml -- mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:Script ![CDATA[ import mx.collections.ArrayCollection; //include SimpleHierarchicalData.as; [Bindable] private var dpHierarchy:ArrayCollection = new ArrayCollection([ {Region:Southwest, children: [ {Region:Arizona, children: [ {Region:Barbara Jennings, Actual:38865, Estimate:4}, {Region:Dana Binn, Actual:29885, Estimate:3}]}, {Region:Central California, children: [ {Region:Joe Smith, Actual:29134, Estimate:3}]}, {Region:Nevada, children: [ {Region:Bethany Pittman, Actual:52888, Estimate:45000}]}, {Region:Northern California, children: [ {Region:Lauren Ipsum, Actual:38805, Estimate:4}, {Region:T.R. Smith, Actual:55498, Estimate:4}]}, {Region:Southern California, children: [ {Region:Alice Treu, Actual:44985, Estimate:45000}, {Region:Jane Grove, Actual:44913, Estimate:45000}]} ]} ]); [Bindable] private var dpHierarchy1:ArrayCollection = new ArrayCollection([ {Region:Southwest1, children: [ {Region:Arizona, children: [ {Region:Barbara Jennings, Actual:38865, Estimate:4}, {Region:Dana Binn, Actual:29885, Estimate:3}]}, {Region:Central California, children: [ {Region:Joe Smith, Actual:29134, Estimate:3}]}, {Region:Nevada, children: [ {Region:Bethany Pittman, Actual:52888, Estimate:45000}]}, {Region:Northern California, children: [ {Region:Lauren Ipsum, Actual:38805, Estimate:4}, {Region:T.R. Smith, Actual:55498, Estimate:4}]}, {Region:Southern California, children: [ {Region:Alice Treu, Actual:44985, Estimate:45000}, {Region:Jane Grove, Actual:44913, Estimate:45000}]} ]} ]); ]] /mx:Script mx:AdvancedDataGrid width=20% height=50% mx:dataProvider mx:HierarchicalData id=HD source={dpHierarchy}/ /mx:dataProvider mx:columns mx:AdvancedDataGridColumn dataField=Region/ /mx:columns /mx:AdvancedDataGrid mx:Button label=Button click=HD.source = dpHierarchy/ mx:Button label=Button click=HD.source = dpHierarchy/ /mx:Application
[flexcoders] Re: Success!!! But I still need help!! (RE: Custom scrolling with TileList)
I realize this post is over 2 years old, but I'm having a similar problem, and I can't find much info out there. I'm using a TileList control, and I've added buttons to the top and bottom and removed the scroll bars. I'd like buttons to smoothly scroll in the new images, but right now it just flashes to the new timesI'd like something like the way the image scroll bar works on pictobrowser: http://www.db798.com/pictobrowser/samples.html But I'm not sure where to place the transition effects, or which effects to use. Any information or tips would be really helpful. Thanks, Rob --- In flexcoders@yahoogroups.com, qnotemedia [EMAIL PROTECTED] wrote: Well - never received a reply to this thread, but I've figured out how to get the look, feel, and interactivity that I wanted via lots of nested Canvas', HBox's, VBox's, etc...Here's what I've basically done. Again, the goal was to make a vertical TileList with component itemRenderer, that scrolls smoothly, and rather than using the default scrollbar, create my own scrollDown and scrollUp buttons (with no scrollbar actually available - just the buttons). - I have a TileList of course, and its height is dynamically set to the number of items in the itemRenderer * 125 (an item's height). scrollingPolicy is disabled. With 75 items that makes its height. - itemRenderer consists of an image and label. The images can be large - width of 640 - and are scaled down via maxWidth/Height. - The TileList is within a VBox with scrollingPolicy disabled. - An Up/Down button calls a function that sets the verticalScrollPosition of the VBox to += 20 or -= 20 via buttonDown with autorepeat. This creates the effect of a nice smooth scroll! PROBLEM I need help with now: Performance has become an issue. When the TileList contains 75 thumbnails, that makes its height nearly 10,000 (75*125)! The problem is that, to Flex, the entire list is being displayed, whereas when you normally display a smaller sized TileList, items are not loaded until they are physically displayed by the user. When it first loads, it really chokes up cause its calling to load every single thumbnail in the list all at the same time. Is there any way to fix this!? - Chris
[flexcoders] Foreign Keyboard Mappings
I have a flash application that's being used in other countries. I'm having reports that certain keys from certain keyboards are not getting translated properly. My application uses a custom equation editor that I wrote. I'm using key up and key down handlers to capture key strokes. I can't believe the flash doesn't support character translations out of the box. I know some people out there us a hidden TextField to capture the translated text, but I really don't want to do there. I suspect that will mess up a lot of my focus code and cursor movement code. Has anyone tackled this another way? One idea I had was to somehow come up with a keyboard mapping application, that would require the user to learn the keys. I would then store some sort of a lookup table inside a shared object. I'm not sure what the interface would look like, but it's an idea. Any other ideas would be appreciated.
[flexcoders] Re: Calling functions with optional parameters
--- In flexcoders@yahoogroups.com, Gordon Smith [EMAIL PROTECTED] wrote: You can write either MyClass.foo = bar; or MyClass[foo] = bar; to set a static property of a class. Cool, thanks :-). This has really been a learning week for me.
[flexcoders] self reference to component inside binding brackets?
Is there a shortcut way to reference the current component that you are using Binding Brackets with in its tags without using id ? Like using this but it would be for the current component instead of the class of the MXML file. I just feel it's redundant and tiresome when I have to retype the id of the component. This would help in situations where it's not necessary for me to bother giving the component an id. Currently I do: mx:CheckBox id=myCB click={someComponent.prop=myCB.selected} / I don't want to use this: this is a reference to the class of the MXML. mx:CheckBox click={someComponent.prop=this.selected} / -- Keith H -- www.keith-hair.net
[flexcoders] Re: Accessing a Basic Auth protected site from flex.
Thank you. This explains a lot. I had seen posts on how to do this but nowhere did I stumble on the info you provided. Specifically, that 9.0.115.0 was a version that blocks the Authorization header regardless of what you do. Guess what version I've been running? So, I will update to a more recent version and give this a try. Unfortunately while this will work for some basic auth protected systems I have to figure out what to do about network devices I'm connecting to that can't have any crossdomain file added to them. For those I may just end up setting up a proxy using something like mod_proxy. I will post the results after I try this out. -Bill --- In flexcoders@yahoogroups.com, nathanpdaniel [EMAIL PROTECTED] wrote: Add the request headers (as in the code), where userService is an HTTPService, baseUrl is the page you need to be authorized to use, and auth is the username:password (I'm assuming - I got this example from here: http://geekzguru.wordpress.com/2008/07/04/howto-add-basic- authentication-header-to-httpservice/ Also check the Adobe TechNote here: http://kb.adobe.com/selfservice/viewContent.do? externalId=kb403184sliceId=2 mx:Script ![CDATA[ import mx.utils.Base64Encoder; import mx.controls.Alert; private var baseUrl:String = http://phprestsql.sourceforge.net/tutorial/user;; private var auth:String = p126371rw:demo; private function init():void{ var encoder : Base64Encoder = new Base64Encoder(); encoder.encode(auth); userService.headers[Authorization] = Basic + encoder.toString(); deleteUser(); } ]] /mx:Script Please not - I googled for this and found everything above - I've never tried it - so I have no clue if it actually works... :D --- In flexcoders@yahoogroups.com, wdsnapper wdsnapper@ wrote: Anyone out there understand how to get Flex working with a simple Basic Auth protected REST API? If not is there a fundamental reason why this does not work in Flex? It seems like such a core basic (no pun intended) piece of functionality for a Flex app to hook up to an existing XML based service to provide a new view. --- In flexcoders@yahoogroups.com, wdsnapper wdsnapper@ wrote: I'm trying to access a basic auth protected site from Flex and not having any success. I see that you can no longer add the Authorization header as you could over a year ago. The setCredentials and setRemoteCredentials methods in the HTTPService class seem like they should do the trick but I've had no luck with them. Does someone out there have a pointer to a functional example showing how to use Basic Auth from Flex? I've seen a lot of posts in this forum but have been unable to find a solution. Thanks in advance.
[flexcoders] Re: Referring to parent in components
Rather than give a short anser I'd suggest you read Ted Patricks's blog post on acquisition. http://www.onflex.org/ted/2007/01/acquisition-within-flex.php --- In flexcoders@yahoogroups.com, chrycheng [EMAIL PROTECTED] wrote: Is it alright for a component to make references to its parent via the parent property? Wouldn't this go against the principles of encapsulation/abstraction?
[flexcoders] XMLList to Number
I'm decoding some XML and want to detect whether a particular element (whose text should be a number) is present and use a default number if it isn't. It seems that if node.min is not present the expression still returns an XMLList, so I'm doing something like this: private static function decodeNumber(value:XMLList):Number { if (value.length() 1) { return NaN; } else { return new Number(value); } Are there some E4X tricks I'm missing? More generally, any good XML decoders that work with a class map so I can get typed AS objects?
Re: [flexcoders] self reference to component inside binding brackets?
Hello Keith! Try this: mx:Button label=Hello click=trace(event.target.label)/ so in your case, it might look something like this. You might need to cast. mx:CheckBox click={someComponent.prop=event.target.selected} / event.target will point to the component that was clicked. Thanks -Pat www.DataNotion.com Information By Design On Sat, Nov 15, 2008 at 12:30 PM, Keith [EMAIL PROTECTED] wrote: Is there a shortcut way to reference the current component that you are using Binding Brackets with in its tags without using id ? Like using this but it would be for the current component instead of the class of the MXML file. I just feel it's redundant and tiresome when I have to retype the id of the component. This would help in situations where it's not necessary for me to bother giving the component an id. Currently I do: mx:CheckBox id=myCB click={someComponent.prop=myCB.selected} / I don't want to use this: this is a reference to the class of the MXML. mx:CheckBox click={someComponent.prop=this.selected} / -- Keith H -- www.keith-hair.net
Re: [flexcoders] self reference to component inside binding brackets?
Keith: Sorry, hit send to quick and forgot to mention that I you don't need the binding brackets anyway, because a Click event is not bound but called on each click. See my first example. On Sat, Nov 15, 2008 at 5:41 PM, Pat Buchanan [EMAIL PROTECTED] wrote: Hello Keith! Try this: mx:Button label=Hello click=trace(event.target.label)/ so in your case, it might look something like this. You might need to cast. mx:CheckBox click={someComponent.prop=event.target.selected} / event.target will point to the component that was clicked. Thanks -Pat www.DataNotion.com Information By Design On Sat, Nov 15, 2008 at 12:30 PM, Keith [EMAIL PROTECTED] wrote: Is there a shortcut way to reference the current component that you are using Binding Brackets with in its tags without using id ? Like using this but it would be for the current component instead of the class of the MXML file. I just feel it's redundant and tiresome when I have to retype the id of the component. This would help in situations where it's not necessary for me to bother giving the component an id. Currently I do: mx:CheckBox id=myCB click={someComponent.prop=myCB.selected} / I don't want to use this: this is a reference to the class of the MXML. mx:CheckBox click={someComponent.prop=this.selected} / -- Keith H -- www.keith-hair.net
[flexcoders] Export high res png from flex
Hey Everyone, I'm trying to come up with a clever way to export a high res (300dpi) .png image from flex to be saved on my server and later printed. The initial bitmapdata is being taken from a 400x400 pixel Canvas container. I then use the PNGEncoder class to turn the bitmapdata into a bytearray and then send it on to the server. The issue is that the .png output is at 400x400 pixels. The contents of the Canvas are all in .swf (vector) format so I thought simply setting the scaleX/Y properties to 4 prior to exporting might do the trick, but I have not yet had any luck with this. Any ideas would be greatly appreciated. Thanks, Kyle
[flexcoders] Help with Binding
In the following code, the localProductId binding fails. Why? The 1st alert pops with a new value for the variable (indicating that it is changing). But the second alert never pops. Attach Code [Bindable] public var localProductsAC:ArrayCollection = new ArrayCollection; [Bindable] public var localVersionsAC:ArrayCollection = new ArrayCollection; [Bindable] public var localReleasesAC:ArrayCollection = new ArrayCollection; [Bindable] public var localProductId:uint; [Bindable] public var localVersionId:uint; public function myCreationComplete():void { //bind local products AC to VML source BindingUtils.bindSetter(productResult, PrdVML.getInstance (), sourcePrdVOList); //bind version refresh to product id change BindingUtils.bindSetter(versionRefresh, this, localProductId); //bind local versions AC to VML source BindingUtils.bindSetter(versionResult, VrsVML.getInstance (), sourceVrsVOList); productRefresh(); } public function productRefresh():void { //fetch the list of products var outEvent:CairngormEvent = new CairngormEvent (PrdController.FETCH_ALL); CairngormEventDispatcher.getInstance().dispatchEvent(outEvent); } public function productResult(value:ArrayCollection):void { localProductsAC = value; localProductId = value.getItemAt(0).PrdId; Alert.show(String(localProductId)); } public function versionRefresh(value:uint):void { //fetch versions Alert.show('hit'); var fetchVersionsEvent:MyEvent = new MyEvent (VrsController.FETCH_FOR_PRODUCT); fetchVersionsEvent.eventObject = {PrdId:localProductId}; CairngormEventDispatcher.getInstance().dispatchEvent (fetchVersionsEvent); }
[flexcoders] Re: Export high res png from flex
Hi Kyle - I don't think the scaleX/Y actually changes the size of the canvas, so what you want might want to try is actually resizing the container. If for some reason you can't do that, maybe you could copy the contents into a new canvas that is not visible then resize that one. I'm curious how you will get the byteArray to the server though...I've been trying to do this using a REST upload interface, and I haven't had any luck. Rob --- In flexcoders@yahoogroups.com, Kyle [EMAIL PROTECTED] wrote: Hey Everyone, I'm trying to come up with a clever way to export a high res (300dpi) .png image from flex to be saved on my server and later printed. The initial bitmapdata is being taken from a 400x400 pixel Canvas container. I then use the PNGEncoder class to turn the bitmapdata into a bytearray and then send it on to the server. The issue is that the .png output is at 400x400 pixels. The contents of the Canvas are all in .swf (vector) format so I thought simply setting the scaleX/Y properties to 4 prior to exporting might do the trick, but I have not yet had any luck with this. Any ideas would be greatly appreciated. Thanks, Kyle
[flexcoders] Re: HTTP request error
It sounds as though only local admins have permission to the directories and files in your web directories. You might want to check permissions on the files and folders, and make sure that regular users also have permissions. --- In flexcoders@yahoogroups.com, markgoldin_2000 [EMAIL PROTECTED] wrote: Ok, I have run more tests. I have found out that if I add a user that I use for testing to a local admin of my test box then it works. Not like this is a solution but at least now I know where the problem is. Any ideas I can use to have my test box serving other then me only users? --- In flexcoders@yahoogroups.com, markgoldin_2000 markgoldin_2000@ wrote: When I am setting up HTTPService I am using a string I have showed below: http://servername/web directory/subfolder/asppage.asp with a few parameters. And then from Browser: http://servername/web directory/startpage.html --- In flexcoders@yahoogroups.com, valdhor stevedepp@ wrote: So what is the code to produce this error? There are many places you can use a URI in Flex. --- In flexcoders@yahoogroups.com, markgoldin_2000 markgoldin_2000@ wrote: HTTP request error in a small alert box. --- In flexcoders@yahoogroups.com, Tracy Spratt tspratt@ wrote: What error? Tracy From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of markgoldin_2000 Sent: Friday, November 14, 2008 4:34 PM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: HTTP request error Nobody has run into this problem? I have googled this error, did not find anything that helped. Please help. --- In flexcoders@yahoogroups.com mailto:flexcoders% 40yahoogroups.com , markgoldin_2000 markgoldin_2000@ wrote: I am getting this error when I am trying to access my web site from computers that are not running under my name. This my url in flex: http://servername/web http://servername/web directory/subfolder/asppage.asp In the browser I am using the following: http://servername/web http://servername/web directory/startpage.html Works for me from different computers but not for other users. Can someone help, please?
Re: [flexcoders] self reference to component inside binding brackets?
Thanks Pat, Sorry I used a bad example earlier, yes I could do that with events but I meant like using it in other properties that event is not available. . Here's a better example situation where I'd wish for a shortcut self reference to each component. For example if I wanted to assign the current component's height in a Binding expression for the current component's width property. mx:CheckBox width={self.height} / -- Keith H -- www.keith-hair.net Pat Buchanan wrote: Keith: Sorry, hit send to quick and forgot to mention that I you don't need the binding brackets anyway, because a Click event is not bound but called on each click. See my first example. On Sat, Nov 15, 2008 at 5:41 PM, Pat Buchanan [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hello Keith! Try this: mx:Button label=Hello click=trace(event.target.label)/ so in your case, it might look something like this. You might need to cast. mx:CheckBox click={someComponent.prop=event.target.selected} / event.target will point to the component that was clicked. Thanks -Pat www.DataNotion.com http://www.DataNotion.com Information By Design On Sat, Nov 15, 2008 at 12:30 PM, Keith [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Is there a shortcut way to reference the current component that you are using Binding Brackets with in its tags without using id ? Like using this but it would be for the current component instead of the class of the MXML file. I just feel it's redundant and tiresome when I have to retype the id of the component. This would help in situations where it's not necessary for me to bother giving the component an id. Currently I do: mx:CheckBox id=myCB click={someComponent.prop=myCB.selected} / I don't want to use this: this is a reference to the class of the MXML. mx:CheckBox click={someComponent.prop=this.selected} / -- Keith H -- www.keith-hair.net http://www.keith-hair.net