Archive for June, 2008

DashedLine and DashedPolyLine extending Degrafa

I needed to draw some dashed lines and polylines for something I was working on. I was already using Degrafa and wanted to create the dashed lines by extending Degrafa. It was actually easier then I thought it would be.

You can see the finished result here and the view source code is enabled through right clicking. The two new classes DashedLine and DashedPolyline extend Line and Polyline and added two new properties “dash” and “gap”. You set these two values with the value of how big you want the dash and the gap to be. In the future this could be extended to have any number of dash/gap patterns but all I needed was a simple repeating one.

This was based on the Degrafa 1.2 swc but it should work for the 2.2* latest drops.

All the extending that was needed was to inherit the Line and Polyline class and override the preDraw() method. In the overridden preDraw() method I looped through the normal x,y cords and create extra commands based on the dash and gap properties that I exposed in the two new classes DashedLine and DashedPolyline.

NOTE: I did find the use of private member variables and methods in Line and Polyline to be restrictive and had to call super.preDraw() first to make sure some things where called. It still worked for my case but if you wanted to do something total different it was impossible to set the _setBounds correctly.

Add comment June 16th, 2008


RemoteObjectAMF0 swc for Flex 3

There was a small change in Flex 3 that causes the RemoteObjectAMF0 class to not compile in Flex 3 apps. I have updated the class and the swc.

The updated RemoteObjectAMF0 code can be found in the renaun_com_RemoteObjectAMF0_flex3.swc in the zip file at - http://renaun.com/flex2/RemoteObjectAMF0/renaun_com_RemoteObjectAMF0.zip

NOTE: updated again to add a line to delete references to the responders after it is passed back.

3 comments June 16th, 2008


Disclaimer: I work as a Flash/Flex Developer for Adobe Systems Incorporated. The opinions expressed here represent my own and not those of my employer.

My Amazon.com Wish List

Calendar

June 2008
S M T W T F S
« May   Jul »
1234567
891011121314
15161718192021
22232425262728
2930  

Posts by Month

Posts by Category


Flex.org - The Directory for Flex