Scroll Panel Scrolling...

12 views
Skip to first unread message

Ben McMaster

unread,
Mar 21, 2010, 8:15:44 PM3/21/10
to bumpslide
I am implementing a bumpslide scroll panel just like I have done many
times while using the example as reference, but this time something
weird is happening. When you drag the scrollbar the mouse the scroller
is moving a fraction of the distance that the mouse is moving. The
scroll bar doesn't stick to the mouse. Has anyone scene this? Did I
miss something?

My class is below. The FLA just has the demo scroll panel skin, only I
made the base class TextPanel.

thank you!

/ben

package myapp.view
{
import com.bumpslide.ui.TextPanel;
import com.greensock.TweenMax;

import flash.display.MovieClip;
import flash.events.MouseEvent;

import myapp.data.DataService;

public class HelpWindow extends AppComponent
{
public var closeBtn:MovieClip;
private var customPanel:TextPanel;

override protected function addChildren():void
{
super.addChildren();

closeBtn.addEventListener(MouseEvent.CLICK, closeBtnClick, false,
0, true);
closeBtn.mouseChildren = false;
closeBtn.buttonMode = true;

customPanel = new CustomPanel();
addChild(customPanel);

model.bind('showHelpWindow', this);
model.bind('services', this);
}


public function set showHelpWindow(data:Boolean):void
{
if (data) {
TweenMax.to(this, .5, {autoAlpha:1});
model.showFilterCats = false;
} else {
TweenMax.to(this, .5, {autoAlpha:0});
}
}

public function set services(data:DataService):void
{
if (data) {
customPanel.htmlText = data.help_text;
invalidate();
}
}

private function closeBtnClick(event:MouseEvent):void
{
model.showHelpWindow = false;
}

override protected function draw():void
{
var hPad:int = 80;
var vPad:int = 50;

customPanel.move(hPad, vPad);
customPanel.setSize(width - hPad*2, height - vPad*2);

super.draw();
}
}
}

Ben McMaster

unread,
Mar 22, 2010, 3:46:04 AM3/22/10
to bumpslide
Actually, I just noticed that this is happening in the
Demo_04_ScrollPanel. When I just open the FLA and publish, everything
is fine. But, if I change the document height to say 600, you will see
the weird scroll bar movement. So bazaar.

BTW I am compiling with Flash CS4.

Thanks,

Ben

David Knape

unread,
Mar 24, 2010, 5:01:02 PM3/24/10
to bump...@googlegroups.com
I haven't seen this behavior.  Are you doing anything with 3D is the FLA?  There is some fancy matrix transformations happening in the DragBehavior class which account for rotation and other types of 2D transformation, but I've never tested in 3D.  I imagine a stage size change in a 3D environment could affect things.  Just a wild guess. 

Have you found out anything else about this in the last couple of days?

-dk

--
David Knape
Programmer / Consultant


--
--
Bumpslide Mailing List
http://groups.google.com/group/bumpslide

To post to this group, send email to bump...@googlegroups.com
To unsubscribe from this group, send email to
bumpslide+...@googlegroups.com

To unsubscribe from this group, send email to bumpslide+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

David Knape

unread,
Mar 24, 2010, 5:04:17 PM3/24/10
to bump...@googlegroups.com
Ok, I take it back.  It does seem a little off.  I'm away from the office this week, but I'll do some tests when I have a chance.  Thanks for the report.

-dk

--
David Knape
Programmer / Consultant


Ben McMaster

unread,
Mar 24, 2010, 9:49:55 PM3/24/10
to bumpslide
No problem. I was looking through the dragbehavior transformation
stuff for a while. I was under the gun so I just used a scroll bar
that I coded from scratch on an old project. Thanks for looking into
it. Let me know what the root of the problem is when you find.

Thanks!

/ben

> >> bumpslide+...@googlegroups.com<bumpslide%2Bunsubscribe@googlegroups .com>


>
> >> To unsubscribe from this group, send email to bumpslide+

David Knape

unread,
Mar 26, 2010, 12:02:31 AM3/26/10
to bump...@googlegroups.com
I think I got this one figured out. The problem occurs whenever the drag target is transformed.  In the scroll panel example FLA, the scroll handle is a regular movie clip that changes scale when its height is changed.  This transformation was throwing off the delta calculations in DragBehavior.  This symptom does not present itself when using a button drawn with code (such as in the default slider skin).  I almost always use bumpslide UI button components for my scroll handles which is why I never noticed this.  Anyway, I have added an extra transformation in DragBehavior to account for rotation and scale changes on the drag target.


Ben, update to the latest DragBehavior class from trunk, and this should be fixed.

-dk

--
David Knape
Programmer / Consultant


To unsubscribe from this group, send email to bumpslide+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.

Ben McMaster

unread,
Mar 30, 2010, 10:05:54 PM3/30/10
to bumpslide
Awesome. Thank you for that fix. I haven't had time to test it, but I
will let you know.
Reply all
Reply to author
Forward
0 new messages