Jump to content
Search Community

Liquidstage [SOLVED]

moritz.dumee test
Moderator Tag

Recommended Posts

Hi,

 

Just became member and payed the 75 euro. Not what i hoped in terms of examples although i'm sure the work you guys is great.

 

Would love to have a .fla example with the liquidstage (component, .as) working). Not sure if i need flex, hoped it was just flash. Can u help???

Link to comment
Share on other sites

Did you see the 11 interactive examples in the "demo_swfs" folder? Most of them even write sample code for you. Sorry to hear you were disappointed with what you got in terms of examples, though.

 

You do NOT need Flex for any of the bonus classes. LiquidStage was really built for straight Flash anyway.

 

If the interactive swfs don''t give you what you wanted, I'd be happy to send you a simple FLA that shows it in use. I put the effort into the interactive examples because I thought they did a better job of communicating the core concepts since you can play around with things and instantly see the effect while watching the code change down below based on your selections.

Link to comment
Share on other sites

Hi there,

 

I'm getting this error when I apply a easing effect to a pin mc.

 

1118: Implicit coercion of a value with static type Object to a possibly unrelated type Number.

 

ls.attach(loader, ls.CENTER, false, 3, {ease:Elastic.easeOut});

 

Warning: 3590: int used where a Boolean value was expected. The expression will be type coerced to Boolean.

 

ls.attach(loader, ls.CENTER, false, 3, {ease:Elastic.easeOut});

 

 

I'm using Flash cs4

Link to comment
Share on other sites

You're missing a parameter in there. Check out the docs at http://www.greensock.com/as/docs/tween/ ... stage.html.

 

public function attach(target:DisplayObject, pin:PinPoint, strict:Boolean = false, reconcile:Boolean = true, tweenDuration:Number = 0, tweenVars:Object = null):void

 

So parameters 3 and 4 should be Boolean values. I assume you meant to do this:

 

ls.attach(loader, ls.CENTER, false, true, 3, {ease:Elastic.easeOut});

Link to comment
Share on other sites

Hey there!

Another question for you!

I have a swf file that has a liquid stage with lots pin mc. (and works great)

I've load it into another swf file that has others elements that need to be pin!

The thing is, when I create another liquid stage in the swf "container" the loaded swf loses all his "liquidness".

 

What can I do?

thanks again.

Link to comment
Share on other sites

I have a swf file that has a liquid stage with lots pin mc. (and works great)

I've load it into another swf file that has others elements that need to be pin!

The thing is, when I create another liquid stage in the swf "container" the loaded swf loses all his "liquidness".

 

Yeah, that's a bit of an odd setup - did you build the swfs at the same size originally? Is there a reason you're not loading in the assets and using the parent's LiquidStage? Any chance you could send me an example set of FLAs? It doesn't need to be your production files - just something very simple that demonstrates the issue.

Link to comment
Share on other sites

For the exemple

the first swf has this:

 

import com.greensock.layout.*;
import com.greensock.easing.*;
import com.greensock.plugins.*;


var ls:LiquidStage = new LiquidStage(this.stage, 800, 600, 800, 600);
ls.attach(mc, ls.LEFT_CENTER, false, true, 2.1, {ease:Elastic.easeOut});

var Xpos:Number = 50;
var Ypos: Number = 50;
var swf:MovieClip;
var loader:Loader = new Loader();

var defaultSWF:URLRequest = new URLRequest ("teste2.swf");

loader.load(defaultSWF);
loader.x =  Xpos;
loader.y = Ypos;

addChild(loader);

 

 

The seconde swf has this:'

 

import com.greensock.layout.*;
import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.plugins.*;


var ls:LiquidStage = new LiquidStage(this.stage, 800, 600, 800, 600);
ls.attach(mc2, ls.LEFT_CENTER, false, true, 2.1, {ease:Elastic.easeOut});

Link to comment
Share on other sites

The problem is that the 2nd swf (the one you're subloading) doesn't have a valid "stage" property when your code runs initially (it's null). You need to wait to run your code until the swf is added to the stage. You could do that like this:

 

import com.greensock.layout.*;

function init(event:Event=null):void {
if (event != null) {
	this.removeEventListener(Event.ADDED_TO_STAGE, init);
}
if (this.stage == null) {
	this.addEventListener(Event.ADDED_TO_STAGE, init);
} else {
	var ls:LiquidStage = new LiquidStage(this.stage, 800, 600, 800, 600);
	ls.attach(mc2, ls.LEFT_CENTER, false, true, 2.1, {ease:Elastic.easeOut}); 
}
}

init(null);

 

I tested this concept locally and it seemed to work well.

Link to comment
Share on other sites

hummmm...it is not working for me :oops:

 

mc2 doens't tween when I resize the swf "loader".

 

I have this here:

 

swf loader:

 

import com.greensock.layout.*;
import com.greensock.easing.*;
import com.greensock.plugins.*;

var ls:LiquidStage = new LiquidStage(this.stage, 800, 600, 800, 600);
ls.attach(mc, ls.LEFT_CENTER, false, true, 2.1, {ease:Elastic.easeOut});

var Xpos:Number = 50;
var Ypos: Number = 50;
var swf:MovieClip;
var loader:Loader = new Loader();

var defaultSWF:URLRequest = new URLRequest ("teste2.swf");

loader.load(defaultSWF);
loader.x =  Xpos;
loader.y = Ypos;

addChild(loader);

 

 

The one that is going to be subload

import com.greensock.layout.*;
import com.greensock.*;
import com.greensock.easing.*;
import com.greensock.plugins.*;

function init(event:Event=null):void 
  {
  if (event != null)   
  {
     this.removeEventListener(Event.ADDED_TO_STAGE, init);
  }

  if (this.stage == null) 
  {
     this.addEventListener(Event.ADDED_TO_STAGE, init);
  } 
  else    
  {
     var ls:LiquidStage = new LiquidStage(this.stage, 800, 600, 800, 600);
     ls.attach(mc2, ls.LEFT_CENTER, false, true, 2.1, {ease:Elastic.easeOut}); 
  }
}

init(null);

Link to comment
Share on other sites

Aha, I think I see the problem. It's related to two LiquidStage instances sharing the same stage and pinning objects to both, but I just uploaded a new version of LiquidStage-related classes that should resolve this. Please download the latest version by logging into your GreenSock account at http://www.greensock.com/account/ and let me know if it works well for you. Thanks for letting me know about this.

Link to comment
Share on other sites

:oops:

There is a bug...I think

If you run the swf loader you will be able to see that both swfs are tweening together, which is nice.... however, if you wait some seconds and try to resize the screen the sub-loaded one stops tweening.

Link to comment
Share on other sites

Could you send me an full-blown example (it can be simple, but I want both FLAs please). I'm not able to reproduce this on my end, but maybe there's some difference in my setup (I used almost exactly the same code as you posted earlier). I wonder if there's something else going on in your file? You did republish both swfs so they both have the new LiquidStage code in them, right?

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