Newbie flash question...

  • leapingfrog
  • Born
  • Born
  • No Avatar
  • Joined: Jun 04, 2004
  • Posts: 2
  • Status: Offline

Post June 4th, 2004, 3:35 pm

Hi guys,

I'm hoping that one of you can help push me in the right direction with some trouble I'm having.

Basically, I'm following this tutorial:
http://www.spoono.com/flash/tutorials/t ... use_follow

How would I make it so when the mouse pointer is outside of the flash plugin, the ball moves to a designated position (maybe moves to the center of the plugin)? Basically, I want the ball "stuck" in the center when the mouse pointer is not around. Rather than staying at the last spot the mouse pointer was at.

Thanks in advance,
Andrew
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 4th, 2004, 3:35 pm

  • Socno
  • Graduate
  • Graduate
  • No Avatar
  • Joined: May 26, 2004
  • Posts: 107
  • Loc: New York
  • Status: Offline

Post June 5th, 2004, 7:42 am

leapingfrog wrote:
Hi guys,

I'm hoping that one of you can help push me in the right direction with some trouble I'm having.

Basically, I'm following this tutorial:
http://www.spoono.com/flash/tutorials/t ... use_follow

How would I make it so when the mouse pointer is outside of the flash plugin, the ball moves to a designated position (maybe moves to the center of the plugin)? Basically, I want the ball "stuck" in the center when the mouse pointer is not around. Rather than staying at the last spot the mouse pointer was at.

Thanks in advance,
Andrew


That question was a hard one... Hmmm. I have been trying to code that one for you, but with no luck.
So sorry.
  • leapingfrog
  • Born
  • Born
  • No Avatar
  • Joined: Jun 04, 2004
  • Posts: 2
  • Status: Offline

Post June 5th, 2004, 10:37 am

Thanks Socno... at least now I know I'm not too stupid ;)

Basically, I'm building a website navigation, where I have 6 buttons layed out horizontally. When you move your mouse over the buttons, an arrow follows under the buttons (only moving on the x-axis). When they move their mouse outside the navigation, I want the arrow to move back pointing at the current section they're in.

I don't know if that helps any..... Is it even something possible?
  • rynoe
  • Banned
  • Banned
  • User avatar
  • Joined: May 31, 2004
  • Posts: 17
  • Status: Offline

Post June 5th, 2004, 8:20 pm

Something like this: LINK
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Joined: Jun 26, 2003
  • Posts: 1402
  • Loc: Philadelphia, PA
  • Status: Offline

Post June 5th, 2004, 10:38 pm

Since Flash cannot detect when the mouse is not over the movie, you cannot reset an object when the mouse leaves the viewable area of the movie.

A section of the movie... yes... via the hitTest() function. The movie as a whole.... 'fraid not.
  • rynoe
  • Banned
  • Banned
  • User avatar
  • Joined: May 31, 2004
  • Posts: 17
  • Status: Offline

Post June 5th, 2004, 10:58 pm

Lost in beta:

Again you are completely wrong.

Did you even bother to look at my link?

Are you still the arrogant 'know it all' I have come to know at all the other forums or are you willing to actually learn something new?
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Joined: Jun 26, 2003
  • Posts: 1402
  • Loc: Philadelphia, PA
  • Status: Offline

Post June 5th, 2004, 11:16 pm

I saw your link, and the hitTesting is inaccurate when I exit the movie from the top, left or right. It only works for the bottom.

I knew it would only be a short time before you showed your ignorance on this forum like you have on all the others.

I don't pretend to know it all, in fact, I still consider myself a novice. So don't pretend to know me rynoe, because you don't.
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post June 5th, 2004, 11:25 pm

rynoe wrote:
Lost in beta:

Again you are completely wrong.

Did you even bother to look at my link?

Are you still the arrogant 'know it all' I have come to know at all the other forums or are you willing to actually learn something new?


I checked it out and though it seems to work within the movie, nothing happens when you leave the movie (get a different context menu on right-click)

I thought of one way to pull this off using onEnterFrame checking if _root._xmouse & _root._ymouse are within an outer bounds figured with Stage.width & Stage.height but even at high FPS (tested @ 20FPS)proved it's self unreliable with fast mouse movements.

Reliability might be increased by also comparing an array with a set length of say 10 or so elements of past positions against its self and calling the "default placement function" if each element in the array added together then divided by the length of the array is equil to the last element in the array.

