mc moving

  • mvotre
  • Novice
  • Novice
  • mvotre
  • Posts: 21

Post 3+ Months Ago

hey dudes... im tring to solve this problem for a few days, with no sucess :evil: :evil:

i need to move the mouse over an image, and as you move it, in a place will appear a image a lot bigger.

i have a test file with a lot of code that was suposed to work (damn book!!!!! :evil: )

http://mentesociosas.vila.bol.com.br/teste6.fla copy+paste

you need to copy and paste the link (sorry)
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

And thus is the infamy of copy and paste.

Anywho, I can't really tell exactly what your code is supposed to be doing, but if it does what I think it does, then it is doing it inefficiently. Can you explain more what it does?
  • mvotre
  • Novice
  • Novice
  • mvotre
  • Posts: 21

Post 3+ Months Ago

well.. in the book where i get the code (Actionscripting in flash - by Phillip
Kerman), the code was suposed to do:

when you click and move the mouse over the small image, the area where the mouse is appear bigger in the square (a mask for the same image bigger). but no matter what i try, it dont work at all. maybe the problem could be in the fact that the cursor dont change when you pass it over the image (like buttons do?)?????

PS: sorry to all for my poor english!! cos ima brazilian! :?
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

ahh I think I know what he needs --

A mask to follow the mouse, and displays a larger image, a zoom of the
bg image, in a square around the mouse. Here's a couple tutorials that
are based on what you need, but they aren't exact --

- http://www.kirupa.com/developer/flash5/textmask.htm
- http://www.kirupa.com/developer/actions ... _masks.htm

for something more customized, i know lostinbeta can answer this
quicker than I can, so I'll let him.
  • mvotre
  • Novice
  • Novice
  • mvotre
  • Posts: 21

Post 3+ Months Ago

no dude.. sorry for making it dificult to understand. the bigger image displays in a square, but not around the mouse. in a point where i already got the masked image (as i posted on the .fla)
if i got a host wich allows directlinking, i would post a diagram of what i wanted to see.

i will post the code that i got and dont work here. so if someone thinks that can solve my problem, just download the .fla that i atached in the first post.

onClipEvent (load) {
mine=_root.big.getBounds();
mine.width=mine.xMax-mine.xMin;
mine.height=mine.yMax-mine.yMin;
my=getBounds();
my.width=my.xMax-my.xMin;
my.height=my.yMax-my.yMin;
}
onClipEvent(mouseDown) {
clicking=1;}
onClipEvent (mouseUp) {
clicking=0;}
onClipEvent(mouseDown){
if (hitTest(_root._xmouse,_root._ymouse,0)){
clicking=1;}}
onClipEvent(mouseMove) {
if(clicking){
varxPercent=(_xmouse-my.xMin)/my.width;
xPercent= Math.min(xPercent,1);
xPercent= Math.max(xPercent,0);
_root.big.x=mine.xMin+(mine.widht*xPercent);

varyPercent=(_ymouse-my.yMin)/my.height;
yPercent=Math.min(yPercent,1);
yPercent=Math.max(yPercent,0);
_root.big.y=mine.yMin+(mine.height*yPercent);
}
updateAfterEvent();
}
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

Oh wait! I think I know what you are looking for!

And I know where you can get an open source file to learn more about this.... if it is indeed what you are looking for.

Go here... http://www.umbc.edu/interactive/fla/index.php then in the search field type in "Zoom Cursor", it should return only one result, that result being the file I think that conveys what you are trying to do.
  • mvotre
  • Novice
  • Novice
  • mvotre
  • Posts: 21

Post 3+ Months Ago

thanks dude!!!!!!!!!!!! you rock!!! this is just what im looking for :D :D
thanks to you and all the others dudes that tried to help me!!
  • lostinbeta
  • Guru
  • Guru
  • User avatar
  • Posts: 1402
  • Loc: Philadelphia, PA

Post 3+ Months Ago

Glad I could help!
  • UNFLUX
  • Genius
  • Genius
  • User avatar
  • Posts: 6376
  • Loc: twitter.com/unflux

Post 3+ Months Ago

just trying to help, sheesh :roll:

Post Information

  • Total Posts in this topic: 9 posts
  • Users browsing this forum: No registered users and 4 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
 
cron
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.