Jump to content
Search Community

Update Bounds for slider Function?

FlashRockStar test
Moderator Tag

Recommended Posts

Hello,

 

and thank you very much for your great support! But right now i have another Problem. I have a MovieClip with 2 Movieclips inside. I can change the distance between these 2 Mocieclips with a Slider that i made. When i select this movieClip with the 2 movieClips inside i can change the distance and the selection box size get updated with the updateSelection() function. This works great until here ;)

 

But here is my Problem, when the movieclip with the 2 Movieclips inside is to near the left, top or bottom or top border the these 2 movieclips goes over the bounds. I mean i have set a bound, so that the dragable Movieclip with the 2 Movieclips inside can only be draged in a area i have set. This works fine if i not use the slider to change the distance, than the movieclips goes over the bounding box that i dont want. i mentioned that when i click on the movieclip again after 1 of that movieclips goes over the bounding box the whole movieclip jumps directly inside the bounding box back.

 

So my idea is now that while i change the distance between the movieclips the selection box is getting updated, but the event what checks the bounding box not!

 

It would be great if there is a function that i can set in the slider who updated also the bounds!!!

 

Thank You !!!

Link to comment
Share on other sites

Hi,

 

thanks for your help!

 

I have it like this now:

 

itemTransformManager.selectedTargetObjects[0].fitInsideBounds();

 

But this doesent work, can you please tell me what i am doing wrong?

 

And another thing is, i read that this forcing it to stay within the bounds by scaling it down, but i dont want that it scale down! I just want that it stays inside the bounds ;)

 

Is there also a solution for that ?

 

Thank You for your fast Support!!!

Link to comment
Share on other sites

Scaling is kinda implied when you say fitInsideBounds() :)

 

What you described with moving things independently inside the targetObject (apart from TransformManager) is pretty customized, so you'll probably need to implement your own logic to counteract the movements you're making.

Link to comment
Share on other sites

so is it maybe possible to turn that scaling off in the method fitInsideBounds() ? And when yes do you now how?

Well, unfortunately that wouldn't make a lot of sense because fitInsideBounds() implies scaling if necessary. Otherwise, calling fitInsideBounds() could end up not fitting inside bounds :)

 

And just to be clear, it will only scale DOWN if it's necessary to fit - it won't scale UP.

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