[flexcoders] Modify binding event
Hello, all! I have a NumericStepper bound to my data model. I'd like the model to be updated *while* NumericStepper changes (e.g. while the user clicks and holds the 'up' button) instead of only making the change once the stepper loses focus. I have a feeling this requires some use of the following format: [Bindable(event=myCustomEvent)] My best guess is that I need to write listeners for the mousedown/mouseup/keydown/keyup events to detect when the user is making changes to the stepper. These listeners will dispatch 'myCustomEvent' which will cause the data model to be updated. Is this the right approach? Thanks! :) -Rich
[flexcoders] Re: Modify binding event
Update: Clicking on the buttons yields the correct behavior. The model is updated as expected, even if the button is held down. (The model updates every time the value 'steps' higher or lower). The functionality that isn't quite what I desire is when the user clicks in the associated text input box and types in a value. The model is only updated once the value is committed (e.g. enter is pressed or the stepper loses focus). However, I'd like the model to be updated on every keypress. Thoughts? Thanks, -Rich --- In flexcoders@yahoogroups.com, rinogo2 warpr...@... wrote: Hello, all! I have a NumericStepper bound to my data model. I'd like the model to be updated *while* NumericStepper changes (e.g. while the user clicks and holds the 'up' button) instead of only making the change once the stepper loses focus. I have a feeling this requires some use of the following format: [Bindable(event=myCustomEvent)] My best guess is that I need to write listeners for the mousedown/mouseup/keydown/keyup events to detect when the user is making changes to the stepper. These listeners will dispatch 'myCustomEvent' which will cause the data model to be updated. Is this the right approach? Thanks! :) -Rich
[flexcoders] How greedy/lazy is the GC?
Hi, all! I've noticed some odd behavior with my flex/flash applications - it seems that as program execution continues, the flash runtime requires increasingly more memory, even if memory leaks are theoretically eliminated. An example in one of my applications can be observed here: http://featurific.com/files/tmp/flashLazyGc.jpg The yellow line in this image tracks the memory usage of my program. As you can see, at the time of this screenshot, 10 minutes of execution have elapsed and the VM is using ~443 Mb of memory*. (*Note that in this instance, my program was running a 'stress test' designed to push the VM and my application to its limits - normal execution isn't nearly as memory/processor intensive) As you can see in this image, the program starts out on the right side of the graph with a very small memory footprint. Memory used steadily increases with long periods of overall consistency. However, eventually, around what must be about 8:00 into the test, the memory usage drops significantly and then starts to climb again. Its this final drop and the long periods of overall consistency that make me curious. These characteristics seem to suggest that the memory usage of my program is not necessarily increasing due to memory leaks, but according to Flash's whims. In my experience, memory leaks are usually accompanied by a *steady*, *unreversing* upward trend in memory usage. However, in this scenario, memory usuage increases inconsistently and even drops (around 8 minutes in the graph). This brings me to my question - is this normal for the Flash VM? My best guess for what is happening is that Flash is determining that my program is making many requests for memory, and that this memory is readily available (I'm developing with 8GB RAM). So, it allocates memory according to my program's requests, and is lazy about freeing this memory when it is no longer in use (since memory seems to be abundant on my system). This seems like a strange way to implement a VM, but then again, I've never written a garbage collector, so I'm obviously unqualified. What do you all think is going on here? Thanks so much in advance! -Rich
[flexcoders] Dynamically-Sized ItemRenderers
Hello! I'm having a hard time figuring out how to dynamically size ItemRenderers in my app. Screenshot: http://img215.imageshack.us/img215/5694/picasathumbslider.jpg This screenshot is from Picasa (not my app), but it demonstrates what I'm trying to do. The thumbnails along the top of the image are displayed in a HorizontalList, and their size is dictated by the slider (which I've circled in red). As the slider moves to the right, the thumbnails get larger, and as it moves to the left, the thumbnails get smaller. I've found some tips on how to make this work in a TileList (with columnWidth and rowHeight), but in a HorizontalList, there is no columnWidth parameter. I've also tried altering the width property in all of its varieties (e.g. explicitWidth), along with invalidating the component and dispatching an Event.RESIZE event. However, nothing I do seems to have any effect. Can someone please point me in the right direction? Thanks! :) -Rich P.S. That's Shawn White in the thumbnails, competing at last weekend's US Superpipe Finals in Park City, Utah. His run was absolutely incredible.
[flexcoders] Re: Simple Layout Question
Thanks so much for your help, James! I had never seen the constraint column/row approach before, so this is super cool. Also, it seems strange to me that the only way to get the 'indent' to be present before the buttons (when inside of the vbox) is with a spacer. Is this the recommended approach? Thanks! :) -Rich --- In flexcoders@yahoogroups.com, jamesfin james.alan.finni...@... wrote: Copy / paste this and it will help you along... ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:VBox backgroundColor=0xff mx:HBox backgroundColor=0x00ff00 mx:Button label=Test 1/ mx:Button label=Test 1/ mx:Button label=Test 1/ mx:Button label=Test 1/ /mx:HBox mx:Canvas backgroundColor=0xff width=100% id=testCanvas mx:constraintColumns mx:ConstraintColumn id=col1 width=50 / /mx:constraintColumns mx:Button id=button2 label=Test 2 left={slider.value}/ /mx:Canvas mx:HBox paddingLeft=0 horizontalGap=0 mx:Spacer width={slider.value}/ mx:Button label=Test 3 / /mx:HBox /mx:VBox mx:HSlider id=slider minimum=0 maximum={testCanvas.width - button2.width} value=200 liveDragging=true snapInterval=1 tickInterval=20 dataTipPrecision=0 / /mx:Application --- In flexcoders@yahoogroups.com, Rich Christiansen warproof@ wrote: Hey all, I just recently started working with Flex (3), and I've got a simple layout question. I've got a bunch of components inside of a vbox, and I've noticed that the vbox positions them so they are all at the same x coordinate. How can I change the x-position (e.g. the indentation) of the components? Here's some test code I've been fiddling with: ?xml version=1.0 encoding=utf-8? mx:Application xmlns:mx=http://www.adobe.com/2006/mxml; mx:VBox backgroundColor=0xff mx:HBox backgroundColor=0x00ff00 mx:Button label=Test 1/ mx:Button label=Test 1/ mx:Button label=Test 1/ mx:Button label=Test 1/ /mx:HBox mx:Canvas backgroundColor=0xff mx:Button label=Test 2/ /mx:Canvas mx:Button label=Test 3 / /mx:VBox /mx:Application How can I make it so that the blue and red buttons are indented, say, 50 pixels? I've already tried fiddling with the 'left' and 'paddingLeft' attributes with little success... :/ Any thoughts? This has got to be possible with VBox, but I can't seem to figure it out... Thanks, -Rich