Solved

MAKE LINE GROW DIAGONALLY

Posted on 2003-11-01
11
738 Views
Last Modified: 2008-02-01
If I draw a diagonal line in flash and convert it to a symbol, how do I make its width grow to 100% on that angle. I have a map with  I would do it the easy way by tweening a blocker over it but the line is over an image and the blocker would be noticeable.  I will need to make a bunch of these growing lines at various angles.  Here's what I'm working on http://dev.fusionapps.com/wboe/flash/wboe_map_links2.html  The John F. Kennedy link is an example with a tweening blocker and want to replace with code.  I will need to do the same on the rest of the buttons.

Any help would greatly be appreciated and 500 points to the expert with the solution.
0
Comment
Question by:madasczik
  • 6
  • 5
11 Comments
 
LVL 27

Expert Comment

by:negatyve
ID: 9664701
Sorry if I have already asked you, but: with flash 5 or flash mx?
0
 

Author Comment

by:madasczik
ID: 9664721
This will be for MX, was using Flash 5 for a different project by request.  Might as well kill two birds with one stone, got an additonal question here http://www.experts-exchange.com/Web/WebDevSoftware/Flash/Q_20785183.html  for 500 points as usual.
0
 
LVL 27

Expert Comment

by:negatyve
ID: 9664728
ok, could you post your fla (to avoid starting to create the example from scratch)?
0
 

Author Comment

by:madasczik
ID: 9664734
0
 

Author Comment

by:madasczik
ID: 9666967
Does this have anything to do with it, don't understand it completely, guess we need to calculate slope first, found this site:

http://www.kirupa.com/developer/actionscript/backface_culling.htm

Was able to get the code, maybe it can be modified to calculate the angles of drawn lines.:

function ()
{
    return((b._y - a._y) / (b._x - a._x) - (c._y - a._y) / (c._x - a._x) < 0 ^ (a._x < b._x ^ a._x < c._x));
} // End of the function
isVisible = function ();
c.onPress = startDrag;
b.onPress = startDrag;
a.onPress = startDrag;
c.onRelease = stopDrag;
b.onRelease = stopDrag;
a.onRelease = stopDrag;
c.onReleaseOutside = stopDrag;
b.onReleaseOutside = stopDrag;
a.onReleaseOutside = stopDrag;
a.hitArea = a.dot;
b.hitArea = b.dot;
c.hitArea = c.dot;
this.onEnterFrame = function ()
{
    this.clear();
    this.lineStyle(2, 7829367, 100);
    this.moveTo(c._x, c._y);
    if (isVisible())
    {
        this.beginFill(16756655, 100);
    } // end if
    this.lineTo(a._x, a._y);
    this.lineTo(b._x, b._y);
    this.lineTo(c._x, c._y);
    this.endFill();
} // End of the function


Also found this on expert exchange, this is not to clear either to me:

http://www.kirupa.com/developer/actionscript/backface_culling.htm

If you need more points, let me know and I'll start a new question.

Your help is unprecedented, thank you.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 27

Expert Comment

by:negatyve
ID: 9667523
no no, that's ok, i'm working on the example.. :)
0
 
LVL 27

Accepted Solution

by:
negatyve earned 500 total points
ID: 9668182
htm: http://www.negatyve.com/EE/wboe_map_links/wboe_map_links.html
fla: http://www.negatyve.com/EE/wboe_map_links/wboe_map_links.zip

you have to change imagesXX_mc on the main timeline, one for each button
0
 

Author Comment

by:madasczik
ID: 9668275
works great, its gonna look real good when i get the good images in there.  thanks once again.
0
 
LVL 27

Expert Comment

by:negatyve
ID: 9668288
;)
0
 

Author Comment

by:madasczik
ID: 9676194
Can you comment the fla for me, its doing a lot in the main timeline, 500 points  http://www.experts-exchange.com/Web/WebDevSoftware/Flash/Q_20786956.html
0
 

Author Comment

by:madasczik
ID: 9676379
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

This is a very simple example to help those of you who are still migrating from AS2 to AS3 understand the redesigned event model in AS3. In AS2.0, event functions (that is, the function to be performed when an event is fired) were stored as a pro…
This is intended to introduce all collision detection principles in flash, their strengths, weaknesses and workarounds. The main method for Collision Detection in flash is using hitTestObject. But unless you'll be pushing rectangular shapes without …
In this tutorial viewers will learn how to create a basic motion tween animation in Flash Open a new document in Flash: Draw/import an image: Press CTRL + F8 to convert it into a graphic symbol: Select a frame (how long you want the tween to last): …
The goal of the tutorial is to teach the user how to select which audio input to use. Once you have an audio input plugged into the laptop or computer, you will go into the audio input settings and choose which audio input you want to use.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now