I've been putting alot on my plate lately so concept is all i can give for now sorry :wink:
Strong with this one, the sudo is.
  • b_heyer
  • Web Master
  • Web Master
  • User avatar
  • Joined: Jun 15, 2003
  • Posts: 4583
  • Loc: Maryland
  • Status: Offline

Post June 5th, 2004, 11:28 pm

Rynoe, if you continue to antagonize conversations, and cause anything less than a pleasant atmosphere with your posts we will ban you without a question. Consider this your first, last, and final warning.
Pixel Acres V2
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Joined: Jun 26, 2003
  • Posts: 1402
  • Loc: Philadelphia, PA
  • Status: Offline

Post June 5th, 2004, 11:28 pm

joebert: The problem with that concept is that Flash reads the _xmouse and _ymouse position as it's last location within the movie. So if you mouse isn't over the movie, it reads the last location your mouse was and still considers your mouse to be within the movie.

I'm sure there are some hacks you can do for a bit of accuracy, but all in all there is no efficient method for Flash. I believe Director on the other hand has the ability to detect the mouse position even when it isn't over the movie... that would provide more efficient detection. Why they don't add this for Flash i'm not sure (or maybe i'm wrong and Director can't do this).
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post June 5th, 2004, 11:50 pm

lostinbeta wrote:
if you mouse isn't over the movie, it reads the last location your mouse was and still considers your mouse to be within the movie.


That is where the set length array comes into play :D ok it might take two arrays :P

if on each enterFrame you over write the element above with the element below and add the new _x/ymouse to the end,
10 onEnterFrames with the mouse not on the movie would give you an array with 10 identical numbers, add the numbers together, divide by array length (giving N)and if array[array.length-1] == N then call default placement function.

Of course if the mouse has moved then array[array.length-1] == N will return false.

I realize this check would also have to be made only if the mouse was on or close to the edge of the movie which would require another bound be set with a greater margin than the first check resulting in defaultPlacement being misfired if the user rests the mouse to close to the edge, but how many times out of X do you think that would happen ?

I'm not suggesting this is "The" fix, just trying to spark some ideas :D
Strong with this one, the sudo is.
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Joined: Jun 26, 2003
  • Posts: 1402
  • Loc: Philadelphia, PA
  • Status: Offline

Post June 5th, 2004, 11:59 pm

Ok, if I am understanding correctly, wouldn't this method return true even if the user just has their mouse hovering over the movie motionless? Since the array(s) will still fill up with 10 of the same position thus cancelling eachother out and returning true.

Unless i'm misunderstanding... it is 3am here after all...haha.
  • rynoe
  • Banned
  • Banned
  • User avatar
  • Joined: May 31, 2004
  • Posts: 17
  • Status: Offline

Post June 6th, 2004, 11:42 pm

b_heyer wrote:
Rynoe, if you continue to antagonize conversations, and cause anything less than a pleasant atmosphere with your posts we will ban you without a question. Consider this your first, last, and final warning.



Then ban me then you nazi asshole!
  • joebert
  • Sledgehammer
  • Genius
  • No Avatar
  • Joined: Feb 10, 2004
  • Posts: 13455
  • Loc: Florida
  • Status: Offline

Post June 7th, 2004, 6:49 pm

lostinbeta wrote:
Ok, if I am understanding correctly, wouldn't this method return true even if the user just has their mouse hovering over the movie motionless? Since the array(s) will still fill up with 10 of the same position thus cancelling eachother out and returning true.

Unless i'm misunderstanding... it is 3am here after all...haha.


There would be two bounderies around the movie, one about 3 pixels that if _x/ymouse was inside of it at any time would fire the defaultPlacement function immediately.

The Second boundery would be slightly larger, say 5-10 pixels and if the mouse leaves the movie chances are that the last _x/ymouse that gets tracked will be inside this boundery (think of it as a backup incase the mouse tracking skips the first boundry from fast mouse movements), So if the Array stuff only gets called if _x/y mouse are within this second boundery then I think it's safe to say 9/10 times this concept will produce desired results being I don't see many people resting the mouse close enough to the bounderies to fire it :D
Strong with this one, the sudo is.
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Joined: Dec 20, 2002
  • Posts: 6382
  • Loc: twitter.com/unflux
  • Status: Offline

Post June 8th, 2004, 3:19 pm

rynoe wrote:
Then ban me then you nazi asshole!

done -- some people never learn.
UNFLUX.FOTO
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 8th, 2004, 3:19 pm

Post Information

  • Total Posts in this topic: 19 posts
  • Users browsing this forum: No registered users and 27 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.