Jump to content
GreenSock

Search In
  • More options...
Find results that contain...
Find results in...
derschreck

LiquidStage - How to pin objects across several frames

Recommended Posts

I want to make a website the old school way so that every page has its own frame. Navigation is just - gotoAndPlay(2); . When i pin an mc in every frame, it doesnt stay at its pinned position when jump to another frame. With every frame change the mc make a little step downwards. The only solution I found was to change the mc's instance name in every frame but I assume there is another way around.

 

// --- Frame 1---
stop();

import com.greensock.*;
import com.greensock.layout.*;

var ls:LiquidStage = new LiquidStage(this.stage, 1600, 1200, 800, 600);
ls.attach(mc, ls.TOP_CENTER);

btn_next.addEventListener(MouseEvent.CLICK, goNext);

function goNext(evt:MouseEvent){
					  	gotoAndPlay(2);

//--- Frame 2 ---
stop();

ls.attach(mc, ls.TOP_CENTER);

btn_prev.addEventListener(MouseEvent.CLICK, 
					  function(evt:MouseEvent){
					  	gotoAndPlay(1);
					  });

Link to comment
Share on other sites

Why do you keep attach()-ing the same object on each frame?

 

It sounds like maybe it would be easiest/cleanest if you just wrapped that stuff in its own container MovieClip and then attach() that container once. See what I mean?

Link to comment
Share on other sites

thats it. Thank you very much. I think the english phrasal is - to not se the wood for the trees.

Thanks again.

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.
×