Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / General Flash Topics / July 2008



Tip: Looking for answers? Try searching our database.

Click and drag constrained?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
simplestar44 - 16 Jul 2008 21:08 GMT
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 - 16 Jul 2008 21:43 GMT
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."
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.