Jump to content


  • Posts

  • Joined

  • Last visited

thehat's Achievements


Newbie (1/14)



  1. I'm a bit flat out at the moment (still intending to build you an example of video interrupting the SplitTextField class when I have some spare time), but I can tell you that it's not hasSelectableText. I added a trace to the addItem function that shows it set to false.
  2. That does seem to have fixed it, thank you! I have another issue now, but this time I can offer no explanation. I'm using the Transform Manager in two different places in my app. The first is to scale a bitmap object that is already on the stage, and looks like this: scaler = new TransformManager({targetObjects:[currentImg],constrainScale:true, allowKeyMove:true,autoDeselect:false,bounds:new Rectangle(0,0,440,440)}); scaler.selectItem(currentImg); The second is as part of a drag-drop system, where the user picks items from a list and drags them to an area. Once the mouse button is raised, the item is added to an edit area, and pushed into the Transform Manager. private function init():void { manager = new TransformManager({allowDelete:true, allowKeyMove:true}); manager.addEventListener(TransformEvent.FINISH_INTERACTIVE_MOVE , onMoveItem); } //called when an item is released over the target area public function addItem(item:DisplayObject):void{ manager.addItem(this.addChild(item)); } //used to delete items removed from the edit area private function onMoveItem(evt:TransformEvent) : void { if(!mc_drop.hitTestPoint(mouseX,mouseY,true)) { /item dropped outside edit area, lets kill it manager.deleteSelection(); manager.deselectAll(); } } Now for the problem I have. In the first example it is only possible to move the item by hovering the mouse over the bounding rectangle or the center point icon, but in the second example the entire area of the item acts as a hit area for the move. Apart from the target's casting, which is Bitmap in the first example and DisplayObject in the second, I can't see any difference that would cause the differing behaviour. Any ideas?
  3. Hi Jack, I'm loving your transform manager, it's saved the life of my current project! I may have come across something though. If the destroy method is called while a resize/move/scale cursor is displayed that cursor persists after the manager has stopped. It might be a dirty fix, but I've fixed this for my application by adding swapCursorOut(null); to the destroy method.
  4. I see, I'd assumed that if I was going to set them myself there was no point in the area doing it itself first. I've actually switched to using an AutoFitArea and one pinpoint for the time being as the project needed to be submitted, but I'll revisit this at some point. Thanks for your help!
  5. Ah cool, that's working great now. Thanks very much!
  6. I've just tried downloading from the link in the account section again, and AutoFitArea is still 1.55. The last changelog date is 2010-05-25. Am I maybe trying to download from the wrong place?
  7. I'm having trouble removing both LiquidArea and AutoFitArea with the destroy function. Both times I receive a null object error from AutoFitArea.destroy, but no line specified. I've tried commenting out the entire contents of the function to try and isolate it, but the error still occurs when the function is empty. Version is 1.55, any ideas what might be happening?
  8. So I'm trying to get DynamicPinPoints working before I start messing around with getting any values from JavaScript. Problem is they don't seem to be working (or more likely I'm using them wrong!). I've ditched my onStageResize function and so now the constructor looks like this: public function ScreenshotLargeDisplay():void { ls = LiquidStage.defaultStage; la = new LiquidArea(this,(0-(applicationSettings.BASESIZEWIDTH/2))+_margin,_margin,applicationSettings.BASESIZEWIDTH-(_margin*2),applicationSettings.BASESIZEHEIGHT-(_margin*2),0xFF0000,applicationSettings.BASESIZEWIDTH-(_margin*2),applicationSettings.BASESIZEHEIGHT-(_margin*2),_maxScreenWidth,_maxScreenHeight,false); var point1:DynamicPinPoint = new DynamicPinPoint(this,getTopLeft); var point2:DynamicPinPoint = new DynamicPinPoint(this,getBottomRight); la.pinCorners(point1,point2); la.preview = true; } And these are my getter functions: public function getTopLeft():Point { var temp:Point = new Point(0,_margin); if(ls.stageBox.width > _maxScreenWidth+(_margin*2)) { //handle oversize screen } else { temp.x = (0-(applicationSettings.BASESIZEWIDTH/2))+_margin; } return temp; } public function getBottomRight():Point { var temp:Point = new Point(0,_maxScreenHeight+(_margin*2)); if(ls.stageBox.width > _maxScreenWidth+(_margin*2)) { //handle oversize screen } else { temp.x = applicationSettings.BASESIZEWIDTH/2; } return temp; } As you can see, I'm not bothered about the larger screen sizes yet, just trying to get it working as the image scales up to its maximum width of 1280 plus a 30px margin on either side. However all I get is an error from LiquidArea suggesting that it doesn't like my DynamicPinPoints.
  9. Thanks for the reply. You're right, it is absurdly complicated. I think I'd been chasing a solution for a little too long! I realised last night that this probably isn't the best direction to go in anyway. The site we're building is a full screen flash site that uses SWFFit to ensure the minimum height of the SWF is 918px. This class is supposed to display large images that fill the screen up to their native resolution and then become centered as the viewport increases in size. This means that I can't use the stageBox for the vertical sizing because it never gets small enough. I'm now going to look into SWFFit to take my viewport dimensions from there instead, and then hopefully dynamic pin points will be able to use those values. Edit: as an example, this is an earlier version of the same idea that only uses liquidStage. I'm trying to improve this because you can see the controls aren't always positioned perfectly and the image is verticaly centered to the SWF, not the viewport. http://www.finalfantasy13game.com/#/uk/media/screenshots/3
  10. I'm trying to build an image viewer that behaves similar to a classic lightbox implementation using LiquidArea. The basic setup is a previos next and close button with an image, where the previous and next are centered relative to the height of the image, and anchored to either side, and the close button is top center. The idea is that when the stage is less than 1280 wide, the area will scale, maintaining the ratio of the image and repositioning but not not scaling the buttons. That much works fine on the horizontal plane at least. When the stage is wider than 1280, the area should stop scaling the image and instead the whole thing should stay in the center of the screen. The problems: [*:91od1k5r]Upon reaching the max width, the area stays anchored to the top left. [*:91od1k5r]Because my chosen maximum height is much smaller than the LiquidStage minimum height the controls don't reposition vertically as the image scales. To fix the first problem I've tried to repin the area when the stage goes above a certain size, but just repinning to top center causes the content to jump and I'm struggling to figure out how to offset that. Here's the code so far, can you suggest how I might do this? BASESIZEWIDTH = 960; BASESIZEHEIGHT = 918 public class ScreenshotLargeDisplay extends MovieClip { //- PRIVATE & PROTECTED VARIABLES ------------------------------------------------------------------------- protected var ls :LiquidStage; protected var la :LiquidArea; protected var _margin :int = 30; protected var _maxScreenWidth :int = 1280; protected var _maxScreenHeight :int = 720; protected var _singleMode :Boolean; //- PUBLIC & INTERNAL VARIABLES --------------------------------------------------------------------------- public var m_imageHolder :MovieClip; public var mc_loader :MovieClip; public var m_close :simpleButton; public var m_next :simpleButton; public var m_previous :simpleButton; //- CONSTRUCTOR ------------------------------------------------------------------------------------------- public function ScreenshotLargeDisplay():void { ls = LiquidStage.defaultStage; la = new LiquidArea(this,(0-(applicationSettings.BASESIZEWIDTH/2))+_margin,30,applicationSettings.BASESIZEWIDTH-(_margin*2),applicationSettings.BASESIZEHEIGHT-(_margin*2),0xFF0000,applicationSettings.BASESIZEWIDTH-(_margin*2),applicationSettings.BASESIZEHEIGHT-(_margin*2),_maxScreenWidth,_maxScreenHeight); la.preview = true; } //- PRIVATE & PROTECTED METHODS --------------------------------------------------------------------------- protected function prepareButtons():void { la.attach(m_close,ScaleMode.NONE,AlignMode.CENTER,AlignMode.TOP); la.attach(m_next,ScaleMode.NONE,AlignMode.RIGHT,AlignMode.CENTER); la.attach(m_previous,ScaleMode.NONE,AlignMode.LEFT,AlignMode.CENTER); } //- PUBLIC & INTERNAL METHODS ----------------------------------------------------------------------------- public function init():void { this.stage.addEventListener(Event.RESIZE,onStageResize); prepareButtons(); } public function addScreenshot(img:DisplayObject):void { this.addChildAt(img,0); la.attach(img,ScaleMode.PROPORTIONAL_INSIDE,AlignMode.CENTER,AlignMode.TOP); } //- EVENT HANDLERS ---------------------------------------------------------------------------------------- protected function onStageResize(evt:Event):void { trace(ls.stageBox.width+(_margin*2)); if(ls.stageBox.width > _maxScreenWidth) { la.pinCorners(new PinPoint((applicationSettings.BASESIZEWIDTH/2)-((_maxScreenWidth-applicationSettings.BASESIZEWIDTH)/2),0,ls.stageBox,ls), ls.BOTTOM_RIGHT); //la.pinCorners(ls.TOP_CENTER, ls.RIGHT_CENTER); } else { la.pinCorners(ls.TOP_LEFT, ls.BOTTOM_RIGHT); } } }