Jump to content
Search Community

Object pinning question...

Monnone test
Moderator Tag

Recommended Posts

I posted this in the other forum...I may have originally posted in the wrong place so...

 

Quick question. I have an element I want to stay pinned to the bottom of the browser but when the browser resizes it still scales to a certain degree. I know this has to be possible but I can't seem to come up with the right ingredients to make it happen. My bottom element is 3308x147 if that matters any. Here's my setup so far:

 

As always, thanks in advance!

 

// Liquid Stage Layout

var ls:LiquidStage = new LiquidStage(this.stage, 1000, 825, 0, 0);
//ls.attach(bottomThumbs_mc, ls.BOTTOM_CENTER);

var areaBottom:LiquidArea = new LiquidArea(this, -1143, 680, 3309.95, 147.60, 0xFF0000, 0, 120);
areaBottom.pinCorners(ls.BOTTOM_LEFT, ls.BOTTOM_RIGHT);
areaBottom.preview = true;
areaBottom.attach(bottomThumbs_mc, ScaleMode.PROPORTIONAL_INSIDE, AlignMode.CENTER, AlignMode.BOTTOM);

 

What is happening is the element does indeed stay put on the bottom but now doesn't scale. If I comment the pinCorners method the element scales but oddly and doesn't stay pinned to the bottom.

 

Any help is greatly appreciated!

Link to comment
Share on other sites

Thanks for the help Jack. Here is a super simple project attached. I need the bottom bar to scale as the window gets scaled down as well as stay pinned to the bottom of the stage. You can see the center content scales down a bit then stops scaling at a certain point. I'd like the bottom bar to behave the same way. I'm sure this is probably straight forward but can't seem to put it together in the right way.

 

*edit: I'm getting a message that says: "Sorry, the board attachment quota has been reached." So I posted the files here:

 

[deleted link because it contained members-only classes]

 

Thanks!

Link to comment
Share on other sites

It looks like it's behaving correctly to me when you delete your pinCorners() line, but keep in mind that you set up your LiquidArea to be VERY wide and off the screen. Turn preview on and you'll be able to visualize it better. It's fitting your huge/wide bar into the area properly and it's scaling it as the window is resized, but since it's so huge and off the screen, it may not be acting the way you wanted it to (though technically it is correct).

 

I also noticed that you're using stale versions of the GreenSock classes. There's an update to LiquidArea that adds a "customBoundsTarget" special property that allows you to define a custom object as though it's a mask for the scaling/resizing/repositioning. I've attached an example. I think this may be the type of behavior you were looking for.

 

Hope that helps.

Link to comment
Share on other sites

Thanks Jack. The problem is that I can either get the scaling right OR the pinning right but not both. I need that bottom bar to remain visible even while it's scaling down. Is there any chance that can be done? I tried commenting the pinning line to no luck. Is this where you used the "customBoundsTarget" method? You didn't post the com folder so I can't tell.

 

I'll update my classes now as well.

 

thanks!

Brian

Link to comment
Share on other sites

I think I may have it...

 

I had to artificially increase the height of my bottom clip's stage by adding a transparent line that extends beyond the initial height. Sounds like a hack but it works pretty good. Also, I think 'createAround' might have been the missing ingredient:

 

var areaBottom:LiquidArea = LiquidArea.createAround(bottomThumbs_mc, 
				   {scaleMode:ScaleMode.PROPORTIONAL_INSIDE, vAlign:"BOTTOM", minHeight:300});

 

Thanks for looking into this!

b

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...