also, set childCompletion="all" it's possible the canvas hasn't been fully
rendered. You could also move the creationComplete init() to fire from the
Canvas, instead of the Application

On Tue, Nov 16, 2010 at 9:02 AM, Darin Kohles <[email protected]> wrote:

> I doubt this will help, but inline styles override css styles. But since
> clearly you are adding the graphic at runtime this shouldn't be an issue.
> Have you tried setting the fillStyle as well (even though it's not being
> used)?
>
> Also you might do graphics.clear(), before you start drawing.
>
>
> On Tue, Nov 16, 2010 at 8:53 AM, Chris Morrow <[email protected]>wrote:
>
>> Not sure why, but I always use a nested canvas; one for the bgcolor and
>> one for graphics and other elements.
>>  - Chris Morrow
>>
>>
>> <?xml version="1.0" encoding="utf-8"?>
>> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
>>                 layout="absolute" creationComplete="init()">
>>     <mx:Script>
>>         public function init():void
>>         {
>>             drawing_canvas.graphics.lineStyle(3,0xffffff, 1.0);
>>             drawing_canvas.graphics.moveTo(10,10);
>>             drawing_canvas.graphics.lineTo(100,100);
>>         }
>>     </mx:Script>
>>     <mx:Canvas width="100%" height="100%" backgroundColor="0x000000">
>>         <mx:Canvas id="drawing_canvas" />
>>     </mx:Canvas>
>> </mx:Application>
>>
>>
>> On Tue, Nov 16, 2010 at 9:29 AM, Atlanta Geek <[email protected]>wrote:
>>
>>> I have the following code and the line is not visible.  If I remove
>>> the background color from the canvas the line is visible.
>>> Would anyone know why this is happening? I am on Flex 3.5
>>>
>>> <?xml version="1.0" encoding="utf-8"?>
>>> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";
>>> layout="absolute" creationComplete="init()">
>>> <mx:Script>
>>> public function init():void
>>> {
>>>  drawing_canvas.graphics.lineStyle(3,0xffffff, 1.0);
>>>  drawing_canvas.graphics.moveTo(10,10);
>>>  drawing_canvas.graphics.lineTo(100,100);
>>> }
>>> </mx:Script>
>>>
>>> <mx:Canvas id="drawing_canvas" width="100%" height="100%"
>>> backgroundColor="0x000000" />
>>> </mx:Application>
>>>
>>>
>>> -------------------------------------------------------------
>>> To unsubscribe from this list, simply email the list with unsubscribe in
>>> the subject line
>>>
>>> For more info, see http://www.affug.com
>>> Archive @ http://www.mail-archive.com/discussion%40affug.com/
>>> List hosted by http://www.fusionlink.com
>>> -------------------------------------------------------------
>>>
>>>
>>>
>>
>
>
> --
> Darin Kohles
>
>


-- 
Darin Kohles

Reply via email to