Unable to draw lines

Hi all

I am developing a game. I need to draw graphics on the stage.

I created a file to draw the line. SA fie is as follows

**********************************

package

CustomPuzzle

{

Import flash.display.Shape;

Import flash.display.Sprite;

public class DrawPuzzle extends Sprite

{

public function DrawPuzzle()

{

var mySprite:Sprite = new Sprite();

mySprite.graphics.beginFill (0xFFFFFF);

mySprite.graphics.moveTo (100,100);

mySprite.graphics.lineTo (200,200);

}

}

}

**********************

In my parent file, I created the instance of the class .as as follows

<? XML version = "1.0" encoding = "utf-8"? >

< mx:Application

creationComplete = "CreateCompletePhase ()" xmlns:mx =" " http://www.Adobe.com/2006/MXML "layout =" " absolute "backgroundGradientAlphas =" " [1.0, 1.0] "backgroundGradientColors =" " [#040404, #050303] " >

< mx:Script >

<! [CDATA]

Import CustomPuzzle.DrawPuzzle;

private function CreateCompletePhase():Sub

{

     var Cust:DrawPuzzle = new DrawPuzzle();

}

[]] >

< / mx:Script >

< / mx:Application >

But I am not able to draw the line... Please suggest me

You can also simply use it as a file too...

package

 

CustomPuzzle

{

Import flash.display.CapsStyle;

Import flash.display.Sprite;

Import mx.graphics.Stroke;

public class DrawPuzzle extends Sprite

{

public function DrawPuzzle()

{

graphics.beginFill (0xFFFFFF);

graphics.moveTo (100,100);

graphics.lineTo (200,200);

var STROKE: stroke = new Stroke (0xFFFFFF, 3, 1,false,"normal", CapsStyle.NONE)

Stroke.Apply (Graphics);

graphics.endFill ();

}

}

}

Be sure to call the graphics.endFill () method when you use the beginFill() method because after calling the endFill() method only the graphics are actually drawn or rendered.

Thank you

Jean Claude Chari

Tags: Flex

