Well, I finally figured out that createEmptyMovieClip() doesn't return
anything...so instead of:
var emptyClip = createEmptyMovieClip("rectangleInNode",
getNextHighestDepth());
emptyClip.beginFill(0xFFFFFF); //Currently harcoding a white fill...
...
I should have done:
createEmptyMovieClip("rectangleInNode", getNextHighestDepth());
rectangleInNode.beginFill(0xFFFFFF); //Currently harcoding a white
fill...
...
That solved my problem. It does draw a rectangle for me, so I'm not
sure why it doesn't fr you, Abdul. However, I appreciate the reply!!!
Joey
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Abdul Qabiz
Sent: Thursday, September 15, 2005 10:40 AM
To: [email protected]
Subject: RE: [flexcoders] Drawing a rectangle in Flex
Hi,
It is working for me, however it doesn't draw a rectangle instead some
other shape.
I am using following code along with myClass.as:
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.macromedia.com/2003/mxml" xmlns="*"
creationComplete="foo.rectangle(100,100)">
<myClass id="foo"/>
</mx:Application>
-abdul
________________________________
From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of Mink, Joseph
Sent: Thursday, September 15, 2005 1:18 AM
To: [email protected]
Subject: [flexcoders] Drawing a rectangle in Flex
Hi,
I have the following method in a class that extends
mx.containers.Canvas. Shouldn't this work? I don't see any of the
lines...However, if I remove the "emptyClip" altogether, & just draw
directly on the Canvas of the local object, the lines appear. But I
want the rectangle to be an individual child of the myClass Canvas. Any
thoughts on where I'm goning wrong?
class myClass extends mx.containers.Canvas
{
...
/*
Draws a "hard-cornered" rectangle.
TODO: Add support for fill color.
*/
function rectangle (boxWidth:Number, boxHeight:Number):Void
{
var L_INDENT = 3;
var TOP_INDENT = 3;
var R_INDENT = 2;
var BOT_INDENT = 2;
var emptyClip = createEmptyMovieClip("rectangleInNode",
getNextHighestDepth());
emptyClip.beginFill(0xFFFFFF); //Currently harcoding a white
fill...
emptyClip.lineStyle (2, 0x000000);
emptyClip.moveTo(L_INDENT, TOP_INDENT);
emptyClip.lineTo(width - R_INDENT, TOP_INDENT);
emptyClip.lineTo(width - R_INDENT, height - BOT_INDENT);
emptyClip.lineTo(L_INDENT, boxHeight - BOT_INDENT);
emptyClip.lineTo(L_INDENT, TOP_INDENT);
emptyClip.endFill();
}
...
}
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives:
http://www.mail-archive.com/flexcoders%40yahoogroups.com
________________________________
YAHOO! GROUPS LINKS
* Visit your group "flexcoders
<http://groups.yahoo.com/group/flexcoders> " on the web.
* To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>
* Your use of Yahoo! Groups is subject to the Yahoo! Terms of
Service <http://docs.yahoo.com/info/terms/> .
________________________________
------------------------ Yahoo! Groups Sponsor --------------------~-->
Most low income households are not online. Help bridge the digital divide today!
http://us.click.yahoo.com/cd_AJB/QnQLAA/TtwFAA/nhFolB/TM
--------------------------------------------------------------------~->
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/flexcoders/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/