Jump to content
GreenSock

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

Constraining objects to image of variable size

Recommended Posts

This is a continuation of a post here http://forums.greensock.com/viewtopic.php?p=18323 which went towards a topic that is better entered in the TransformManager section.

 

The problem I have is that I'm using Flash Builder (SDK 3.5) to use TransformManager to add smaller image on top of a larger image. The problem I have is that I can't seem to find an easy way to tell TransformManager to overlay only ontop of the image itself. Here is my mxml:

 

	height="{frame.height-fileUpload.height}" borderThickness="2" borderStyle="solid" borderColor="#071b62"
	horizontalScrollPolicy="off" verticalScrollPolicy="off" dragEnter="dragAccept(event)" dragDrop="dragDrop(event)">
               source="{backgroundSrc}" scaleContent="true" maintainAspectRatio="true"/>
               verticalScrollPolicy="off" backgroundColor="green">
                                           width="{frame.width}" horizontalScrollPolicy="off" 
                                           verticalScrollPolicy="off"/>


 

This produces something like this:

 

transformmanager.png

 

You can see that the picture on the right is allowed to escape the bounds of the background image. I'd like to be able to say, stay within the bounds of the big image.

 

Another issue is that on resize of the image, the small images don't 'stick' and don't scale with the image:

 

transformmanager2.png

 

I'm not sure if I should just stretch the background image and keep it a fixed size so that I can accurately determine the placement of the small images. Is there a way to keep the original image proportions and also force transform manager to maintain this as the bounds?

 

Thanks.

Link to comment
Share on other sites

Disclaimer: I'm very sleep-deprived right now...

 

...I read your post 3 times and still can't understand the question(s) or what the problem is or how LoaderMax plays into this (if at all). I'll just throw some things out there which probably won't help much but it's all i can think of to say:

 

1) The bounds of a FlexTransformManager are determined by its size. In other words, if its' 500 pixels wide and 300 pixels tall, those are the bounds.

 

2) Yes, you can constrainScale any time. In fact, I just posted a minor update last night that allows it to constrain the proportions to whatever they are at the time you set constrainScale to true instead of always forcing the targetObject to maintain its original (unscaled) proportions.

 

3) As far as the small images not "sticking", I have no idea what you mean. You select them and they don't scale?

 

Maybe it would help if you created a very simple, isolated case with only the essential code and then sent it to me so that I can publish and see what's going on. Please don't post any files containing TransformManager on the forums, though - you can PM me a link or e-mail it.

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