Flasher Archive

[Previous] [Next] - [Index] [Thread Index] - [Previous in Thread] [Next in Thread]


Subject: Re: FLASH: YIKES i need help (F5 needs to be F4)
From: Kristopher Schultz
Date: Sun, 10 Dec 2000 16:43:22 GMT

I wasn't able to get your code to work right, probably just because I don't
know how your symbol instances are laid out. But if you know it works...

The only thing in there that isn't Flash 4 campatible is the mouse position
property stuff (_xmouse, _ymouse). To get the mouse position in a Flash
4-safe way, you need to create an invisible Movie Clip (just create a MC
that has nothing in it) place it in the timeline (or maybe inside the bdg
clip in your case) and set it to be draggable right away. This way it will
"chase" the user's mouse and you can just check its position to tell where
the mouse is. Note: you can't have any other clips being dragged at the same
time for this to work.

As far as I can tell, you should just need to change these lines...
mousex = varbgd._xmouse;
mousey = varbgd._ymouse;
...to something like this...
mousex = varbgd.mouseTracker._x;
mousey = varbgd.mouseTracker._y;

If you have problems, you could try sending me the file directly and I'll
look at it.


kristopher schultz
technical director of interactive services
mills james productions - new media division

@ www.millsjames.com - columbus, ohio


> From: "avex" <listatobjekt [dot] com [dot] au>
> Reply-To: flasheratchinwag [dot] com
> Date: Tue, 5 Dec 2000 09:07:54 +1000
> To: <flasheratchinwag [dot] com>
> Subject: FLASH: YIKES i need help (F5 needs to be F4)
>
> Hi guys...
>
> I got into my first bit of actionscripting this
> weekend....well...really....i tried to modify somone's code from a file on
> flashlist in an attempt to learn it.
> Everything went great, the file and scripting worked fine. However I went
> to test on other computers and nothing happened......and I realised I must
> have had Flash 5 specific code.
> The problem is that the client is crazy about compatability, and everything
> had to be Flash 4.
>
> Can someone try and help me convert this code to F4 compatible code?
>
> Essentially, all it is is a movie clip that moves left or right depending on
> where the mouse is on the screen.
>
> the code is:
>
>
> //variable for the image instance path
> varimg = _root.img
>
> //variable for the background instance path
> varbgd = _root.bgd
>
> //speed of the mouse scroll (between 0 and 1)
> v=0.02
>
> //mouse position
> mousex = varbgd._xmouse;
> mousey = varbgd._ymouse;
>
> //image position
> imgx = getProperty(varimg, _x);
>
>
> //distance fom the center to the left, right, top and bottom side
> left = getProperty(varimg,_width) / 2
> right = (getProperty(varimg,_width) / (-2)) + (getProperty(varbgd,_width))
>
> //scrolling of the image
> setProperty (varimg, _x, (imgx+(mousex*v)));
>
>
> //stop the image on the horizontal side
> //left
> if (getProperty(varimg, _x) >= left) {
> if (mousex > 0) {
> mousex = 0
> setProperty(varimg, _x, left); }
> else if (mousex < 0) {
> mousex = varbgd._xmouse ;
> setProperty (varimg, _x, (imgx+(mousex*v))); }
> }
> //right
> if (getProperty(varimg, _x) <= right) {
> if (mousex < 0) {
> mousex = 0
> setProperty(varimg, _x, right); }
> else if (mousex > 0) {
> mousex = varbgd._xmouse ;
> setProperty (varimg, _x, (imgx+(mousex*v))); }
> }
>
>
>
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> flasher is generously supported by...
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> flashforward2000 and the Flash(tm) Film Festival
> November 27-29, 2000, LONDON, National Film Theatre
>
> Produced by United Digital Artists and lynda.com
> -Sponsored by Macromedia, Adobe Systems and Apple Computer
> -http://www.flashforward2000.com or UK tel. +44 (0870) 751 1526
> Register before November 10 and save �200
> http:// www.flashforward2000.com
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> To unsubscribe or change your list settings go to
> http://www.chinwag.com/flasher or email helpatchinwag [dot] com
>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flasher is generously supported by...
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
flashforward2000 and the Flash(tm) Film Festival
November 27-29, 2000, LONDON, National Film Theatre

Produced by United Digital Artists and lynda.com
-Sponsored by Macromedia, Adobe Systems and Apple Computer
-http://www.flashforward2000.com or UK tel. +44 (0870) 751 1526
Register before November 10 and save �200
http:// www.flashforward2000.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To unsubscribe or change your list settings go to
http://www.chinwag.com/flasher or email helpatchinwag [dot] com


Replies
  FLASH: YIKES i need help (F5 needs to be, avex

[Previous] [Next] - [Index] [Thread Index] - [Next in Thread] [Previous in Thread]