Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » Flash

Click and drag constrained?

 
Jump to:  
 
simplestar44
PostPosted: Wed Jul 16, 2008 8:08 pm    Post subject: Click and drag constrained?
       
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!
 

 
David Stiller
PostPosted: Wed Jul 16, 2008 8:08 pm    Post subject: Re: Click and drag constrained?
       
simplestar44,

Quote:
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
LINK
"Luck is the residue of good design."
 

 
David Stiller
PostPosted: Thu Jul 17, 2008 3:40 pm    Post subject: Re: Click and drag constrained?
       
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
LINK
"Luck is the residue of good design."
 

 
simplestar44
PostPosted: Thu Jul 17, 2008 5:04 pm    Post subject: Re: Click and drag constrained?
       
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.
Sad:confused;
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

Teksty piosenek odżywki Zielona Góra Fotka odzież dla dzieci