PDA

View Full Version : Grab - n - drag


dteare
10-10-2004, 11:06 AM
Hi all,

When I use the "zoom in" feature of flash, I am able to "grab" the screen and move it around - just like in Acrobat reader.

Can I do this programmatically in my app without forcing the user to click "zoom in"? I would like to be able to have a large picture that is only partially viewable in the window, and let the user move it around with the mouse.

I was able to do this using clickable buttons (i.e. move left, move up, etc), but i think the grab-n-drag is much more user friendly.

Any thoughts?
Thanks!
--Dave.

metasarah
10-10-2004, 12:15 PM
Check out "dragstate" -- this is a contrived example, but you can run this and get the idea:


<canvas width="200" height="200">

<class name="box" bgcolor="red" width="50" height="50"/>
<view bgcolor="blue" width="500" height="500"
onmousedown="dragger.apply()" onmouseup="dragger.remove()">
<dragstate name="dragger" />
<view bgcolor="white" x="50" y="50" width="400" height="400">
<wrappinglayout spacing="70"/>
<box/> <box/> <box/> <box/> <box/> <box/> <box/>
<box/> <box/> <box/> <box/> <box/> <box/> <box/>
</view>
</view>

</canvas>

dteare
10-10-2004, 12:25 PM
Awesome - It works!

Thanks a lot!
--Dave.