gsFan

Help Liquidstage menuNav

Recommended Posts

Hello,

 

I hope someone can help me. Im using liquidstage to "pin" my DisplayObjects all good until I came across a problem with the navigation menu im working. I need the lines that are above the menuNav_mc (image01 attached file) stay at the TOP_LEFT (like image02 attached file) when the stage is resized but still the menuNav_mc buttons stay at the BOTTOM_LEFT.

 

I have to mention that the lines are inside menuNav_mc

 

This is the AS3 code of the example im making so far:

 

var ls:LiquidStage = new LiquidStage(this.stage, 1024, 750, 1024, 750);

  ls.attach(logo_mc, ls.TOP_LEFT, false, true, 0);
  ls.attach(menuNav_mc, ls.BOTTOM_LEFT, false, true, 0);
  ls.update();

post-7519-0-08388300-1347473258_thumb.jpg

post-7519-0-40716100-1347473267_thumb.jpg

Share this post


Link to post
Share on other sites

Have you tried pinning each object accordingly? I only see you attaching logo_mc and menuNav_mc, but no children of menuNav_mc.

Share this post


Link to post
Share on other sites

Hi Jack,

 

the problem is that i have never used the pinpoint before, can you help me with an example or documentation plz?

Share this post


Link to post
Share on other sites

I found an example and documentation about "pinpoint" but it seems to me that I still do not understand, I'm doing the example with one line. What I need is the line stretch to menuNav_mc when the stage resized.

 

this is my code:

 

var ls:LiquidStage = new LiquidStage(this.stage, 1024, 750, 1024, 750);
//var pin:PinPoint = new PinPoint(0, 0, linea01_mc);

  //ls.attach(logo_mc, ls.TOP_LEFT, false, true, 0);
  ls.attach(linea01_mc, ls.TOP_LEFT, false, true, 0);
  ls.attach(menuNav_mc, ls.BOTTOM_LEFT, false, true, 0);
  ls.update();

//pin.attach(menuNav_mc);

post-7519-0-52218600-1347574725_thumb.jpg

Share this post


Link to post
Share on other sites

LiquidStage is just for pinning things, but it sounds like you want to actually resize/stretch objects - that is what LiquidArea is for. If I understand your goal correctly, you could accomplish it by wrapping a LiquidArea around your line and pinning its corners like:

 

var la:LiquidArea = LiquidArea.createAround(linea01_mc, {hAlign:"left"});
la.pinCorners(ls.TOP_LEFT, ls.BOTTOM_LEFT);

 

(and don't pin linea01_mc to the LiquidStage at all - the above code replaces your ls.attach(linea01_mc...) line)

Share this post


Link to post
Share on other sites

Thank you Jack!, this code solved my problem

 

lineas_arr = [  menuNav_mc.linea1,
   menuNav_mc.linea2,
   menuNav_mc.linea3,
   menuNav_mc.linea4,
   menuNav_mc.linea5];
for each(var lineas:MovieClip in lineas_arr)
  {
  var la:LiquidArea = LiquidArea.createAround(lineas, {scaleMode:ScaleMode.HEIGHT_ONLY, hAlign:AlignMode.LEFT, vAlign:AlignMode.TOP});
  la.pinCorners(ls.TOP_LEFT, ls.BOTTOM_LEFT);
  }

 

Greensock classes are great! :D

  • Like 1

Share this post


Link to post
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.