Jump to content
Search Community

djedzed

Members
  • Posts

    3
  • Joined

  • Last visited

djedzed's Achievements

0

Reputation

  1. So the code from above hasn't changed much accept for me adding a liquidArea with a maxWidth and maxHeight. import com.greensock.*; import com.greensock.layout.*; import com.greensock.easing.*; stage.quality = StageQuality.HIGH; stage.scaleMode = StageScaleMode.NO_SCALE; stage.align = StageAlign.TOP_LEFT; fscommand("fullscreen", "true"); var ls:LiquidStage = new LiquidStage(this.stage, 600, 500, 200, 200); nav_mc.x = (600 - nav_mc.width) / 2; nav_mc.y = 500 - nav_mc.height; ls.attach(nav_mc, ls.BOTTOM_CENTER, true); var area:LiquidArea = new LiquidArea(this, 0, 0, 600, 500, 0xFF000, 0, 0, 4500, 1000, true, null); area.attach(myImage, ScaleMode.PROPORTIONAL_OUTSIDE, AlignMode.CENTER, AlignMode.CENTER); area.preview = false; ls.addEventListener(Event.RESIZE, onLiquidStageUpdate); function onLiquidStageUpdate(event:Event):void { trace("updated LiquidStage"); } //button code without the listeners and rollover states to slim down this post function leftbutClick(event:MouseEvent){ TweenLite.to(myImage, 1, {x:"-1500", ease:Circ.easeInOut}); trace("I am a left button"); } function rightbutClick(event:MouseEvent){ TweenLite.to(myImage, 1, {x:"+1500", ease:Circ.easeInOut}); trace("I am a right button"); } What I am trying to achieve is to have this background slide left or right (and possibly up and down later) when the user clicks the respective button. So far so good accept when the browser is resized. Logically, the image will snap back to the center. Example: http://sqango.com/greensock/ I assume that pinCorners, defaultStage or retroMode would help to solve this but I can't seem to grasp how to implement it. Another thing I would like to achieve is have the movement based on the current size of the image so that the three sections are always centered, rather than a fixed value (in this case 1500px). Should I be moving a liquidArea? I guess what I am looking for is more a "how I should approach this scenario", in hopes that I can figure it out from there. **Side note: (Is there a reason why the "strict" is no longer a parameter in liquid area?) Thanks everyone, I appreciate the help and of course patience. . .
  2. That makes 100% sense. Tested it and it does work just great Thanks a ton for the detailed response, much appreciated.
×
×
  • Create New...