flash actionscript:
I'm looking at simulating a computer's mouse in Flash, and I'd like the cord to follow the mouse around as it moves around the screen. Is there some way to do it, so that it looks natural (not just a straight line following the mouse)? Thanks in advance.
[quoted text, click to view] "twistedpancreas" <webforumsuser@macromedia.com> wrote in message news:dttuc4$8s3$1@forums.macromedia.com... > hmm a few problems with that file is that the centre of the line > likes to start > from the top left hand corner, it also likes to be on top of all > graphics. > > So if you could help me out there that would be much appreciated, > or if any > one else has a solution to my problem
Can you use a more simplified effect? You can use moveTo and lineTo just to make the wire curve to the mouse. It's not as cool looking but a lot easier to manage. It could be improved with a second curve into the head of the mouse. http://www.kompanionkare.net/flash/curveLine.html tralfaz
Again, the button is an anchor. Drag it to wherever you want the line to start (It is a very tiny dot on the stage--easy to miss if you aren't looking for it). As far as being on top of everything, I don't know what to say there--I would try moving it down layers to see if that makes a difference. For the time being I will keep the source available for download. If anyone can help this guy out I would appreciate it. I don't really understand the code much myself--I just happened to have a copy of it.
This is as close as I can get. Feel free to download the source code. Don't ask me the logic behind it, because I don't know. You will just have to mess around with it to get it the way you want. There is a button, which is the anchor (move it to wherever you want the string to start). There is a movie clip too, but it doesn't really matter where it is (has some actionscript associated with it), and then there is a little actionscript on the frame itself. http://www.emailden.com/download/ line.fla line.swf Please let me know after you download it as I would like to disable the download after it is complete.
wow that looks like what i'm exactly after!!! thanks i'll check it out!!!
hmm a few problems with that file is that the centre of the line likes to start from the top left hand corner, it also likes to be on top of all graphics. So if you could help me out there that would be much appreciated, or if any one else has a solution to my problem
[quoted text, click to view] "twistedpancreas" <webforumsuser@macromedia.com> wrote in message news:du0hp3$soa$1@forums.macromedia.com... > that's exactly what i'm after tralfaz, but you're fla file is > different to the > swf shown on you're site. > > i tried to understand the code but it's a bit advanced for me. > > any chance of checking out the fla file for you're swf file? > > thanks once again guys
Sorry.. I got ahold of the wrong file for the zip. Use this one.. http://www.kompanionkare.net/flash/curveLine2.html tralfaz
that's exactly what i'm after tralfaz, but you're fla file is different to the swf shown on you're site. i tried to understand the code but it's a bit advanced for me. any chance of checking out the fla file for you're swf file? thanks once again guys
ok what i would like to see happen is if the mouse moves to a certain x,y co-ordinate, then it would jump to another frame in the timeline and play. is this possible if the code for is: _root.mid_mc._visible = false; _root.mouse_mc.mouse_tip_mc._visible = false; _root.mouse_mc.swapDepths(10); // higher in Z than the line drawing to hide the wire function initialize() { this.createEmptyMovieClip("mc", 1); } this.onMouseMove = function() { initialize(); // erase previous line and create a new one _root.mid_mc._x = _root.mouse_mc._x + (_root.start_mc._x - _root.mouse_mc._x) * 1.1; _root.mid_mc._y = _root.mouse_mc._y -30; mc.lineStyle(3, 0x002255, 100); mc.moveTo(start_mc._x, start_mc._y); mc.curveTo(mid_mc._x, mid_mc._y,_root.mouse_mc._x,_root.mouse_mc._y); } this.onMouseDown = function() { if(_root.mouse_mc.hitTest(_root._xmouse, _root._ymouse)) { _root.mouse_mc.startDrag(false); } } this.onMouseUp = function() { stopDrag(); }
I really don't know actionscript that well, and I don't know if this would help, but I would just create a box, make it a button, drag frame 1 to frame 4 inside the button, add actionscript that said: on (rollOver){ gotoAndPlay("somewhere") }
kind defeats the purpose of having the move mouse around code on it though doesn't it? basically i'd like the mouse to be able to be moved around freely, but when released at a certain point on the screen it will then tell the timeline to jump to a certain frame (ie a next screen)
that looks good NSurveyor i'll get back to you, and sorry i can't show the site cause it's not available to the public yet, i might try a skeleton version of it to show you what i want, but NSurveyor's file might be a go'er.
Don't see what you're looking for? Try a search.
|