Quantcast
Channel: Adobe Community : Discussion List - All Communities
Viewing all articles
Browse latest Browse all 238792

Path Drawing App

$
0
0

Hi All,

 

I'm having a problem with a Flash App that i'm trying to develop...

 

Basically i'm creating a program which allows a user to draw up to 3 paths onto the Flash stage by clicking different options in a pallete located at the side of the screen. These paths will be created in different layers (MovieClips) in three different colours. As yet i've only allowed the creation on the first path which is blue. The path is made up of different segments so when the user clicks the straight line button a straight line graphic is placed onto the stage. If the user then clicks the right angle button a right angle is placed onto the stage, its origin is set to the end point of the last segment placed onto the stage so it builds a path. i have several different buttons which create different angled pieces allowing the path to go in different directions. This all works fine as pictured...

1.jpg

 

 

The problem comes when the path becomes too large and leaves the stage. At this point i want the layer movieclip to scale by say 50 percent and center itself on the stage. So an auto zoom out effect to keep the drawing visible. This also works fine. However once the clip has been scaled the coodinates all go wrong. So when the user clicks to create another piece of the path it doesn't place it at the end of the last segment. I've been racking my brains with this and just can't seem to come up with a solution. The coordinates to which the next piece of path is placed is obtained by using localToGlobal on a movieclip which is nested in the last piece placed onto the stage. Surely even though the layer movieclip has been scaled the localToGlobal method should still be able to return the right coordinate?? Clearly i'm missing something here : (

 

See pic below, as you can see after the layer is scaled the coordinates seem to go all strange even though they are collected on each button click via localToGlobal

2.jpg

 

Any help would be massively appreciated!

 

Many Thanks

 

M


Viewing all articles
Browse latest Browse all 238792

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>