Similar Questions

  • Unable to draw the table 1 d with a cluster of 2 items on a XY Chart

    I am unable to draw a table 1 d with a cluster of 2 items on a XY Chart. The data displayed at the entrance in the graph, but nothing is drawn. I'm trying to draw a line connecting each point generated.

    You need a registry change on the inside of loops as well.

    But beyond that, you create too complicated a structure.  You create several plots of 1 point and not a single multipoint parcel.

    See attachment for the change that works.

  • draw lines on the graph of the intensity

    I want to draw lines on the graph of the intensity.

    I am already looking for some questions before.

    I know there is a vi could draw line on the graph of the intensity by dragging the mouse.

    But I need more precisely what set the length and the angle between the horzontal line.

    The setting is very ideal for me. But I don't know how to use it in the intensity chart.

    Is there anyone can help or give some advice?

    Your example is not so great because it uses 100% of CPU on a kernel at any time, do nothing.

    Here's a quick rewrite of my old example here. He draws an angle with the specified length and angle to where you click on the chart. This should help you get started. Modify if needed. (Also remember that trigonometry is much easier when using complex numbers )

  • laptop HP pavilion 17 64-bit: draw lines on your desktop

    can someone explain how to draw lines on the desktop? I am currently working on a project that requires lines to be drawn on some of the pictures on the desk. to make things more complicated, I don't use a mouse, and my computer has not left and right click buttons! He has a very sensitive touchpad, so there is not to hold a left or right button as possible on most computers. so, for the moment I tenderly your help there, to try to solve this problem. If there is a solution, that is! I have to admit that this is something new for me, but you live and learn to do not you?

    Thank you very much in anticipation.

    Glad to hear the clicks of mouse work for you about the graphics program, it seems that you need something which will give you a fairly accurate line length measurement while you draw the line is - that correct? Photoshop Elements can meet your needs. In my opinion, it costs about $80.

    In Photoshop Elements, while using the online tool, it gives you a measure of angle in real-time and (to the thousandth inch) length of the line you draw. Here is a picture to demonstrate:

    Only a slight glimpse of the line appears while you actively draw, then the complete line appears after you release the mouse button. You can customize the line to any desired pixel width. Each new line creates a new layer 'Shape' on top of your image, which can then be resized or moved or otherwise handled, according to the needs.

    I hope this helps. Your assignment seems deceptively simple please let me know if there is anything else I can do to help.

  • draw lines parallel to the y axis in chart

    I want to draw lines on a chart programmatically.

    In the attached vi, I displayed a histogram chart.

    I need to draw two lines parallel to the axis y places different x axis to show the bounds / range of values.

    kindly help me in this.

    Thank you in advance.

    Maybe two sliders?

  • draw lines on a map in paint

    Hello

    How to draw a line on a map in the painting of windows 7 with the line tool?  in older versions of paint, I could draw a line and click and then move to the next area.  in windows 7, I can draw a line, but there are two white dots at each end.  I clicked, double clicked, right click... nothing changes.  the only way to get the line to stay on the plan is to stick and the back arrow.  If I paint multiple directions on a map, it gets old fast.

    so, how to draw any line of the size of the point a to point b and he can stay?

    Thank you

    After experimenting with the whole program, I can now draw lines and place them where they should go on any card.  He just took the time to experiment and try different methods.

  • I have an invisible background and I want to just use a bursh paint to draw lines thick som to create a cache. the brushes do not seem to paint.

    I have an invisible background and I want to just use a bursh paint to draw lines thick som to create a cache. the brushes do not seem to paint.

    Hi Normannixon2,

    Could you please confirm whether the background is Transparent or white.

    Also when you use the Paintbrush tool, please check the opacity and flow of the Brush tool.

    Kind regards

    Tanuj

  • circles and drawing lines

    How to draw lines and circles? Thank you.

    Using various annotation tools available under the comment Panel.

    We sea, Sept. 23. 2015 00:48, peterg21588935 [email protected]>

  • Draw, Line and sketch all crashing on iPad if Bluetooth we

    Colleagues, draw, draw, line and sketch (all updated) all immediately plant them on my iPad (most recent iOS) if I have the Bluetooth ON (to my stylus), but all three apps work fine if bluetooth is DISABLED (can not use the stylus for the full potential). Do not have any problems with the iPad or other applications. Web watch search this has been a problem but can't find any resolution, fix, patch, etc. A few weeks of the trial and no luck, ideas and advice most welcome... - Andrew

    What iOS version are you running? If you are using iOS 9 beta builds, there is a known issue with Bluetooth with these applications. The workaround is to disable Bluetooth.

    Hope that helps,

    Frank

    Engineering drawing

  • Draw lines around shapes

    Hi guys,.


    I love this design and would try to do it as an exercise.


    Captura de pantalla 2015-06-26 a la(s) 10.44.23.png


    Captura de pantalla 2015-06-26 a la(s) 10.44.39.png


    Captura de pantalla 2015-06-26 a la(s) 10.44.02.png

    How you think is the best way to draw lines around a circle. I know it's better to draw the line and then apply "Offset" or this will avoid the future edition and changes.

    In addition it is very interesting the transparency / multiply effect when two colors mix.

    Thanks for any advice!

    Best,

    Hi SebastiaoV,

    I would first create circles and position them.

    Then (with Smart Guides turned on), I would create the path by using the centers of the circles.

    Race as thick as you want and use round caps and rounded corners.

    Make another layer and repeat with different colours.

    Tone

  • using annotations of drawing, line free hand; How can you apply a fill or shadow of the object/area?

    using annotations of drawing, line free hand; How can you apply a fill or shadow of the object/area?

    You can not. The fill color property applies only to the following observation

    types: circle, square, line, Polygon, PolyLine, FreeText

  • What should I use to draw lines on a map?

    Is it a drawing of the tool that you can attach to your computer to draw lines? The cursor is not precise enough to draw lines on a map (jpeg). Is there a tool I can buy and fix to draw on my screen using PS?

    Thank you post again - I recommend no doubt using the pen for what you are trying to do. Trying to map free hand lines is very difficult, but the pen tool offers precise control. I have outlined some steps for you to follow below.

    1. open your image and select the Pen tool from the toolbar, as shown below.

    2. I would recommend zoom in your image to make it easier for you to track on the lines of the complex plane. To do this, select view > Zoom In, or hitting "control +" (Windows) or ' command + ' (Mac) on your keyboard.

    3. then create a new layer by clicking the new layer in the layers panel, as shown below. Draw your lines of card on a new layer to preserve your original map image in case you make a mistake or want to start over.

    4 using the Pen tool, tracing on the lines of the map of your boot image. Here I begin to Bellevue and suite I90 to Ellensburg. Using the tool pen takes some practice. To get detailed help about how to use the pen tool, watch videos of Terry White I linked in my previous post.

    5. Once you have finished tracing over the lines of the map, go in the tracks Panel by clicking on the "Paths" tab in your layers panel.

    6. in the tracks Panel, click the icon of the path highlighted below. This caresseront the way you created using your most recent Brush tool settings - I will go into this more again to the next step.

    7. you can see that the way that I created with my pen tool has been rubbed with yellow and aligns very well with the original line of the card. You can change the size and color of your run by selecting the Brush tool in the toolbar and clicking the tools described below.

    8. when I have to zoom out, you can see I have drawn precisely the line of the card. I did it very quickly so with patience, you can create extremely accurate map lines.

    I highly recommend watching the video of Terry White on how to use the pen tool. The pen tool is the best way to create very relevant and precise lines apart from the purchase of an external drawing tablet.

    I hope this has helped! Good luck!

  • How to draw lines on a map with CS4

    I have CS4 and would like to know how to draw lines on a map image. I'm a beginner, so what do I do?

    It's about CS6, but CS4 would be a similar process:

    Here's a way to draw a line:

    Select the pen tool.

    Make a new layer which will be placed on top of the existing layer in the map.

    Draw a line with the pen tool, you can see the points that I made to create curves.

    Here is more information on the pen tool: http://psd.tutsplus.com/tutorials/tools-tips/photoshops-pen-tool-the-comprehensive-guide/

    http://www.Tutorial9.NET/tutorials/Photoshop-tutorials/pen-tool-basics-in-Photoshop/

    In Photoshop, you have to go back to the options bar and select "shape". This allows you to place a 'coup' on the path (line) that you just created. Otherwise, it will not be displayed.

    You can see the settings in the Option bar above, I did. I made that Fill was placed on 'none', and I chose a color for my race, but also a point of size for the thickness of the line until its visible on my card.

    It comes to the final.

    Good luck!

    Janelle

  • How to record draws lines?

    Hello

    My goal is to make a flash application that can do these things:

    -drawing application database (I can handle this part)

    -Save the user features

    -save data that record each moves in a single file, let's call my-design-data file

    -load my-design-data file into the flash application

    -reading my-design-data file in order to watch a kind of movie that shows the drawing who 'draw' itself

    A good example of this application can be found on drawingnow.com. So I know it's possible but how...?

    Any ideas how they do?

    Hello

    Here is a very rough idea on how to record and playback of drawing.

    Capture the drawing:

    -drawing points are stored in a table "_pointArray".

    -the "_pointArray" coded JSON is published on the server.

    -Next - server, save the string in a file or a database.

              private function mouseDownHandler(e:MouseEvent):void{
    
                   //start new segment
                   moveTo(stage.mouseX,stage.mouseY);
    
                   //mark the point as starting point , "newline=true"
                   _pointArray.push({x:stage.mouseX, y:stage.mouseY, time:getTimer(), newline:true});
    
              }
    
              private function mouseMoveHandler(e:MouseEvent):void{
                   if(e.buttonDown){
    
                        //draw line
                        drawLine(stage.mouseX, stage.mouseY);
    
                        //record the points
                        _pointArray.push({x:stage.mouseX, y:stage.mouseY, time:getTimer()});
    
                   }
              }
    
              private function moveTo(x:Number, y:Number):void{
                   this.graphics.moveTo(x,y);
              }
    
              private function drawLine(x:Number, y:Number):void{
                   this.graphics.lineTo(x,y);
              }
    
              private function saveData():void{
                   var json:JSONEncoder = new JSONEncoder(_pointArray);
                   var urlVariable:URLVariables = new URLVariables();
                   var urlRequest:URLRequest = new URLRequest('{URL_TO_POST_AND_SAVE_POINTS}');
    
                   urlVariable.points = json.getString();
                   urlRequest.method = URLRequestMethod.POST;
                   urlRequest.data = urlVariable;
    
                   var urlLoader:URLLoader = new URLLoader();
    
                   urlLoader.load(urlRequest);
                   urlLoader.addEventListener(Event.COMPLETE, saveCompleteHandler);
    
              }
    
              private function saveCompleteHandler(e:Event):void{
                   trace("Saved the animation");
              }
    

    Load and replay the animation:

    -load the json string

    -Decode the json string to array

    -Playback of the animation

                             private function loadData():void{
                        var urlRequest:URLRequest = new URLRequest('{REQUEST_URL_TO_LOAD_POINTS}');
                        var urlLoader:URLLoader = new URLLoader();
                        urlLoader.addEventListener(Event.COMPLETE,loadCompleteHandler);
                        urlLoader.load(urlRequest);
                   }
    
                   private function loadCompleteHandler(e:Event):void{
                        var loader:URLLoader = e.target as URLLoader;
                        var json:JSONDecoder = new JSONDecoder(loader.data as String);
                        _pointArray = json.getValue() as Array;
    
                        //start the animation
                        playAnimation();
                   }
    
                   //Playback the drawing on an EnterFrame/Timer event
                   private function playBackHandler(e:Event):void{
                        var nextPoint:Object = _pointArray[_currentIndex];
                        var nextMilliSec:Number =  nextPoint.time;
                        var timeLapsed:Number = getTimer() - _startTime;
    
                        while(timeLapsed >= nextMilliSec){
                             if(nextPoint.newline){
                                  //stating point
                                  moveTo(nextPoint.x, nextPoint.y);
                             }else{
                                  //draw line
                                  drawLine(nextPoint.x, nextPoint.y);
                             }
    
                             //next array index
                             _currentIndex++;
    
                             //reached the end?
                             if(_currentIndex >= _pointArray.length){
                                  stopPlayBack();
                                  break;
                             }else{
                                  nextPoint = _pointArray[_currentIndex];
                                  nextMilliSec =  nextPoint.time;
                             }
    
                        }
                   }
    

    Kadiatou

  • Drawing line with the mouse clicks on picture indicator

    Hello

    I need to import a JPG file in an image control, draw a line in 2 clicks, read bothe XY positions and perform some basic trigonometry. Any simple or striaghtforward way to draw the line with the mouse and read thos passay on the bitmap (positions relative pixel)?

    Thanks in advance,


Maybe you are looking for

  • Can satellite P100-387 - I use a solid state drive?

    Is it possible to change the disk hard original toshiba satellite P100-387 with new SSD. i.e.: Kingston SSDNow V-Series 128 GB?

  • SLog2 in low light conditions

    Hello, hoping for some advice please. What about the slog2 being wonderful shooting large latitudes in broad daylight and in situations where preserving highlights important - is fair to say then that slog2 so not ideal for low light dark environment

  • Unable to attach files in hotmail; yellow-box message days "attachment a bad identification."

    My menu drop down to attachments in hotmail said "choose"; now says 'open', when I click to attach a file.  spend 30 seconds to a minute after clicking on the file; then this entire toolbar in the message disappears completely, do not attach the file

  • PhotoStory3

    The software installed a few days ago. Question:How to stop the action of "zoom in","zoom out".I went on the settings, it is not in the Transition section.Cannot find the option to turn off.Thank you. t-4-2

  • What is the correct USB 3.0 PCIE card for Z800?

    I am looking to buy the correct USB 3.0 PCIe card for a Z800, but I can't find any HP thru. Anyone has the info > 12 and 60 cards HP dollar on EBAY, but I don't know if those who are good.