AS3 : with keyword

2 views
Skip to first unread message

Abdul

unread,
Sep 7, 2010, 1:20:18 AM9/7/10
to

AS3 : with keyword

It can be used to write cleaner code when setting multiple properties of the same object.


Normal Code:

var circle:Sprite = new Sprite();
circle.graphics.beginFill(0xFFCC00);
circle.graphics.drawCircle(100,100,50);
circle.graphics.endFill();
addChild(circle);


Using with keyword Code:
var circle:Sprite = new Sprite();
with (circle.graphics)
{
beginFill(0xFFCC00);
drawCircle(100, 100, 50);
endFill();
}
addChild(circle);



--
With Regards,
Abdul.


Satish Gupta

unread,
Sep 8, 2010, 1:06:45 AM9/8/10
to flex_...@googlegroups.com
Its good

--
You received this message because you are subscribed to the Google Groups "Flex India Community" group.
To post to this group, send email to flex_...@googlegroups.com.
To unsubscribe from this group, send email to flex_india+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/flex_india?hl=en.



--
Thanks & Regards,
SATISH GUPTA
RIA Developer
Adobe Certified Expert(Flex3.0-AIR)
Mob: 9769267997/9619591230
Tekno Point Multimedia | www.teknopoint.in

Iyer Anuradha

unread,
Sep 8, 2010, 7:49:45 AM9/8/10
to flex_...@googlegroups.com

Vow its new to know.  Thank you so much.  Keep it up.
 

 

Lokesh jadwani

unread,
Sep 15, 2010, 12:11:10 PM9/15/10
to flex_...@googlegroups.com
Gr8!
I was looking for this keyword
 
Lokesh

Banu

unread,
Sep 16, 2010, 2:55:16 AM9/16/10
to flex_...@googlegroups.com
thanks this is helpful.
Reply all
Reply to author
Forward
0 new messages