Adobe Dreamweaver Forums



Last 10 THreads :         Javahelp/Oracle Help (Last Post : cindys@ddms.com - Replies : 9 - Views : 10 )           »          FlashVars help (Last Post : Cgull - Replies : 2 - Views : 3 )           »          Quiz results and slide views (Last Post : dlspielman@gmail.com - Replies : 0 - Views : 1 )           »          Repeater and XML problem (Last Post : ntsiii - Replies : 1 - Views : 4 )           »          accessing data in ArrayCollection (Last Post : ntsiii - Replies : 1 - Views : 8 )           »          Re: Avoiding infinite loop with cfinclude? (Last Post : Ian Skinner - Replies : 3 - Views : 4 )           »          Spry issue with fade (Last Post : Dooza - Replies : 8 - Views : 9 )           »          Navigation from Contact Form (Last Post : mtrueblood - Replies : 2 - Views : 4 )           »          dreamweaver v. movable type? (Last Post : Dooza - Replies : 1 - Views : 2 )           »          Disabling menu bars in a browser window (Last Post : Dooza - Replies : 1 - Views : 2 )           »         


Home Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
User Info Statistics
Go Back   Adobe Dreamweaver Forums > Other Macromedia/Adobe Products > Flex
 
Tags:



Reply
  #1 (permalink)  
Old 10-31-2008, 06:27 PM
nahidupa
 
Posts: n/a
Diggs:
Default Draw a big line

Im try to draw a simple line with line to funtion here is my code

private function draw(sprite:Sprite):void {
sprite.graphics.lineStyle(1, 1, 1);
sprite.graphics.beginFill(bgColor);
sprite.graphics.moveTo(0, 0);
sprite.graphics.lineTo(9000000,9000000);
sprite.graphics.endFill();

}

but line thikness become unexpectedly wide. is it flex bug. this is also ture
as curveTo.


here is my detail code

advance thanks for any feed back.



<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
initialize="draw()">

<mx:Script>
<![CDATA[
// Draw an arrow.
public function draw(){
var x:LineTool=new LineTool();
this.addChild(x);
}

]]>
</mx:Script>



</mx:Application>

package
{
import flash.display.Sprite;
import flash.events.MouseEvent;
import mx.core.UIComponent;

public class LineTool extends UIComponent {
private var size:uint = 100;
private var bgColor:uint = 0xFFCC00;

public function LineTool() {
var child:Sprite = new Sprite();
child.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler);
child.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);
draw(child);
addChild(child);
}

private function mouseDownHandler(event:MouseEvent):void {
trace("mouseDownHandler");
var sprite:Sprite = Sprite(event.target);
sprite.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);
sprite.startDrag();
}

private function mouseUpHandler(event:MouseEvent):void {
trace("mouseUpHandler");
var sprite:Sprite = Sprite(event.target);
sprite.removeEventListener(MouseEvent.MOUSE_MOVE,
mouseMoveHandler);
sprite.stopDrag();
}

private function mouseMoveHandler(event:MouseEvent):void {
trace("mouseMoveHandler");
event.updateAfterEvent();
}

private function draw(sprite:Sprite):void {
sprite.graphics.lineStyle(1, 1, 1);
sprite.graphics.beginFill(bgColor);
sprite.graphics.moveTo(0, 0);
sprite.graphics.lineTo(9000000,9000000);
// sprite.graphics.curveTo(0,0,199991,0);
sprite.graphics.endFill();

}
}

}



Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



© Camley Interactive (camley.info) 2008 - all logos and images are copywrite their respective owners.
Proud member of the Camley Interactive Network
All times are GMT. The time now is 05:44 PM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
Cheap Car Insurance - Compare Motor Insurance
Endsleigh Car Insurance Natwest Car Insurance
More Than Car Insurance Norwich Union Car Insurance
Prudential Car Insurance Zurich Car Insurance
Inactive Reminders By Mished.co.uk