Im trying to simulate dragging or scrolling of a web page in an iphone. I know
some of the code to create the click and drag but i dont know how to constrain
the dragging to just horizontal and vertical.
any help would be great!
simplestar44,
> I know some of the code to create the click and drag
> but i dont know how to constrain the dragging to just
> horizontal and vertical.
Fortunately, that's built right into the startDrag() method as an
optional parameter. What version of ActionScript are you using?
David Stiller
Co-author, Foundation Flash CS3 for Designers
http://tinyurl.com/2k29mj
"Luck is the residue of good design."
simplestar44 - 17 Jul 2008 18:04 GMT
hey there! thanks for the info. I figured that out!
Now i have a bigger problem though. I set the image to be a draggable element.
( this means the cursor becomes a hand obviously ). What I want is to make one
portion of this graphic a button so the user drags the image into view and then
clicks on the area of the graphic that has a button to navigate to another
scene.
The problem is, when i create a button and place it in the movie ( image ), it
doesnt recognize it as a clickable button.
Essentailly its a web page that scrolls as the draggable element and at the
bottom of the page has buttons. I dont know how to put them in this.
:(:confused;
David Stiller - 17 Jul 2008 18:40 GMT
simplestar44,
It sounds like you're using ActionScript 1.0 or 2.0, then. Prior to
AS3, you can't really nest your mouse-related events, because the outer-most
symbol overrides everything beneath it.
The usual workaround in this case is to use the MovieClip.hitTest()
method on the inner symbol. You'll still be looking for a press (or
release) on the parent clip, but hitTest() will tell you when the mouse
happens to be within the confines of the inner clip (or whatever arbitrary
area you specify).
David Stiller
Co-author, Foundation Flash CS3 for Designers
http://tinyurl.com/2k29mj
"Luck is the residue of good design."