PDA

View Full Version : How do you make a movies width resize when dragging the right hand side


bassnote
01-01-2006, 06:35 PM
Hello,

This is my first post onto this board, so first i want to say a big hello and happy new year to everyone :)

I need a little advice about how to make a movie thats stretchable, its for a music/art project that i'm currently working on.

I have made a mock up in flash of what i want it do do witch i have put up here (http://www.bassnote.co.uk/imp/resizeing%20-%20what%20i%20want%20it%20to%20do.swf)

So basically - i want the user to be able to drag the right hand size to make the movies width change.

I have tried useing startDrag() on a movie just containing the right hand side box, but i cant work out to get the lines at the top and bottem changeing as well, ._x is read only and _xscale works on percentages.

Can anyone suject a method of working out how to do this??

Cheers,

Peter Dixon

Cota
01-02-2006, 03:25 AM
This is what I'm thinking. Left side of the box is just half the box, its own little movieClip...the right side is the other half of the box, but much longer. You can either mask the right side, to hide all the extra lines or xscale it also...it gives you you a fixed left side and a measurable right side..

bassnote
01-02-2006, 12:51 PM
Thankyou Cota,

Thanks for makeing me re-think the masks. What i have done is have a full length version (called icon) being masked by a movie (draglayer) which contains the drag box and also a movie called insidemask. The inside mask is then set to mask the icon movie and it works! The problem i was haveing before was that the startDrag command can hanndle only one movie clip at a time and i didnt think that i could use a movie inside another movie as a mask, therfore I thought that i would have to have both the drag box and the mask clips being draged at the same time.... but putting them both into a movie clip (draglayer) made it all happy :)

icon.setMask(draglayer.insidemask);
draglayer.onPress = function() {
draglayer.startDrag(false,0,draglayer._y,500,dragl ayer._y);
}
draglayer.onMouseUp = function() {
draglayer.stopDrag();
length = draglayer._x - icon._x;
}

I have uploaded this of this little section working:
here

Thanks again,

Peter

Cota
01-02-2006, 03:55 PM
Glad you got it working...but if you drag past 27..it doesnt keep the lines..not sure if you noticed that or not.

bassnote
01-02-2006, 05:05 PM
Hello,

Yeah, i know didnt put the right figues into startDrag anyway - that was just my test movie to get the concept working - now tied it into the main project, where i have the lovely task of makeing it only play sounds for for the duration the user wants - say if the box was on 27 it would play the sound for 4 seconds, if it were on 10 it would only play the sound for 1 second!!!!

See you soon,

Thanks again

Peter