Take a look at my file, I have two buttons and I want them to be connecting with a dynamic line. When the button move, I want the line to still be connected. How do I do this?
Thanks
-Dean
Take a look at my file, I have two buttons and I want them to be connecting with a dynamic line. When the button move, I want the line to still be connected. How do I do this?
Thanks
-Dean
Hold on a minute mate and I’ll attach an FLV.
OK, hopefully you can work out how this works for yourself but if you can’t, don’t hesitate to ask me. One thing I had to break away from is that this only works if your two objects are MOVIECLIPS, not buttons. You could remedy your case by creating the buttons as usual and then selecting the button, hit F8 and choose a name and MOVIECLIP.
Sorry, forgot the attachment. Here it is…
hey thanks a lot man! Ok so can I just take the code from “scriptloop” and paste in into my movie? How does the line know what to connect itself to? Will this work with more than 2 mcs? Thanks man!!!
-Dean
The process is…
And that’s basically it. As for how it knows what to connect to, Flash seems to do this as if by magic! Here’s how…
Remember: When you draw your line, you HAVE to choose the “Hairline” option for the line’s stroke otherwise the stroke will get bigger and weird stuff will happen the farther away the two points are (try setting the line stroke width to something other than hairline and you’ll see what I mean).
As to your second point, if you want to draw another line, you can just copy the code from the blank movieclip again but change the number “1” in the attachMovie line (the depth) otherwise your second line will just replace the first one you’ve drawn.
Phew! Hope this helps…
wow thanks a lot man! What a lifesaver! Does the line HAVE to start in a 45 degree angle though? Because that is really annoying…
-Dean
crap! I can’t get it to work with the buttons I have!!! I think I just need someone to do it for me because I don’t really know how to code or use flash at all.
-Dean
OK, post the Flash file and I’ll do it. And about the line-you draw it at first, convert it to movieclip etc and then delete it from your stage so it isn’t actually on the stage when your movie starts, it’s just in your library.
Anyways, upload your FLA and I’ll have a look…
:: Copyright KIRUPA 2024 //--