Jump to content
Search Community

Gary Griswold

Business
  • Posts

    35
  • Joined

  • Last visited

Everything posted by Gary Griswold

  1. It is mostly done now, but the part that is new to me is that the scrolling needs to snap to the nearest item when the velocity is below some threshold. There is a panel snap scrolling example on the http://greensock.com/throwprops web page that is very helpful. It is only differs from this problem in axis and that the bounds of the scrolling viewport are the same as the bounds of the item being scrolled.
  2. I would like to replace Flex Spinner (sometimes called Picker or UIPicker) with something written in AS3 without Flex. ThrowProps and Blitmask should be a great help. Are there any examples of doing using Greensock?
  3. Thanks. I don't know how I missed that. It is working extremely well.
  4. ThrowProps and Blitmask really do work well together for scrolling, but most of my views have too much interactivity for Blitmask to be useful. The BlitMask would need to be updated with a forced recapture of the Blitmask each time any change is made to the view, and this is taking about 500ms, which interferes with a smooth scroll. Is there an example for using ThrowProps in a Scroller without using BlitMask?
  5. I have DynamicPinPoint and liquid.update working well together so that I can position objects at the bottom right corner of other display objects that change in size. But I am sometimes having a strange problem with DynamicPinPoint's attach method. When the page first comes up some objects tied to a DynamicPinPoint will be in the wrong place. As soon as I resize the page, they move into their correct positions. So, the function used by DynamicPinPoint is returning the correct values. The problem seems to be related to the attach call, because if I comment out the attach call, then the objects do come up in the correct initial location. Any ideas? The follow is one of the DynamicPinPoints that I have on the page. addChild(ministryBtns); var botCorner:Point = ministryGridCorner();// call DynamicPinPoint function ministryBtns.x = botCorner.x - ministryBtns.buttonsWidth; ministryBtns.y = botCorner.y + 5; _ministryGridCornerPin = new DynamicPinPoint(this, ministryGridCorner); _ministryGridCornerPin.attach(ministryBtns); The following is my liquid stage constructor: _liquid = new LiquidStage(stage, stage.stageWidth, stage.stageHeight, 500, 400, stage.fullScreenWidth, stage.fullScreenHeight);
  6. I found the solution. I just need to call update() on the liquidStage at the point when the display object size changes. Great job, Jack.
  7. The problem that I am describing is not just a DataGrid problem, it would occur anytime there are display objects that change in size as a result of changes of content. Another example would be a text box whose content changes, so that other display objects just below the text box need to move up or down. The DynamicPinPoint gets the position correct just as soon as one changes the size of the window slightly. The trick might be to fire an event at the point when the Display Object's size changes in order to get the LiquidStage to recompute positions at that moment. I see in the LiquidStage code that it uses flash.events.Event.RESIZE, and I was thinking the correct solution might be to dispatch a resize event at the point when a child Display Object has changed size. But, my trial and error attempts have not yet worked. Is there a way to do this?
  8. I am just starting to use LiquidStage and have been able to get it to do most things that I need, but I have buttons placed at the bottom right corner of a DataGrid. The buttons need to move when the DataGrid changes in height. This change in height often occurs because the number of rows being displayed changes. I have used a DynamicPinPoint to return the bottom right corner of the data grid, and this works very well when the window is resized, but if the DataGrid content changes the DynamicPinPoint function is not getting called. Is there something I can do with a resize event when the content in the DataGrid changes? The following is my DynamicPinPoint code: addChild(associateBtns); var assocCorner:Point = associateGridCorner(); associateBtns.x = assocCorner.x - associateBtns.buttonsWidth; associateBtns.y = assocCorner.y + 5; var assocPoint:DynamicPinPoint = new DynamicPinPoint(this, associateGridCorner); assocPoint.attach(associateBtns); ======= private function associateGridCorner() : Point { var botX:Number = associateGrid.x + associateGrid.width; var botY:Number = associateGrid.y + associateGrid.height; return(new Point(botX, botY)); }
  9. So, if I use flash.text.TextField, I must use embedded fonts. But after some more experimentation, I have found two other solutions. 1) use rotationZ. The following works, where 'this' is a sprite with a child flash.text.TextField TweenLite.to(this, 1, {rotationZ:"-=90"}); The problem with this solution is that I cannot figure out how to transformOrigin in AS3. 2) use TextFlowLayout. This works with rotation as follows: var _point:Point = new Point(320, 460); TweenMax.to(this, 1, {transformAroundPoint:{point:_point, rotation:"-=90"}}); A TextFlowLayout can be constructed as follows, but there are simpler ways to do this using text converters. var textFlow:TextFlow = new TextFlow(); var para:ParagraphElement = new ParagraphElement(); var span:SpanElement = new SpanElement(); span.text = text; para.addChild(span); textFlow.addChild(para); var sprite:Sprite = new Sprite(); sprite.x = _padding; sprite.y = _padding; var controller:ContainerController = new ContainerController(sprite, _allowedTextWidth, NaN); textFlow.flowComposer.addController(controller); textFlow.flowComposer.updateAllControllers(); addChild(controller.container); _width = _padding * 2 + sprite.width; _height = _padding * 2 + sprite.height;
  10. I am trying to rotate a popup on a mobile device when the device rotates. The popup is a sprite and it contains children text fields. When I use rotation:"-=90" the sprite rotates, but the text disappears until I have rotated it 360. However, rotationZ will rotate the text children with the sprite. But with rotationZ I cannot find any way to redefine the registration point for the rotation to the center of the sprite. TransformAroundCenter and TransformAroundPoint work will for rotation, but I can't seem to get them to work for rotationZ. I am just starting to use Greensock. I am part way through the Noble text, but I might be missing some things that are specific to the AS3 version of Greensock. I attempted to upload a file, but it would not upload a file of type .as
×
×
  • Create New...