Jump to content
GreenSock

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

Draggable MC, in increments

Go to solution Solved by Diaco,

Warning: Please note

This thread was started before GSAP 3 was released. Some information, especially the syntax, may be out of date for GSAP 3. Please see the GSAP 3 migration guide and release notes for more information about how to update the code to GSAP 3's syntax. 

Recommended Posts

 

I have a  movie clip that I want to drag "scroll left" in 650 pixel increments.

 

I have a movie clip (mc1) that is 650x650px on the stage

 

(embedded within this clip is a symbol (mc2) that is 3250pxs x 650pxs (divided into 5 images)

 

I want to drag through mc1 in 5 swipes revealing each image (650x650) on mc2


 


//movie clip 1

Draggable.create(mc1, {type:"scrollLeft", edgeResistance:0.5, throwProps:true});

 

 

Could you help me with the code that I need to initiate this please,

I just need a push in the right direction and away I'll go until the next hurdle.

 

Learning heaps and loving it.

Link to comment
Share on other sites

Hi

 

I'm a little confused. Draggable is an html5 / javascript utility. It doesn't work with MovieClips (which are part of Flash / ActionScript) at all.

 

Can you please elaborate on whether this is a flash or html project?

 

Thx.

  • Like 2
Link to comment
Share on other sites

  • Solution

Hi lucto_et_emergo  :)

 

Carl is right

but in addition ,  if i understood correctly and you'r using edge animate ( regard to your previous questions ) , pls try like this :

Draggable.create(mc1,{
  type:"scrollLeft" , 
  edgeResistance:0.5 ,
  throwProps:true ,
  snap:function(endValue) { return Math.round(endValue/650)* -650; }
});
  • Like 4
Link to comment
Share on other sites

AWESOME!

 

yeah I used the wrong naming convention... my bad -  I am an ole Flash user, it's just bad naming convention habits...

of course it is an HTML5 project as I no longer use flash, Greensock is soooooo gooood...  will keep that in mind when I ask my questions later...

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