Advanced Flash MX
- Started
- Last post
- 13 Responses
- stewart
this is too advanced for me, but maybe someone in here knows how to solve the following problem with Flash MX actionscripting.
i want to build a "draggable triangle", but with one fixed corner. (point F in the illustration).
line A-B is sticking to the mouseposition, and always horizontal.
illustration:
who can give me a push in the right direction?
- Seph0
depends how flexible and robust the final object needs to be.
If it was me I would not bother sweating over complicated maths formulaes.
I would create a shape tween of the entire animation (through 180 degrees or however long you need it) and stick it in a MC.
then using a code that calculates the angle of the mouse from point F (whilst user drags), then control where the playhead goes in the MC depending on this angle.
The results might lag a tiny weeny bit behind the mouse and it will need lots of tweaking but I think you could blag it this way.
- Seph0
Got the perfect .fla for you, I just sent it by email.
Thank me in flash heaven.
- stewart0
thanks Seph!
but have a look at this (and turn your sound ON):
http://www.vahk.nl/client/bdprij…i need a real spotlight effect to select the little persons...
it is going to be a website where you can vote on people for getting the 2003 VolonteerAward.
- stewart0
now i've seen the fla you sent - thank you so much.
i hope i can modify it so i can use it for this project!
- Seph0
Its cute, I like the characters, it should be quite easy to adapt that fla I sent you to create the mask shape you need.
If you have problems, get back to me and I will adapt it for you, Im bored of what Im doing today so Ill do your work for you (-:
but its probably best you have a go at adapting it yourself first, that way you learn something.
good luck,
- stewart0
hey Seph, mail me an illustration of you in the http://www.vahk.nl/client/bdprij… style, so i can add you as a volonteer!
maybe you're the future winner of the 2003 Dutch VolonteerAward!but if you're really bored today, you can try to change the actionscript to get this effect.
thanks anyway!
- Seph0
Nice idea ! but Im not realy an illustration talent, I wouldnt want to mess up your design.
email me when you get stuck, I might have time to have a go later today.
- unknown0
Here Stewart I made it for you plain and simple...I included comments too....you have 2 invisible MCs on the timeline. I've placed actionscript stuff on both MCs. Tell me if you understand everything (it should be very very simple to understand)
http://www.uniquent.com/4Stewart…
Cheers.
- stewart0
Boz, i'm in tears - it's so beautifull!
nice script - very very useful, but is it possible to start dragging from the "onLoad"-moment?
(trying to figure it out, but i'm just a graphic designer - not an actionscript programmer).
- unknown0
stewart,
I'm not sure what you're asking..
I forgot to tell you that you can define width of the triangle both setting the width of the mover MC's width manually or from AS using _width.and btw I'm a designer too :) Learn more of AS it will help you market yourself better. The future is not for designers only anymore. You need to be a designer and developer in one to get solid money. :)
- stewart0
true words, boz.
but i think it isn't easy to be designer and "developer" in one, if i have to build the website i'm desinging it has effect on the design (not a complicated design).look at the website i've build a year ago for the designstudio i'm working - cost me 4 months to figure this out: http://www.vahk.nl haha.
and my sisters website too: http://www.kulsdom.comnow, what I tried to ask you is: in your example you have to click before you can drag the "mover".
i'm now trying to modify your .fla to make the mouse dragging the mover directly after loading the swf, without clicking the mover first...
damn, is that english?
- stewart0
I guess not. damn.
- unknown0
You need to read up on the Flash MX Drawing Tools API. You could code your triangle in about 6 lines of pure code with no tweens/movie clips/library, etc. If you are curious I can send you an example.