Jump to content
GreenSock

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

Stick object to right-border of screen

Recommended Posts

Hi guru's,

 

A problem I'm coping with for some days, so I'd like to tap into your knowledge.

Here's the situation; I have a SWF (let's call it the parent) which contains several objects. One of these objects is a LiquidArea, which resizes to the size of the screen to have a fullscreen-effect. The scalemode of this LiquidArea is PROPORTIONAL_INSIDE.

Within this LiquidArea I load another SWF (the child). This child-swf has an object which I want to position to the right-border of the screen at any time. Because the LiquidArea of the parent is set to PROPORTIONAL_INSIDE, the child has some blank space at the left and right of it.

So this means, that the object of my child that I want to position to the right-border, actually needs to move / over the total width of the child.

 

Is there a way of doing this using my parent/child-setup I've just described? And do you think this is good/best practice?

An alternative I was thinking about, is to create a LiquidStage in my parent and move the object to position from the child into a seperate SWF and load this SWF into the LiquidStage of the parent. Using eventHandlers, the object can communicate with the child and vice versa.

 

Still clear?

 

What do you think? Any help/feedback is highly appreciated!

 

Best regards,

Roel

Link to comment
Share on other sites

Yeah, I'd steer clear of doing the child approach because when you move the child's child, it affects the size of the child. the size of the child is what determines its size/position inside the LiquidArea, so its' a catch-22. Imagine the child being centered in the LiquidArea and then the child's child moves over to line up on the right side - now the child isn't centered anymore. If it centers itself, the child's child isn't aligned where you want it anymore. And so on.

 

I'd definitely recommend pulling that child's child out and attaching it to the parent LiquidStage instead. I think that would be much cleaner.

 

Good luck!

Link to comment
Share on other sites

Tnx for the reply!

First thing tomorrow-morning is to take care of the LiquidStage-approach...

 

Cheers,

R.

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