thanks so much

On 2/16/07, JOR <[EMAIL PROTECTED]> wrote:

Your example didn't include checking the X axis so I didn't include it.
I've posted a revised working example along with source code here:
<http://www.jamesor.com/examples/Scroller/>

I've modified my previous example to enable scrolling only when the
mouse is within the mask area.

-- james



James O'Reilly  —  Consultant
Adobe Certified Flash Expert
http://www.jamesor.com
Design • Code • Train



JOR wrote:
> If you place your contents of the movieclip so that everything is
> registered with the top left corner to 0,0 of the clip the following
> should work:
>
> var maxMouseY:Number = mask._height;
> var maxListY:Number  = maxMouseY - list._height;
> onEnterFrame = function ():Void {
>   if ((_ymouse < maxMouseY) && (_ymouse > 0)) {
>     list._y = maxListY * (mask._ymouse/maxMouseY);
>   }
> };
>
> Basically, I'm getting the mouse coords as a range from 0 to 1
> (mask._ymouse/maxMouseY) where the _ymouse is located within the mask
> clip.  0 being the top most pixel and 1 being the bottom most.
>
> Once I have that I multiply it by the maximum movement (maxListY) the
> list is allowed to move to get the scroll postion.  The maximum amount
> the list is able to move is 0 for starting position and a negative
> number if it's scrolled up.  The lowest negative number allowed is
> figured by taking the mask height and subtracting the height of the list
> (mask._height - list._height).
>
>
> James O'Reilly  —  Consultant
> Adobe Certified Flash Expert
> http://www.jamesor.com
> Design • Code • Train
>
>
>
> Omar Fouad wrote:
>
>> Hey list this is my first problem i am posting here, i hope someone
could
>> halp me!!!
>>
>> i got a movie clip with inside four Key Frames... in each Key Frame i
>> got a
>> mask called 'mask' (a rectangle) and a masked MC called 'list'.
>>
>> than in the first layer of each keyframe (which i reserved it for
>> actionScript only) i put the following code:
>>
>> maskY = mask._y;
>> maskY2 = maskY+mask._height
>> maskX = mask._x;
>> maskX2 = maskX + mask._width;
>> var ratio = Math.round(list._height / mask._height);
>>
>> onEnterFrame = function () {
>>       if (_ymouse<maskY2 && _ymouse>maskY) {
>>       list._y = (mask._ymouse-(mask._ymouse*2))*ratio+maskY;
>>      }
>> };
>>
>> it works. But it seems that the 'list' MC overscrolls as it slides up
>> more
>> than it should do.
>> can someone help me please in resolving this ???
>>
>> Regards...
>>
>>
> _______________________________________________
> [email protected]
> To change your subscription options or search the archive:
> http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
>
> Brought to you by Fig Leaf Software
> Premier Authorized Adobe Consulting and Training
> http://www.figleaf.com
> http://training.figleaf.com
>
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com




--
Omar Fouad - Digital Emotions...

Love is always patient and kind. It is never jealous. Love is never boastful
nor conceited It is never rude or selfish. It does not take offense and is
not resentful. Love takes no pleasure in other people's sins...but delights
in the truth. It is always ready to excuse, to trust, to hope... and to
endure... whatever comes.
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders

Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com

Reply via email to